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

GCC and GLIBC supported minimums for Dune on Linux #10423

Open
jonahbeckford opened this issue Apr 15, 2024 · 2 comments
Open

GCC and GLIBC supported minimums for Dune on Linux #10423

jonahbeckford opened this issue Apr 15, 2024 · 2 comments

Comments

@jonahbeckford
Copy link
Collaborator

Expected Behavior

TLDR: My expectation is that Dune works on the same platforms that OCaml works on.

In my case the offending GCC is:

  • gcc 4.8.5-44.el7

Yes, that is a GCC from RHEL/CentOS 7 but that doesn't change the fact that OCaml builds perfectly fine on it while the conventional OCaml build tool (Dune) does not.

I'd like to know what the expectations are for Dune. While I could "fix" the issue below by upstreaming a patch to the vendored spawn library, doing so completely misses the point that it will be a tremendous waste of time for me to use Dune as a foundation to build OCaml software if someone (ex. Dune or the spawn owner Jane Street) arbitrarily decides in the future that they won't support what OCaml supports. I don't think anyone should be in that position. It would be better for me to know now so I have time to course correct.

Ideally, I'm expecting to see one of the following:

  1. A statement "Whatever OCaml LTS (or 5?) builds on Dune should be able to build on", or
  2. A specific GCC + GLIBC minimum version, or
  3. Some handcrafted list of Linux supported distributions; everything else is maybe

If "1" or "2", I'd be happy to submit an upstream patch. If "3" I can start planning to rely less on Dune. Thx.

Actual Behavior

#=== ERROR while compiling dune.3.15.0 ========================================#
# context     2.2.0~alpha0~20221228 | linux/x86_64 |  | git+https://github.com/ocaml/opam-repository.git
# path        /work/.ci/o/2.1.1/.opam-switch/build/dune.3.15.0
# command     /work/.ci/o/2.1.1/bin/ocaml boot/bootstrap.ml -j 1
# exit-code   2
# env-file    /work/.ci/o/log/dune-11998-d28a2a.env
# output-file /work/.ci/o/log/dune-11998-d28a2a.out
### output ###
# ocamlc -output-complete-exe -w -24 -g -o .duneboot.exe -I boot unix.cma boot/libs.ml boot/duneboot.ml
# ./.duneboot.exe -j 1
# cd _boot && /work/.ci/o/2.1.1/bin/ocamlopt.opt -c -g -I +threads spawn_stubs.c
# vendor/spawn/src/spawn_stubs.c: In function 'init_spawn_info':
# vendor/spawn/src/spawn_stubs.c:526:5: error: 'for' loop initial declarations are only allowed in C99 mode
# vendor/spawn/src/spawn_stubs.c:526:5: note: use option -std=c99 or -std=gnu99 to compile your code

Specifications

  • Version of dune (output of dune --version): 3.15.0
  • Version of ocaml (output of ocamlc --version): 4.14.2
  • Operating system (distribution and version): manylinux 2014 x86
@emillon
Copy link
Collaborator

emillon commented Apr 16, 2024

I agree with you that an official policy for this is important to have, and we're working on that at the moment. I think that the answer is going to be a variant of 1.
We don't test a ton of distributions in dune's CI, so I was curious why we didn't catch this at release time, since opam-repo-ci has a much wider test matrix.
The reason is that oracle linux 7 (which I assume has the same compiler) has been removed as a test platform since it is difficult to install dev packages there, apparently (?): ocurrent/opam-repo-ci#237
This is the kind of thing that a proper policy should prevent in the future.

@emillon
Copy link
Collaborator

emillon commented Apr 17, 2024

(and I realize that this is not the crux of the issue, but this particular gcc fix is going to be fixed in 3.16.0 and 3.15.1, the latter this week or next one)

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