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

bridgestan on Julia crashes on windows if .julia path has spaces #160

Closed
alexandrebouchard opened this issue Jul 20, 2023 · 5 comments
Closed

Comments

@alexandrebouchard
Copy link

Thanks for the nice project! It has been quite helpful to use in our Julia distributed parallel tempering project, https://github.com/Julia-Tempering/Pigeons.jl

One of our users reported that the Julia bridgestan fails during precompilation if the path to .julia in windows contains a space. For reference: Julia-Tempering/Pigeons.jl#80 (comment)

Not sure if this relevant here, but we had a similar problem in another project at some point and found that using raw strings of the form raw"code/for/building/paths/from/$variable" was necessary to support windows + path with spaces.

@WardBrian
Copy link
Collaborator

I believe that this is a restriction of mingw32-make, which we currently use for our build process. I’m not sure if we can work around this as long as we rely on that tool, but it’s good to investigate and note either way.

Thanks for the report!

@alexandrebouchard
Copy link
Author

Thank you! Strangely though, that seems to happen before mingw32-make gets called, i.e. while doing package installation. The relevant bits of the error message seem

Unable to automatically download/install artifact 'bridgestan' from sources ...

and

Error: SystemError: opening file "C:\\Users\\Gabriel
Kreindler\\.julia\\artifacts\\ac3a3214a3759f4eb652ce30f2e1b2feb6df1f00\\bridgestan-2.1.1\\stan\\lib\\stan_math\\lib\\boost_1.78.0\\libs\\intrusive\\proj\\vc7ide\\has_member_function_callable_with_no_decltype\\has_member_function_callable_with_no_decltype.vcproj":
No such file or directory

I was puzzled it would crash during package install since the Julia __init__() seems pretty minimal.

Do you think potentially the problem is could rather be coming from the LazyArtifacts dependency?

@WardBrian
Copy link
Collaborator

Hm, that filename is 281 characters long, which is just over the ~280 character “limit” I’ve observed certain processes on Windows failing at. For example, the Prophet python package (based on Stan) recently had issues with very long path names:
facebook/prophet#2402 (comment)

The space in the path probably would have also caused problems later, but I suspect whatever alternative path was chosen was also shorter, not just space free.

I believe this kind of issue can occur even if the LongPathsEnabled registry key is set, possibly because the Win32 API used by mingw32-make (and, since julia is also compiled with gcc on windows, I assume Julia uses this too) may ignore that setting as it is a relatively recent addition to the windows runtime.

@alexandrebouchard
Copy link
Author

Wow! Interesting, I didn't know about that crazy windows limitation. How people can live like this? ;) Thank you!!

@WardBrian
Copy link
Collaborator

Some more information (or at least relevant-sounding issues):

JuliaLang/julia#39774

JuliaLang/Pkg.jl#1943 (comment)

This second post implies that LongPathsEnabled may have fixed it in their case, but this had no impact the last time I encountered an issue of this flavor on Windows

I suppose this kind of thing is good to document somewhere, but I’m not sure how to phrase it in a way that doesn’t sound super tin-foil-hat-y

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

2 participants