-
Notifications
You must be signed in to change notification settings - Fork 68
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
Build fails on Mono as fs{lex,yacc}.exe not executable #4
Comments
Not setting <Choose>
<When Condition="('$(OS)' != 'Windows_NT')">
<FsYaccToolExe>mono $(FsYaccToolExe)</FsYaccToolExe>
</When>
</Choose> However, I'm not sure of the exact syntax and location. |
Ordinarily I would agree with you, but mono's implementation of Process.Start actually knows to handle this case specially and uses mono to invoke the https://github.com/mono/mono/blob/master/mono/io-layer/processes.c#L806 Sadly the implementation still requires that the file be executable: https://github.com/mono/mono/blob/master/mono/io-layer/processes.c#L784 |
Ah ok. Seems this is a nuget problem, because cloning the FsYacc project and building it creates Target "FixExecPermissions" (fun _ ->
if isUnix then
let setExecutable f =
match f.ToString() with
| EndsWith ".exe" ->
System.Diagnostics.Process.Start("chmod", "+x " + f.ToString())
|> ignore
| otherwise -> ()
recursively ignore setExecutable (directoryInfo "packages")
)
"Clean"
==> "RestorePackages"
==> "FixExecPermissions"
==> "AssemblyInfo"
==> "Build"
==> "RunTests"
==> "All" |
After this issue I submitted a PR to mono so that it still launches .exe files without +x. Happy to report it's now been merged (mono/mono#1081) so I think we can close this. |
Thanks for checking! |
Mono's Process.Start will not run a
.exe
file unless it is marked exectuable. It's not clear if this behaviour is deliberate or not. See this bug report: https://bugzilla.xamarin.com/show_bug.cgi?id=17537The
lkg
bootstrapfs{lex,yacc}.exe
do not have executable permission set and so the build fails (error at the bottom).However, this is not just a problem for the build, if the permissions are not set in the NuGet package either, then this package cannot be used on Mono without a manual step (such as
find packages -name "*.exe" | xargs chmod +x
) after the package is downloaded. How can we address this? Is it possible to run a postinstall script on the package for example, or (less clean) to adjust the FsLex and FsYacc MSBuild tasks so that they set the executable bit on Mono before running?The text was updated successfully, but these errors were encountered: