Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discussion: Fable without fsproj? #3280

Open
njlr opened this issue Nov 20, 2022 · 1 comment
Open

Discussion: Fable without fsproj? #3280

njlr opened this issue Nov 20, 2022 · 1 comment

Comments

@njlr
Copy link
Contributor

njlr commented Nov 20, 2022

I have been investigating writing a set of Fable rules for Bazel. In this use-case, we don't have any fsproj files - just a dependency graph of source-files and NuGet packages (not in the usual packages folder).

One approach to compiling these with Fable is to take this graph, generate fsproj files for each target and then run Fable on that.

However, this is quite inefficient (and indirect), since we are effectively:

  • Taking a graph of "cracked" projects
  • Writing project files
  • Giving the project files to Fable to crack
  • Compiling the code

So, I was wondering if Fable should provide a CLI for building fs files directly?

@ncave
Copy link
Collaborator

ncave commented Nov 20, 2022

@njlr If you have the list of source files and nuget packages, generating a (temp) project file should be trivial, no? At least no more difficult than providing the same information via parameters?

The main reason we're cracking a F# .fsproj is to use MSBuild to get all the referenced .NET assemblies, which otherwise will have to be supplied via parameters somehow. I'm not saying it's not possible, we can technically use a fixed list as we do for the Fable REPL, but that's somewhat brittle and is mainly for Fable variations targeting platforms that do not support MSBuild or have no .NET installed at all (e.g. a browser).

TL;DR I don't think using .fsproj will be inefficient, now that Fable 4 is using design-time builds for project cracking, which are much faster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants