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

Running fable on linux dotnet core 3 fails without details #1910

Closed
forki opened this issue Sep 24, 2019 · 19 comments
Closed

Running fable on linux dotnet core 3 fails without details #1910

forki opened this issue Sep 24, 2019 · 19 comments

Comments

@forki
Copy link
Collaborator

forki commented Sep 24, 2019

/usr/bin/yarn webpack-cli --config src/Client/webpack.config.js -p
yarn run v1.12.3
$ /home/gitlab-runner/builds/d5cd2d2a/0/products/msu.parking/node_modules/.bin/webpack-cli --config src/Client/webpack.config.js -p
Bundling for production...
fable-compiler 2.3.25
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: write EPIPE
    at _errnoException (util.js:992:11)
    at WriteWrap.afterWrite [as oncomplete] (net.js:864:14)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Running build failed.

Unfortunately it does not say what's going wrong

@forki
Copy link
Collaborator Author

forki commented Sep 24, 2019

image

this is probably related.

@forki
Copy link
Collaborator Author

forki commented Sep 24, 2019

I assume it needs "roll forward" trick.

Corresponding PR in Paket: fsprojects/Paket#3635

More details: https://github.com/dotnet/designs/blob/master/accepted/runtime-binding.md

@alfonsogarciacaro
Copy link
Member

alfonsogarciacaro commented Sep 25, 2019

Hi @forki! Thanks for the report and the links. According to the roll forwarding rules in the document you linked, dotnet SDK will only forward the runtime minor version by default. Can you please try by setting the environmental variable DOTNET_ROLL_FORWARD=Major? If it works, I can release a new version that sets this directly in Fable (RollForward project property) so users don't need to set the environmental variable by themselves.

@forki
Copy link
Collaborator Author

forki commented Sep 25, 2019

image

confirmed!

@alfonsogarciacaro
Copy link
Member

Great, thanks a lot for confirming! I published fable-compiler 2.4.0 with the RollForward project property. Hopefully this means you don't need to set the environmental variable by yourself 👍

@forki
Copy link
Collaborator Author

forki commented Sep 25, 2019

image

It does not help.

@forki forki reopened this Sep 25, 2019
@forki
Copy link
Collaborator Author

forki commented Sep 25, 2019

I assume the property in 6452101#diff-10d392ecb95787a8f3b4111d67ad744eR8 is only valid for projects that are built with dotnet SDK 3 or even need to be netcoreapp3.0 (which I don't hope).
Did you built the 2.4 with dotnet 3.0.100?

@alfonsogarciacaro
Copy link
Member

I used dotnet SDK 2.1.403. It's been a while since I haven't upgraded the global.json in Fable repo because last time I did there were problems. I can try upgrading to dotnet SDK 3 but still compile it as netcore2.1 which is the only LTS runtime at the moment.

@forki
Copy link
Collaborator Author

forki commented Sep 25, 2019

Yes that's what we should try next. My assumption is the new sdk will see the property and fo the right thing and still compile it to netcore2.1

@alfonsogarciacaro
Copy link
Member

Ok, done :) fable-compiler is built with dotnet SDK 3.0.100 (still targets netcoreapp2.1), I hope we're more lucky now 🤞

@matthid
Copy link
Contributor

matthid commented Sep 25, 2019

FYI there is a way without upgrading: https://github.com/fsharp/FAKE/pull/2372/files

@forki
Copy link
Collaborator Author

forki commented Sep 25, 2019 via email

@alfonsogarciacaro
Copy link
Member

Hopefully fable-compiler 2.4.1 works, I'd prefer to avoid MSBuild tricks that are not well documented. The link that @forki also posted above discourages the rollForwardOnNoCandidateFx option too: https://github.com/dotnet/designs/blob/master/accepted/runtime-binding.md#dotnet_roll_forward_on_no_candidate_fx

But it seems I've managed to break Travis now (I broke Appveyor a couple of commits ago) so now we have a Fable version in the wild with CI broken :/

@forki
Copy link
Collaborator Author

forki commented Sep 25, 2019

image

I does not work, yet. Different error

@matthid
Copy link
Contributor

matthid commented Sep 25, 2019

Yes that's what I linked above.

Afaik that are different things. Your link was a msbuild property, but afaik that property is not supported on SDK < 3. Using the runtime json is basically what the msbuild property does. Using src/app/fake-cli/runtimeconfig.template.json seems to be a generic way to tweak the runtime configuration which existed in SDK 2. The key is just not honored by older runtimes (but it will be for current runtimes). In the end the key must exist in the final runtime.json and there are multiple ways to achieve that, but not all work in SDK 2 world...

@forki
Copy link
Collaborator Author

forki commented Sep 25, 2019

I linked to fsprojects/Paket#3635

@matthid
Copy link
Contributor

matthid commented Sep 25, 2019

Ok sorry I'm quiet now :)

@alfonsogarciacaro
Copy link
Member

@ncave just made me realize they've "fixed" the behavior of the dotnet publish --output argument. Now the path is relative to the current directory not the project directory as before. I think this makes more sense but it broke the fable-compiler release so 2.4.1 doesn't actually contain the Fable .dll binaries (that's what the error message was about). Can you try again with 2.4.2?

@forki
Copy link
Collaborator Author

forki commented Sep 25, 2019

It works! Hurray

@forki forki closed this as completed Sep 25, 2019
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

3 participants