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

Unbound module Stdlib #13

Closed
jonahbeckford opened this issue Nov 10, 2022 · 9 comments
Closed

Unbound module Stdlib #13

jonahbeckford opened this issue Nov 10, 2022 · 9 comments
Assignees
Milestone

Comments

@jonahbeckford
Copy link
Contributor

    Hello, I think I have the same problem. I tried running it without any anti-virus, but it did not change anything.

The error message seems to be the same, but before that I have :

========= [TROUBLESHOOTING] ocaml-system-71408-2bcd70.out ===========

[ocaml-system-71408-2bcd70.out] File "command line", line 1:
[ocaml-system-71408-2bcd70.out] Error: Unbound module Stdlib

Scroll up to see the [TROUBLESHOOTING] logs that begin at the [START OF TROUBLESHOOTING] line
Setup did not complete because an error occurred.
MSYS2 command failed! Exited with 107. Command was: export DKML_TMP_PARENTDIR='/ [...]

Error: Unbound module Stdlib That problem seems to be linked to incorrect version of compiler corresponding to the code.

( There is another problem afterwards when I try to re-install the code (but that is another problem) ;

2022-11-09T20:20:56.921Z Cleaning directory C:\Users\louis\AppData\Local\Programs\DiskuvOCaml\0 ...
Set-ItemProperty : Impossible de définir l’attribut, car les attributs ne sont pas pris en charge. Seuls les attributs suivants peuvent être définis :
Archive, Hidden, Normal, ReadOnly ou System.
Au caractère C:\Users\louis\AppData\Local\Temp\7z4A04CEBC\sg\network-ocamlcompiler\windows_x86_64\SingletonInstall\Deployers\Deployers.psm1:508 : 13
+             Set-ItemProperty -Path $_.FullName -Name Attributes -Valu ...
+          

)

Originally posted by @LouisClt in #9 (comment)

@jonahbeckford
Copy link
Contributor Author

jonahbeckford commented Nov 10, 2022

(I used a new issue since the error looks very different)

@LouisClt Can you:

  1. Erase C:\Users\louis\AppData\Local\Programs\DiskuvOCaml using the File Explorer
  2. Open a Command Prompt and type ocamlc -config. Hopefully that failed! If it didn't fail, please copy and paste the output into this issue, and do not go to step 3 below.
  3. Try to reinstall. If the reinstall does not work, you can setup a Zoom video call at https://calendly.com/diskuv/60min-install

@jonahbeckford jonahbeckford self-assigned this Nov 10, 2022
@LouisClt
Copy link

Thanks for your support, sorry, I thought the issue was similar with the other.
With your indications I was eventually able to install successfully diskuv. The problem was, it seems, that I had a previous installation of CamlLight that had defined the "CAMLLIB" env variable. This variable seemed to interfere with the process of installing diskuv (notably OCaml compilations). Removing this variable seemed to have fixed the problem (I also uninstalled CamlLight but I think it was not necessary).

@jonahbeckford
Copy link
Contributor Author

Do you think it should be safe just to delete the CAMLLIB environment variable if it exists at install time? I'm not that familiar with Caml Light.

@nojb
Copy link
Collaborator

nojb commented Nov 11, 2022

Do you think it should be safe just to delete the CAMLLIB environment variable if it exists at install time? I'm not that familiar with Caml Light.

Note that CAMLLIB is accepted as a synonym for OCAMLLIB to specify the standard library directory in current-date OCaml:

https://github.com/ocaml/ocaml/blob/dc0ab7f25841daa77c3c92d90dcfa8ea6db2621c/utils/config.common.ml#L22-L29

@jonahbeckford
Copy link
Contributor Author

To be clear, I don't think there is anything wrong with setting CAMLLIB and/or OCAMLLIB inside your opam switches with the setenv clause. The real problem is setting them globally as environment variables which will wreck havoc on almost all opam switches. @nojb Please tell me if there is a legitimate edge use case I'm missing.

Really it boils down to two choices:

  1. Fail the installation immediately if either CAMLLIB or OCAMLLIB are in the environment.
  2. Respect the intent of the user who chose to install a new OCaml onto their machine ... they want OCaml to work

I'm strongly leaning towards choice 2 (which means removing both CAMLLIB and OCAMLLIB if the installer sees them in the environment) because the DKML distribution is geared towards ease of use, and it is conventional for installers to remove "previous" installations (which Caml Light is), and I have yet to hear a legit reason why they should be in the environment. Of course I'll back up the environment variables (ex. rename CAMLLIB to CAMLLIB_ORIG).

@nojb
Copy link
Collaborator

nojb commented Nov 11, 2022

@nojb Please tell me if there is a legitimate edge use case I'm missing.

Not that I know of. Your 2. seems reasonable.

@LouisClt
Copy link

I am no expert in CamlLight either, but after a bit of testing, it does not seem CamlLight really needs to have the "CAMLLIB" env variable set to work correctly (at least when I call some basic functions from the standard library).
So removing/renaming this variable seems fine to me (maybe put a warning when you do it...).

@jonahbeckford
Copy link
Contributor Author

jonahbeckford commented Nov 12, 2022

Okay. The fix won't be in the next point release, but it will get in there.

  • Rename CAMLLIB to CAMLLIB_ORIG and OCAMLLIB_ORIG

@jonahbeckford jonahbeckford added this to the v1.0.3 milestone Nov 12, 2022
jonahbeckford added a commit to diskuv/dkml-component-ocamlcompiler that referenced this issue Nov 14, 2022
* diskuv/dkml-installer-ocaml#13
* As part of this log all environment variable changes to the
   audit log, just like is done already in the uninstaller.
@jonahbeckford jonahbeckford modified the milestones: v1.0.3, v1.0.2 Dec 3, 2022
@jonahbeckford
Copy link
Contributor Author

The fix is available in https://github.com/diskuv/dkml-installer-ocaml/releases/tag/v1.1.0_r2

Re-open if this is still an issue.

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

No branches or pull requests

3 participants