Comments (7)
Yeah, I'd be happy to merge in a PR that has the right set of MSBuild properties to trigger a design-time F# build, but I'm afraid without a contribution it's something that's out of my league and time availability to figure out on my own.
Thanks - I was just explaining why using the output of Buildalyzer for generating compiler options, while works, is not exactly what I was hoping for 👍
from buildalyzer.
Buildalyzer works by calling MSBuild from the command line (the same way you can) while passing it a special logger that sends messages over a pipe back to Buildalyzer for analysis. Performing a "real" design-time build is a challenge - Visual Studio and other IDEs set a lot of different MSBuild properties to make that work correctly, and the correct combinations aren't well documented (if at all).
For C# I was able to reverse-engineer the set of properties to use, which Buildalyzer does by setting environment variables before calling MSBuild. However, in F# the code was entirely donated by the community - I know very little about how the F# compiler works and interacts with MSBuild outside of the unit tests in Buildalyzer I use to verify it's at least returning results. My ability to debug Buildalyzer working against an F# project is very limited. If you happen to figure out the correct set of MSBuild properties to configure for a fast design-time build of an F# project, let me know and we can look at updating the MSBuild call with those. The first step would probably be seeing if you can get it to work from a raw MSBuild command-line (I.e. without Buildalyzer at all) by using the MSBuild CLI switch for setting properties - play around with that until you figure out the right super-set of properties, then we can integrate them.
from buildalyzer.
Thanks a lot for the explanation @daveaglick.
@safesparrow I am using Buildalyzer with Fable, I take the compiler options directly by splitting the lines of result.Command and it works (source files are lines not starting with a hyphen).
from buildalyzer.
That should work - the main issue with it and the topic of this issue is that it actually performs a full build, which is not something you'd normally need just to get the compiler commandline, and it can be slow due to that.
Yeah, I'd be happy to merge in a PR that has the right set of MSBuild properties to trigger a design-time F# build, but I'm afraid without a contribution it's something that's out of my league and time availability to figure out on my own.
from buildalyzer.
Actually my 'fix' doesn't work - it gives empty results (eg. no source files).
So still an open question for me as to how to do quick design-time builds.
from buildalyzer.
Thanks a lot for the explanation @daveaglick.
@safesparrow I am using Buildalyzer with Fable, I take the compiler options directly by splitting the lines of result.Command and it works (source files are lines not starting with a hyphen).
That should work - the main issue with it and the topic of this issue is that it actually performs a full build, which is not something you'd normally need just to get the compiler commandline, and it can be slow due to that.
It's also not trivial to construct FSharpOptions
objects from it, especially in a project graph, rather than just a standalone project. But I'm sure what you've done in eg. https://github.com/fable-compiler/Fable/blob/b502e14cff8b05c92253112019b22474146b5414/src/Fable.Cli/ProjectCracker.fs handles that.
from buildalyzer.
Closing the issue due to lack of activity, if you have any updates about F#, please open a new one.
from buildalyzer.
Related Issues (20)
- Unsupported log file version HOT 8
- Cache dotnet info results per global.json file HOT 5
- Error when trying to read dotnet --info HOT 3
- multiple Buildalyzer.Tests unit tests are failing HOT 3
- Make working directory used by ProcessRunner configurable HOT 3
- [Discussion] Calling `GetCompilationAsync` on ASP.NET Framework project returns empty compilation HOT 3
- Help offered HOT 1
- Could not load file or assembly `NuGet.Frameworks` HOT 16
- Build/assembly reference not found errors due to random sorting of the projects in the Workspace when loading projects from solution file HOT 9
- Xml documentation is missing for imported symbols in Roslyn Projects HOT 3
- Looking For A New Maintainer HOT 4
- Sponsoring HOT 4
- Coding style, static code analysis, and versioning HOT 15
- Immutability HOT 3
- Targeting netstandard HOT 1
- Error running on macos-14-arm64 image
- Buildalyzer hangs if build does not start
- Buildalyzer seems to be using C# 11 instead of 7.3 on some machines even for a .NET 4.8 project. HOT 8
- Making the library language-agnostic HOT 2
- Buildalyzer should be able to build projects with C# 12 language features
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from buildalyzer.