fable-compiler / Fable

F# to JavaScript, TypeScript, Python, Rust and Dart Compiler
http://fable.io/
MIT License
2.9k stars 297 forks source link

Fable.sln does not restore #3687

Closed nojaf closed 8 months ago

nojaf commented 9 months ago

I'm not able to run dotnet restore Fable.sln on the latest main:

dotnet restore .\Fable.sln                                                                                                                                                                                                       ❮  6s 727ms    1
  Determining projects to restore...
C:\Users\nojaf\Projects\Fable\tests\React\Fable.Tests.React.fsproj : warning NU1608: Detected package version outside of dependency constraint: Fable.Jester 0.33.0 requires Fable.Core (>= 3.2.8 && < 4.0.0) but version Fable.Core 4.2.0 was resolved. [C
:\Users\nojaf\Projects\Fable\Fable.sln]
C:\Users\nojaf\Projects\Fable\tests\React\Fable.Tests.React.fsproj : warning NU1608: Detected package version outside of dependency constraint: Fable.ReactTestingLibrary 0.33.0 requires Fable.Core (>= 3.2.8 && < 4.0.0) but version Fable.Core 4.2.0 was
 resolved. [C:\Users\nojaf\Projects\Fable\Fable.sln]
C:\Users\nojaf\Projects\Fable\tests\Js\Adaptive\Fable.Tests.Adaptive.fsproj : error NU1202: Package Expecto 10.1.0 is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). Package Expecto 10.1.0 supports: net6.0 (.NETCoreApp,Version=v6.0) [C
:\Users\nojaf\Projects\Fable\Fable.sln]
  Failed to restore C:\Users\nojaf\Projects\Fable\tests\Js\Adaptive\Fable.Tests.Adaptive.fsproj (in 194 ms).
  23 of 24 projects are up-to-date for restore.

I believe this goes undetected as the CI jobs don't restore any solution file. I do find this rather annoying, would you accept a PR with a simple job that builds both solutions?

MangelMaxime commented 9 months ago

It is possible that it goes undected because I forgot to run the Fable.Tests.Adaptive tests as part of the JavaScript tests suites.

https://github.com/fable-compiler/Fable/blob/3fe0a391b45a0a9ddf1441ab44946987290b45b0/src/Fable.Build/Test/JavaScript.fs#L105-L115

I would first check if running the tests catch the problem of that specific project. And depending on the answer add or not a dotnet restore instruction to either the CI or build script.

nojaf commented 9 months ago

Running dotnet restore is typically a requirement to get IntelliSense in the IDE. Your IDE will run it for you if you don't do it. Contributors shouldn't have to run any tests before opening the solution in their IDE, imho.

MangelMaxime commented 9 months ago

Sure, but running the tests should trigger the restore mechanism which should catch the fact that this project doesn't restore. So I don't think I am not totally off.

We can add a dotnet restore actions if we want to be explicit about it. This is just that's it is a first time for me to have that has part of the CI. Has in general it is checked indirectly by running tests, building the package in the CI etc.

nojaf commented 8 months ago

In a way, this was also addressed in https://github.com/fable-compiler/Fable/pull/3671. As the solution is built in the analyzer job.