Coder Social home page Coder Social logo

Comments (7)

safesparrow avatar safesparrow commented on September 22, 2024 2

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.

daveaglick avatar daveaglick commented on September 22, 2024 1

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.

alfonsogarciacaro avatar alfonsogarciacaro commented on September 22, 2024 1

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.

daveaglick avatar daveaglick commented on September 22, 2024 1

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.

safesparrow avatar safesparrow commented on September 22, 2024

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.

safesparrow avatar safesparrow commented on September 22, 2024

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.

phmonte avatar phmonte commented on September 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.