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

Fsc.compileExternal documentation suggests possible to use with exe #2395

Closed
wallymathieu opened this issue Sep 22, 2019 · 6 comments · Fixed by #2397
Closed

Fsc.compileExternal documentation suggests possible to use with exe #2395

wallymathieu opened this issue Sep 22, 2019 · 6 comments · Fixed by #2397

Comments

@wallymathieu
Copy link
Member

wallymathieu commented Sep 22, 2019

Description

Fsc.compileExternal expects location of an f# compiler. On Mac OS X, you cannot pass in an .exe since it's not an executable.

Repro steps

Steps required to reproduce the problem

  1. Use latest version of FAKE

  2. Fsc.compileExternal fscExeLocation ...

  3. Run on Mac OS X (and others)

Expected behavior

I would expect the documentation to reflect that the behavior is valid on Windows or that Fake takes care of wrapping the execution of Fsi exe. Perhaps by allowing a flag to indicate how you want that wrapping to be done on non Windows systems?

Actual behavior

Fails with a Win32Exception: Permission denied

Known workarounds

Writing platform specific wrapper scripts in order to pass allow usage of exe.

Related information

  • Mac OS X 10.14.6 (18G95)
  • 2.2.402, 3.0.100-rc1-014190
  • Mono JIT compiler version 6.0.0.334 (2019-02/6256b82d62f Tue Sep 3 17:44:33 EDT 2019)
  • Version of FAKE: 5
@matthid
Copy link
Member

matthid commented Sep 22, 2019

I'm not sure what is happening here and I'm not using a Mac. Can you try to send a fix?
I would imagine this to be a small fix somewhere or your executable flags are not set correctly?

@wallymathieu
Copy link
Member Author

The problem is that a dotnet exe on windows is an executable, while on other operating systems need to be wrapped by a script invoking either dotnet or mono to run the exe.

@matthid
Copy link
Member

matthid commented Sep 22, 2019

@wallymathieu why is that a problem?

  1. We have helpers to prepend a command line with mono when on not-windows.
  2. For dotnet there is no difference between windows and not windows.
    a) when tools are build they need to be run with dotnet runtime on both platforms (even on windows)
    b) When tools are published as self-contained deployment a executable is generated for windows and for non-windows platforms.

So for new sdk there is no difference and for legacy we have helpers...

@wallymathieu
Copy link
Member Author

So how is the correct usage of the command supposed to be? I mean, should the documentation be clearer about how it should be invoked on non-windows systems?

@wallymathieu
Copy link
Member Author

Would the correct thing be to submit a pull request with CreateProcess.withFramework in

https://github.com/fsharp/FAKE/blob/e9fc744e0bfe41aa3f14470cdb2062d1aec1c285/src/app/Fake.DotNet.Fsc/Fsc.fs#L427-L437

?

@matthid
Copy link
Member

matthid commented Sep 22, 2019

Yes that would probably solve it for regular fsc.exe which needs to be invoked with mono (as long as mono is installed)

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

Successfully merging a pull request may close this issue.

2 participants