Skip to content

Conversation

@nojaf
Copy link
Contributor

@nojaf nojaf commented Sep 6, 2022

Ignore the first commits, I would rebase afterwards.

In 034123a I tried to add a way to run checker.Compile.

This currently doesn't really work.
Compile expects all the DLLs to be present. I tried building the project via an external process first, but that didn't end well (See dotnet/sdk#9298).

And when the projects were all built before running the Generator, the FSharpProjectOption are as good as empty 😔. I'm not sure why that is, although I assume the attempt to build projects mixes up things.

In short, not sure if you really want this one 😅

@safesparrow
Copy link
Owner

safesparrow commented Sep 6, 2022

Thanks for this idea!

Compile expects all the DLLs to be present.

Yes, I would expect that - it behaves the same fsc.exe does.
During a regular commandline build MSBuild calls into fsc.exe as part of the CoreCompile target, individually for every project, once all its dependencies have been built, and passes in all the dlls.
So you'd definitely want to build all dependencies beforehand.

I tried building the project via an external process first, but that didn't end well (See dotnet/sdk#9298).

Hmm, what error are you seeing and what commandline were you running?

And when the projects were all built before running the Generator, the FSharpProjectOption are as good as empty 😔. I'm not sure why that is, although I assume the attempt to build projects mixes up things.

Hmm, I tried to reproduce it but couldn't:
dotnet build C:\.artifacts\fsharp-samples\744ada94e1fffda8d622f817f6b7642a0d17e4f0\50_leaves
...
Build succeeded.
    0 Warning(s)
    0 Error(s)
...
fcs-benchmark --sample 50_leaves --local=C:/projekty/fsharp/fsharp-otel -c C:/.artifacts --gc=Server --parallel-analysis=On --record-otel-jaeger -w 0 -n 1
...
[23:34:18 INF] Run: Starting the benchmark:
- Full BDN output can be found in C:\projekty\fsharp\fsharp-benchmark-generator\BenchmarkDotNet.Artifacts/*.log.
- Full commandline: 'dotnet run -c Release -- --artifacts-path=C:\projekty\fsharp\fsharp-benchmark-generator\FCSBenchmark.Artifacts --input=C:\.artifacts\fsharp-samples\744ada94e1fffda8d622f817f6b7642a0d17e4f0\.artifacts\2022-09-06_22-34-18.fcsinputs.json --iterations=1 --warmups=0 --record-otel-jaeger=True --parallel-analysis=On --gc=Server  --local C:/projekty/fsharp/fsharp-otel'
...
[23:34:45 INF] Run: | Method |    Mean | Error |     Gen 0 |     Gen 1 |     Gen 2 | Allocated |
[23:34:45 INF] Run: |------- |--------:|------:|----------:|----------:|----------:|----------:|
[23:34:45 INF] Run: |    Run | 2.694 s |    NA | 7000.0000 | 3000.0000 | 2000.0000 |      9 GB |

How did you detect that the FSharpProjectOptions objects are invalid?

In general, it's not quite clear to me how the benchmarking should work for the compiler vs the checker.
Given that the compiler can be invoked directly from the commandline, the alternative way to run its benchmarks is to invoke fsc.exe directly. But maybe for now, until better setup exists, it would be handy to be able to run benchmarks of both the compiler and the checker with the same tool.

@nojaf
Copy link
Contributor Author

nojaf commented Sep 7, 2022

Hmm, weird so that actually worked for you?
When I tried it with Fantomas, I was unable to build the project (in a separate process) before running the checker.Compile(). I always got exit code 1, the log said the build did succeed but no DLLs were made.

Note that I removed that code that does the build.

How did you detect that the FSharpProjectOptions objects are invalid?

Both SourceFiles and OtherOptions were completely empty.

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

Successfully merging this pull request may close these issues.

2 participants