Can't build on Fedora 35 due to glibc bug
danvonk opened this issue · 4 comments
Hi all,
I'm encountering this ocaml bug ocaml/ocaml#10250 , which occurs on Fedora 35. From the issue report, I think it has been solved in the latest commit on the ocaml repo but I'm not sure how to carry it over to revery using esy.
- Operating System: Fedora 35
- Revery Version: master
- OCaml version: 4.12
- Native, Bytecode, or JS build: Native
- Steps to reproduce:
- Use Fedora 35 or Ubuntu 21.10 or any other distro with glibc 2.34.
- Clone master and run esy install && esy build
-
Actual Result: Revery does not build
-
Expected Result: Revery does build
-
Additional Information:
./boot/ocamlrun expunge ocaml.tmp ocaml camlinternalFormatBasics stdlib stdlib__pervasives stdlib__seq stdlib__option stdlib__result stdlib__bool stdlib__char stdlib__uchar stdlib__sys stdlib__list stdlib__bytes stdlib__string stdlib__unit stdlib__marshal stdlib__obj stdlib__array stdlib__float stdlib__int stdlib__int32 stdlib__int64 stdlib__nativeint stdlib__lexing stdlib__parsing stdlib__set stdlib__map stdlib__stack stdlib__queue camlinternalLazy stdlib__lazy stdlib__stream stdlib__buffer camlinternalFormat stdlib__printf stdlib__arg stdlib__printexc stdlib__fun stdlib__gc stdlib__digest stdlib__random stdlib__hashtbl stdlib__weak stdlib__format stdlib__scanf stdlib__callback camlinternalOO stdlib__oo camlinternalMod stdlib__genlex stdlib__ephemeron stdlib__filename stdlib__complex stdlib__arrayLabels stdlib__listLabels stdlib__bytesLabels stdlib__stringLabels stdlib__moreLabels stdlib__stdLabels stdlib__spacetime stdlib__bigarray outcometree topdirs toploop
rm ocaml.tmp
make[2]: Leaving directory '/home/dan/.esy/3/b/ocaml-4.11.1000-fdc2a8f9'
make opt-core
make[2]: Entering directory '/home/dan/.esy/3/b/ocaml-4.11.1000-fdc2a8f9'
make -C runtime allopt
make[3]: Entering directory '/home/dan/.esy/3/b/ocaml-4.11.1000-fdc2a8f9/runtime'
gcc -c -O2 -fno-strict-aliasing -fwrapv -Wall -Wdeclaration-after-statement -fno-common -fexcess-precision=standard -fno-tree-vrp -ffunction-sections -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE -DNATIVE_CODE -DTARGET_amd64 -DMODEL_default -DSYS_linux -o startup_aux_n.o startup_aux.c
gcc -c -O2 -fno-strict-aliasing -fwrapv -Wall -Wdeclaration-after-statement -fno-common -fexcess-precision=standard -fno-tree-vrp -ffunction-sections -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE -DNATIVE_CODE -DTARGET_amd64 -DMODEL_default -DSYS_linux -o startup_nat_n.o startup_nat.c
gcc -c -O2 -fno-strict-aliasing -fwrapv -Wall -Wdeclaration-after-statement -fno-common -fexcess-precision=standard -fno-tree-vrp -ffunction-sections -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE -DNATIVE_CODE -DTARGET_amd64 -DMODEL_default -DSYS_linux -o main_n.o main.c
gcc -c -O2 -fno-strict-aliasing -fwrapv -Wall -Wdeclaration-after-statement -fno-common -fexcess-precision=standard -fno-tree-vrp -ffunction-sections -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE -DNATIVE_CODE -DTARGET_amd64 -DMODEL_default -DSYS_linux -o fail_nat_n.o fail_nat.c
gcc -c -O2 -fno-strict-aliasing -fwrapv -Wall -Wdeclaration-after-statement -fno-common -fexcess-precision=standard -fno-tree-vrp -ffunction-sections -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE -DNATIVE_CODE -DTARGET_amd64 -DMODEL_default -DSYS_linux -o roots_nat_n.o roots_nat.c
gcc -c -O2 -fno-strict-aliasing -fwrapv -Wall -Wdeclaration-after-statement -fno-common -fexcess-precision=standard -fno-tree-vrp -ffunction-sections -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE -DNATIVE_CODE -DTARGET_amd64 -DMODEL_default -DSYS_linux -o signals_n.o signals.c
gcc -c -O2 -fno-strict-aliasing -fwrapv -Wall -Wdeclaration-after-statement -fno-common -fexcess-precision=standard -fno-tree-vrp -ffunction-sections -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE -DNATIVE_CODE -DTARGET_amd64 -DMODEL_default -DSYS_linux -o signals_nat_n.o signals_nat.c
gcc -c -O2 -fno-strict-aliasing -fwrapv -Wall -Wdeclaration-after-statement -fno-common -fexcess-precision=standard -fno-tree-vrp -ffunction-sections -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE -DNATIVE_CODE -DTARGET_amd64 -DMODEL_default -DSYS_linux -o misc_n.o misc.c
signals_nat.c:198:13: error: variably modified 'sig_alt_stack' at file scope
198 | static char sig_alt_stack[SIGSTKSZ];
| ^~~~~~~~~~~~~
make[3]: *** [Makefile:343: signals_nat_n.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory '/home/dan/.esy/3/b/ocaml-4.11.1000-fdc2a8f9/runtime'
make[2]: *** [Makefile:777: makeruntimeopt] Error 2
make[2]: Leaving directory '/home/dan/.esy/3/b/ocaml-4.11.1000-fdc2a8f9'
make[1]: *** [Makefile:223: opt.opt] Error 2
make[1]: Leaving directory '/home/dan/.esy/3/b/ocaml-4.11.1000-fdc2a8f9'
make: *** [Makefile:283: world.opt] Error 2
error: command failed: './esy-build' (exited with 2)
esy-build-package: exiting with errors above...
building ocaml@4.11.1000
esy: exiting due to errors above
You need a ocaml packaged for esy. To do so you can check last commit of https://github.com/esy-ocaml/ocaml/commits/4.13.1+esy. Once you have a branch with upstream commit/esy patch commit. You can use resolutions to consume this special OCaml.
Usually it mean clone upstream branch
add remote to esy fork
cherry-pick some commit of esy-fork
(you can use local resolutions here or)
add your remote
push
(now you can use remote resolutions)
If you need assistance I might be able to give you a hand.
Thanks for the tips. I've forked esy-ocaml and added it as a resolution. However, I still need to apply the glibc patch (which is https://github.com/dra27/opam-repository/tree/glibc-2.34-4.10%2B ), though not sure how to do that
git remote add upstream https://github.com/ocaml/ocaml
git fetch upstream
git cherry-pick 632563b19ca72ec0ae10c7ed767a025c342d3155
git push(The sha is commit of original PR)
Thanks for the help. Got it working.