fable-compiler / Fable

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

Fable can't build more than 3 project at a time #940

Closed MangelMaxime closed 7 years ago

MangelMaxime commented 7 years ago

Description

I am working on the http://github.com/fable-compiler/samples repo. Where we are compiling a lot of project at the same time in webpack.

When I have more than 3 projects active in webpack.config.js then fable failed to compile and seems to mess up the files between the project.

Repro code

Try to build migrate-samples branch from the samples repo.

Example of error

ERROR in ./ozmo/Main.fs
Module build failed: 
Error: File C:/Users/mange/Workspace/Github/fable-compiler/samples/ozmo/Main.fs 
doesn't belong to parsed project 
C:\Users\mange\Workspace\Github\fable-compiler\samples\samegame\SameGame.fsproj (C:/Users/mange/Workspace/Github/fable-compiler/samples/ozmo/Main.fs)
forki commented 7 years ago

"doesn't belong to parsed project" ;-)

MangelMaxime commented 7 years ago

@forki I think this is a side effect. If I try to compile, each sample one by one, or 3 by 3 (in whatever combinaison) the compilation is working.

alfonsogarciacaro commented 7 years ago

This is weird, the error message changed when parallel compilation was added. But you're using 1.0.4, right? Can you please check with dotnet fable --version?

MangelMaxime commented 7 years ago

Yes I am using 1.0.4

alfonsogarciacaro commented 7 years ago

It's too hot in Madrid and I can't sleep so I didn't find anything better to do than fixing this :wink: With latest Fable build, now all samples can build in parallel :smile: Thanks a lot for migrating them and also for the index.html, @MangelMaxime :+1:

Note to myself: Immutable structures, Alfonso, we're using F# for a reason.

BTW, @MangelMaxime, when reproducing the issue with your migrate-samples branch, the dotnet restore Fable.Samples.sln command didn't work (dotnet SDK 1.0.4 on macOS) so I had to restore all projects individually 😕

MangelMaxime commented 7 years ago

Thanks for the fix, I will test it :)

Strange dotnet restore Fable.Samples.sln that don't work for you... I will test it again under windows just to be sure.

And we can always go back to listing all the .fsproj in the batch file.

MangelMaxime commented 7 years ago

Restoring via the sln work on windows seems to work under windows.

Perhaps there is a bug on Unix systems ? To be sure, I will list all the fsproj into the .sh and .cmd file. Not like it's requiring a lot of jobs later. (as we will add them one by one :) )

alfonsogarciacaro commented 7 years ago

Yeah, it seems to be a problem only on Unix systems (I think my colleague in my project also had the same in Linux). I just noticed it's been reported here: https://github.com/dotnet/cli/issues/6723