-
Notifications
You must be signed in to change notification settings - Fork 359
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
Opam for windows : make cold fails with OPAMW_SHGetFolderPath
#5861
Comments
Sorry you're encountering this. I've never seen this issue before and I'm not familiar with the windows API internals (https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetfolderpatha doesn't really tell me much). @dra27 do you have any idea what could be going wrong? On a side note: Is there any reason why you want to compile opam from scratch instead of using the precompiled binary provided? (see the first line of https://opam.ocaml.org/blog/opam-2-2-0-beta1/#How-to-Test-opam-on-Windows) Compiling opam is of course fine but between #5859 and this ticket you seem to keep encountering issues and I feel like it would be easier to just use the precompiled binary. If you've seen this blog post but didn't see the line I could try to change it to make it more visible if that helps. |
After reading some of the code, I opened #5862, which might or might not fix your issue (I don't know as I don't know how to reproduce it). In any case i believe it to be a general improvement so it might be worth merging it. |
@kit-ty-kate's fix is definitely the right way to tackle this, but out of curiosity, what are the values of USERPROFILE and LOCALAPPDATA in your environment ( |
Hello, this is the content of the two values:
For the context, I’m trying to configure a Windows VM I would use to compile code for windows. I won’t code in this environment, only compile and run tests. I’ve started with a fresh windows installation, installed the required driver to help in the VM, cygwin and that’s all. No Vs-code, no msvc, I’ve only installed what’s in the installation documentation. I got errors when using opam binary, and I wanted to reproduce using the latest git version before opening a ticket. I know this branch is still in beta, so it’s ok to get errors like this. I can’t help a lot, but if I can report you some more cases it’s ok for me :) |
Looking around it looks like So it looks like #5862 should fix your issue as |
This is definitely appreciated, thank you so much :3 |
I still have errors:
|
|
Could you try with the Side note: you can just run |
|
arf, sorry i made a mistake in the debug code. I've pushed a commit fixing it. Could you try again with that new code? |
|
The error looks to be My hunch is that it's probably LocalAppData. If that is the case, could you check that this directory exists?
|
Indeed, the error is located with In windows terminal:
In cygwin:
(the |
Also, the environment variable exist:
|
@Chimrod - I think the build is proceeding far enough that you should be able to run _build/default/src/client/opamMain.exe and I think that if you run that you will see the same exception? Could you try running that executable not from a Cygwin shell but from a fresh command prompt? Does it also raise the same exception? |
FYI, I’ve created a new user named "sebastien" (no accent, all in lowercase) and I’ve been able to build opam without issue. I wanted to be sure there was’nt any other causes:
Now I will switch to the user "Sébastien" and test your actions. |
With the previous user, I’ve been able to run This is the test in cygwin:
and from windows terminal:
(I’ve keeped the branch created by kit-ty-kate, and we can see the trace in the console). |
While debugging this i encountered another (somewhat related it seems) problem in dune ocaml/dune#10180 I tried to reproduce your setup with a small difference: |
So you got the initial issue where my journey started! I had this issue with the opam binary when I started to use it, but without any clue on the cause of the error, I switched to the sources and here we are. |
Aha - it was the caller, just not the one I was looking at it; nice find, @kit-ty-kate! |
Ah! Does Windows make the processing of strings dependent on the parent processes? (e.g. the parent process use If so this issue would finally make some sense and i'd feel relieved :D |
It's definitely not supposed to, no - the string processing is fixed at compile-time (that's the defining |
I’m trying to compile opam for windows from scratch. I have an error in the command make cold, which comes after the compiler has been bootstrapped:
The text was updated successfully, but these errors were encountered: