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

Error while installing switch 4.07.0: "The compilation of ocaml-base-compiler.4.07.0 failed at 'make -j1 world'." #25933

Open
Arsun12 opened this issue May 25, 2024 · 1 comment

Comments

@Arsun12
Copy link

Arsun12 commented May 25, 2024

After installing opam via both pacman and through the curl command (NOTE: They were not both installed at the same time, I made sure to remove one before installing another), running opam init on both of them and updating the shell environment, when I run opam switch create 4.07.0 the process fails when compiling ocaml-base-compiler 4.07.0 , giving me the following output:

[ERROR] The compilation of ocaml-base-compiler.4.07.0 failed at "make -j1 world".

#=== ERROR while compiling ocaml-base-compiler.4.07.0 =========================#
# context     2.1.5 | linux/x86_64 |  | https://opam.ocaml.org#6ed19e32
# path        ~/.opam/4.07.0/.opam-switch/build/ocaml-base-compiler.4.07.0
# command     ~/.opam/opam-init/hooks/sandbox.sh build make -j1 world
# exit-code   2
# env-file    ~/.opam/log/ocaml-base-compiler-20872-850fd1.env
# output-file ~/.opam/log/ocaml-base-compiler-20872-850fd1.out
### output ###
# [...]
# /usr/bin/ld: main.o: in function `create_file_names':
# main.c:(.text+0x54d): warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp'
# make[1]: Leaving directory '/home/Max/.opam/4.07.0/.opam-switch/build/ocaml-base-compiler.4.07.0/yacc'
# cp yacc/ocamlyacc boot/ocamlyacc
# make -C stdlib  \
#   COMPILER="../boot/ocamlc -use-prims ../byterun/primitives" all
# make[1]: Entering directory '/home/Max/.opam/4.07.0/.opam-switch/build/ocaml-base-compiler.4.07.0/stdlib'
# ../boot/ocamlrun ../boot/ocamlc -use-prims ../byterun/primitives -strict-sequence -absname -w +a-4-9-41-42-44-45-48 -g -warn-error A -bin-annot -nostdlib -safe-string -strict-formats  -nopervasives -c camlinternalFormatBasics.mli
# Fatal error: exception Invalid_argument("Sys.getcwd not implemented")
# make[1]: *** [Makefile:237: camlinternalFormatBasics.cmi] Error 2
# make[1]: Leaving directory '/home/Max/.opam/4.07.0/.opam-switch/build/ocaml-base-compiler.4.07.0/stdlib'
# make: *** [Makefile:393: coldstart] Error 2

I have also tried running it with the -jobs=1 flag, but to no avail. Running it under root also doesn't help.
A Google search of the fatal error yields barely any results.
For debugging's sake, I also ran the same command with verbose logs

My laptop setup FWIW is as follows:

OS: Arch Linux x86_64 
Host: Inspiron 5521 A05 
Kernel: 6.9.1-arch1-2 
Uptime: 2 hours, 1 min 
Packages: 1393 (pacman), 22 (flatpak) 
Shell: bash 5.2.26 
Resolution: 1366x768 
DE: Plasma 6.0.4 
WM: KWin 
Theme: [Plasma], Breeze-Dark [GTK2], Breeze [GTK3] 
Icons: [Plasma], breeze-dark [GTK2/3] 
Terminal: konsole 
CPU: Intel i5-3337U (4) @ 2.700GHz 
GPU: Intel 3rd Gen Core processor Graphics Controller 
Memory: 3441MiB / 7812MiB
@Arsun12 Arsun12 closed this as not planned Won't fix, can't repro, duplicate, stale May 25, 2024
@Arsun12 Arsun12 reopened this May 25, 2024
@mseri
Copy link
Member

mseri commented May 26, 2024

I remember a similar issue in the past, I think the issue was a missing -Wno-implicit-function-declaration in the CC invocation. Unfortunately, if that is the issue I cannot provide a solution, does it work if you try to use 4.08.1? Do you really need 4.07?

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