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

Win32: -install-lib-dir <stdlib>/ocamlbuild is no longer correct in OPAM "system" compiler environment. #332

Closed
gildor478 opened this issue Oct 24, 2020 · 0 comments
Labels

Comments

@gildor478
Copy link
Member

This bug has been migrated from artifact #1538 on forge.ocamlcore.org. It was assigned to user102. It was closed on 2016-08-22 23:08:01.

user273 posted on 2016-04-12 04:10:43:

I see the following in many setup.ml files created by oasis:

     if (os_type ()) = "Win32" then
      [
        "-classic-display";
        "-no-log";
        "-no-links";
        "-install-lib-dir";
        (Filename.concat (standard_library ()) "ocamlbuild")
      ]

This assumes ocamlbuild library directory is under ocamlc -where/ocamlbuild, but it is no longer correct when "system" compiler + OPAM is used: for example, ocamlc -where is /usr/local/lib/ocaml while ocamlbuild library directory is $HOME/.opam//lib/ocamlbuild

The current workaround is to install ocamlbuild not by OPAM.

user102 replied on 2016-04-12 05:43:54:

I am a bit surprise by the description.

On Win32, I would expect 'ocamlc -where' to be something like "C:\ocaml\lib" at least.

I didn't know that OPAM works easily on Win32.

Given the number of possible combinations to install OCaml on Windows can you give me a more precise description of the setup where it fails.

Do you have a better idea to detect location of the ocamlbuild directory ?

user146 replied on 2016-04-12 21:35:55:

Would $(ocamlbuild -where) do the job? On bundled-with-OCaml versions, it coincides with $(ocamlc -where)/ocamlbuild, and on the new versions it should point to the right place (it is currently overriden by $OCAMLLIB, which is possibly the wrong thing to do, but we can fix that).

user102 replied on 2016-04-12 22:28:07:

Will do. Thx.

user273 replied on 2016-04-13 02:14:33:

There are several ppl using Cygwin OPAM to install packages for MinGW OCaml. It requires minor fixes to opam but works fine for many packages.

The code fails in "system" OCaml compiler set + OPAM installed ocamlbuild. ocamlbuild tries to find ocamlbuild.cmo in ocamlc -where/ocamlbuild and fails.

I agree with Gabriel, but $(ocamlbuiild -where) is the default of ocamlbuild, therefore probably we do not need it. Why do we need this option originally?

user102 replied on 2016-04-13 08:48:42:

The option dated back 2009 and this was a requirement to run OCamlbuild on Windows at this time:

https://github.com/ocaml/oasis/blob/7b48238d98bfb3985bc060
2adfca8d6cf75eccf9/src/base/buildSys.ml#L674

This thing is probably not required anymore.

If I can build on Windows without the options and with OCaml 3.12.1, I suppose we can remove it.

Right now, I'll need to be able to automate testing on Windows (finishing the AppVeyor setup), before considering changing the options.

https://ci.appveyor.com/project/gildor478/oasis

user102 replied on 2016-06-24 08:35:47:

See also #1546:
https://forge.ocamlcore.org/tracker/index.php?func=detail&aid=1546&group_id=54&atid=291

user102 replied on 2016-08-12 13:15:19:

I am about to start working on it.

I will just remove the "-install-lib-dir" and enforce to use OCaml version >= X and/or ocamlbuild >= Y.

Jun/Gabriel any idea about the values of X and Y ?

I would also like to test all this. Do any of you have a valid AppVeyor setup or can walk me through how to setup OPAM + system ?

thx

user146 replied on 2016-08-12 14:12:23:

It is hard to tell as I'm not sure what the error was on Windows. (I don't have a Windows testing environment either right now, and it's a pain for ocamlbuild development as well.)

The error there was might have been fixed in the commit

ocaml/ocamlbuild@79cf402
in march 2009, that I think might be the one referenced in the 3.11.1 release notes:

Objective Caml 3.11.1 (12 Jun 2009):

  • ocamlbuild: incorrectly using the compile-time value of $OCAMLLIB

This would suggest that (OCaml version >= 3.11.1) should be enough. But I would recommend testing it on a Windows machine first, because it's mostly speculation on my part.

user102 replied on 2016-08-13 23:40:09:

71af9d6

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

No branches or pull requests

1 participant