Problem Using OPAM to Create a First Switch Installation, Linking Fails

When I try to install a new switch in OPAM, I get an error when compiling on a Raspberry Pi and also on recent Ubuntu (20.10 and 20.04 LTS). I have search for other with same problem, but have not found any solution that works.

anders@anders-pi:~ $ sudo apt install opam 
[sudo] password for user anders:  
Läser paketlistor… Färdig
Bygger beroendeträd       
Läser tillståndsinformation… Färdig
The following additional packages will be installed:
  coinor-cbc darcs ledit libncurses-dev libncurses5-dev mccs ocaml ocaml-base
  ocaml-base-nox ocaml-compiler-libs ocaml-interp ocaml-nox opam-doc
  opam-installer
Suggested packages:
  ncurses-doc ocaml-doc tuareg-mode | ocaml-mode
These NEW packages will be installed:
  coinor-cbc darcs ledit libncurses-dev libncurses5-dev mccs ocaml ocaml-base
  ocaml-base-nox ocaml-compiler-libs ocaml-interp ocaml-nox opam opam-doc
  opam-installer
0 upgraded, 15 new, 0 removed 0 not upgraded.
Behöver hämta 56,6 MB arkiv.
Efter denna åtgärd kommer ytterligare 246 MB utrymme användas på disken.
Do you want to continue? [Y/n] 
Read:1 http://raspbian.playstar.se/raspbian buster/main armhf darcs armhf 2.14.1-3 [4 851 kB]
Read:5 http://raspbian.raspberrypi.org/raspbian buster/main armhf libncurses5-dev armhf 6.1+20181013-2+deb10u2 [948 B]
Läs:2 http://raspbian.playstar.se/raspbian buster/main armhf ocaml-base-nox armhf 4.05.0-11+rpi1 [577 kB]
Läs:3 http://raspbian.playstar.se/raspbian buster/main armhf ledit all 2.04-1 [49,1 kB]
Läs:4 http://raspbian.playstar.se/raspbian buster/main armhf libncurses-dev armhf 6.1+20181013-2+deb10u2 [278 kB]
Läs:6 http://raspbian.playstar.se/raspbian buster/main armhf coinor-cbc armhf 2.9.9+repack1-1 [13,4 kB]
Läs:7 http://raspbian.playstar.se/raspbian buster/main armhf mccs armhf 1:1.1-8 [242 kB]
Läs:8 http://raspbian.playstar.se/raspbian buster/main armhf ocaml-base armhf 4.05.0-11+rpi1 [157 kB]
Läs:9 http://raspbian.playstar.se/raspbian buster/main armhf ocaml-compiler-libs armhf 4.05.0-11+rpi1 [19,2 MB]
Läs:10 http://raspbian.playstar.se/raspbian buster/main armhf ocaml-interp armhf 4.05.0-11+rpi1 [3 582 kB]
Läs:11 http://raspbian.playstar.se/raspbian buster/main armhf ocaml-nox armhf 4.05.0-11+rpi1 [25,1 MB]
Läs:12 http://raspbian.playstar.se/raspbian buster/main armhf ocaml armhf 4.05.0-11+rpi1 [162 kB]
Läs:13 http://raspbian.playstar.se/raspbian buster/main armhf opam-installer armhf 2.0.3-1+deb10u1 [751 kB]
Läs:14 http://raspbian.playstar.se/raspbian buster/main armhf opam-doc all 2.0.3-1+deb10u1 [219 kB]
Läs:15 http://raspbian.playstar.se/raspbian buster/main armhf opam armhf 2.0.3-1+deb10u1 [1 405 kB]
Hämtade 56,6 MB på 9s (6 379 kB/s)                                             
Väljer tidigare ej valt paket darcs.
(Läser databasen ... 367847 filer och kataloger installerade.)
Förbereder att packa upp .../00-darcs_2.14.1-3_armhf.deb ...
Packar upp darcs (2.14.1-3) ...
Väljer tidigare ej valt paket ocaml-base-nox.
Förbereder att packa upp .../01-ocaml-base-nox_4.05.0-11+rpi1_armhf.deb ...
Packar upp ocaml-base-nox (4.05.0-11+rpi1) ...
Väljer tidigare ej valt paket ledit.
Förbereder att packa upp .../02-ledit_2.04-1_all.deb ...
Packar upp ledit (2.04-1) ...
Väljer tidigare ej valt paket libncurses-dev:armhf.
Förbereder att packa upp .../03-libncurses-dev_6.1+20181013-2+deb10u2_armhf.deb ...
Packar upp libncurses-dev:armhf (6.1+20181013-2+deb10u2) ...
Väljer tidigare ej valt paket libncurses5-dev:armhf.
Förbereder att packa upp .../04-libncurses5-dev_6.1+20181013-2+deb10u2_armhf.deb ...
Packar upp libncurses5-dev:armhf (6.1+20181013-2+deb10u2) ...
Väljer tidigare ej valt paket coinor-cbc.
Förbereder att packa upp .../05-coinor-cbc_2.9.9+repack1-1_armhf.deb ...
Packar upp coinor-cbc (2.9.9+repack1-1) ...
Väljer tidigare ej valt paket mccs.
Förbereder att packa upp .../06-mccs_1%3a1.1-8_armhf.deb ...
Packar upp mccs (1:1.1-8) ...
Väljer tidigare ej valt paket ocaml-base.
Förbereder att packa upp .../07-ocaml-base_4.05.0-11+rpi1_armhf.deb ...
Packar upp ocaml-base (4.05.0-11+rpi1) ...
Väljer tidigare ej valt paket ocaml-compiler-libs.
Förbereder att packa upp .../08-ocaml-compiler-libs_4.05.0-11+rpi1_armhf.deb ...
Packar upp ocaml-compiler-libs (4.05.0-11+rpi1) ...
Väljer tidigare ej valt paket ocaml-interp.
Förbereder att packa upp .../09-ocaml-interp_4.05.0-11+rpi1_armhf.deb ...
Packar upp ocaml-interp (4.05.0-11+rpi1) ...
Väljer tidigare ej valt paket ocaml-nox.
Förbereder att packa upp .../10-ocaml-nox_4.05.0-11+rpi1_armhf.deb ...
Packar upp ocaml-nox (4.05.0-11+rpi1) ...
Väljer tidigare ej valt paket ocaml.
Förbereder att packa upp .../11-ocaml_4.05.0-11+rpi1_armhf.deb ...
Packar upp ocaml (4.05.0-11+rpi1) ...
Väljer tidigare ej valt paket opam-installer.
Förbereder att packa upp .../12-opam-installer_2.0.3-1+deb10u1_armhf.deb ...
Packar upp opam-installer (2.0.3-1+deb10u1) ...
Väljer tidigare ej valt paket opam-doc.
Förbereder att packa upp .../13-opam-doc_2.0.3-1+deb10u1_all.deb ...
Packar upp opam-doc (2.0.3-1+deb10u1) ...
Väljer tidigare ej valt paket opam.
Förbereder att packa upp .../14-opam_2.0.3-1+deb10u1_armhf.deb ...
Packar upp opam (2.0.3-1+deb10u1) ...
Ställer in libncurses-dev:armhf (6.1+20181013-2+deb10u2) ...
Ställer in opam-doc (2.0.3-1+deb10u1) ...
Ställer in darcs (2.14.1-3) ...
Ställer in coinor-cbc (2.9.9+repack1-1) ...
Ställer in opam-installer (2.0.3-1+deb10u1) ...
Ställer in libncurses5-dev:armhf (6.1+20181013-2+deb10u2) ...
Ställer in ocaml-base-nox (4.05.0-11+rpi1) ...
Ställer in ledit (2.04-1) ...
update-alternatives: använder /usr/bin/ledit för att tillhandahålla /usr/bin/readline-editor (readline-editor) i autoläge
Ställer in mccs (1:1.1-8) ...
Ställer in ocaml-base (4.05.0-11+rpi1) ...
Ställer in opam (2.0.3-1+deb10u1) ...
Ställer in ocaml-compiler-libs (4.05.0-11+rpi1) ...
Ställer in ocaml-interp (4.05.0-11+rpi1) ...
Ställer in ocaml-nox (4.05.0-11+rpi1) ...
Ställer in ocaml (4.05.0-11+rpi1) ...
Hanterar utlösare för man-db (2.8.5-2) ...
Hanterar utlösare för desktop-file-utils (0.23-4) ...
Hanterar utlösare för mime-support (3.62) ...
Hanterar utlösare för gnome-menus (3.31.4-3) ...
anders@anders-pi:~ $ opam init
[NOTE] Will configure from built-in defaults.
Checking for available remotes: rsync and local, git, mercurial, darcs. Perfect!

<><> Fetching repository information ><><><><><><><><><><><><><><><><><><><><><>
[default] Initialised

<><> Required setup - please read <><><><><><><><><><><><><><><><><><><><><><><>

  In normal operation, opam only alters files within ~/.opam.

  However, to best integrate with your system, some environment variables
  should be set. If you allow it to, this initialisation step will update
  your bash configuration by adding the following line to ~/.profile:

    test -r /home/anders/.opam/opam-init/init.sh && . /home/anders/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true

  Otherwise, every time you want to access your opam installation, you will
  need to run:

    eval $(opam env)

  You can always re-run this setup with 'opam init' later.

Do you want opam to modify ~/.profile? [N/y/f]
(default is 'no', use 'f' to choose a different file) y
A hook can be added to opam's init scripts to ensure that the shell remains in
sync with the opam environment when they are loaded. Set that up? [y/N] y

User configuration:
  Updating ~/.profile.
[NOTE] Make sure that ~/.profile is well sourced in your ~/.bashrc.


<><> Creating initial switch (ocaml-system>=4.02.3) <><><><><><><><><><><><><><>

<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
∗ installed base-bigarray.base
∗ installed base-threads.base
∗ installed base-unix.base
∗ installed ocaml-system.4.05.0
∗ installed ocaml-config.1
∗ installed ocaml.4.05.0
Done.
# Run eval $(opam env) to update the current shell environment
anders@anders-pi:~ $ eval $(opam env)
anders@anders-pi:~ $ opam switch create 4.11.1

<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ocaml-base-compiler.4.11.1] downloaded from cache at https://opam.ocaml.org/cache

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
∗ installed base-bigarray.base
∗ installed base-threads.base
∗ installed base-unix.base
[ERROR] The compilation of ocaml-base-compiler failed at
        "/home/anders/.opam/opam-init/hooks/sandbox.sh build make -j3 world".

#=== ERROR while compiling ocaml-base-compiler.4.11.1 =========================#
# context     2.0.3 | linux/arm32 |  | https://opam.ocaml.org#7fded676
# path        ~/.opam/4.11.1/.opam-switch/build/ocaml-base-compiler.4.11.1
# command     ~/.opam/opam-init/hooks/sandbox.sh build make -j3 world
# exit-code   2
# env-file    ~/.opam/log/ocaml-base-compiler-8595-60459a.env
# output-file ~/.opam/log/ocaml-base-compiler-8595-60459a.out
### output ###
# [...]
# File "_none_", line 1:
# Error: Error while linking ../../stdlib/stdlib.cma(Stdlib):
#        Reference to undefined global `Stack_overflow'
# make[4]: *** [Makefile:233: extract_crc] Fel 2
# make[4]: Lämnar katalogen ”/home/anders/.opam/4.11.1/.opam-switch/build/ocaml-base-compiler.4.11.1/otherlibs/dynlink”
# make[3]: *** [Makefile:35: all] Fel 2
# make[3]: Lämnar katalogen ”/home/anders/.opam/4.11.1/.opam-switch/build/ocaml-base-compiler.4.11.1/otherlibs”
# make[2]: *** [Makefile:903: otherlibraries] Fel 2
# make[2]: Lämnar katalogen ”/home/anders/.opam/4.11.1/.opam-switch/build/ocaml-base-compiler.4.11.1”
# make[1]: *** [Makefile:260: all] Fel 2
# make[1]: Lämnar katalogen ”/home/anders/.opam/4.11.1/.opam-switch/build/ocaml-base-compiler.4.11.1”
# make: *** [Makefile:277: world] Fel 2



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build ocaml-base-compiler 4.11.1
└─ 
┌─ The following changes have been performed (the rest was aborted)
│ ∗ install base-bigarray base
│ ∗ install base-threads  base
│ ∗ install base-unix     base
└─ 

<><> ocaml-base-compiler.4.11.1 troubleshooting <><><><><><><><><><><><><><><><>
=> A failure in the middle of the build may be caused by build parallelism
      (enabled by default).
      Please file a bug report at https://github.com/ocaml/ocaml/issues
# Run eval $(opam env) to update the current shell environment
Switch initialisation failed: clean up? ('n' will leave the switch partially
installed) [Y/n] y
anders@anders-pi:~ $ gcc --version
gcc (Raspbian 8.3.0-6+rpi1) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
anders@anders-pi:~ $ opam --version
2.0.3
anders@anders-pi:~ $ ocaml --version
The OCaml toplevel, version 4.05.0
anders@anders-pi:~ $ opam switch list
#  switch   compiler             description
→  default  ocaml-system.4.05.0  default
anders@anders-pi:~ $ uname -a
Linux anders-pi 5.10.11-v7l+ #1399 SMP Thu Jan 28 12:09:48 GMT 2021 armv7l GNU/Linux
anders@anders-pi:~ $ 

So, what am I doing wrong?

Ok, this is what I do when I compile from the git source.

bda -I middle_end/flambda/base_types -I asmcomp -I asmcomp/debug -I driver -I toplevel  -c driver/maindriver.ml -I driver
./boot/ocamlrun ./ocamlopt -g -nostdlib -I stdlib -I otherlibs/dynlink -a -ccopt "-Wl,-E" -o compilerlibs/ocamlbytecomp.cmxa bytecomp/instruct.cmx bytecomp/bytegen.cmx bytecomp/printinstr.cmx bytecomp/emitcode.cmx bytecomp/bytelink.cmx bytecomp/bytelibrarian.cmx bytecomp/bytepackager.cmx driver/errors.cmx driver/compile.cmx driver/maindriver.cmx
./boot/ocamlrun ./ocamlopt -g -nostdlib -I stdlib -I otherlibs/dynlink -strict-sequence -principal -absname -w +a-4-9-40-41-42-44-45-48-66 -warn-error +a -bin-annot -safe-string -strict-formats -I utils -I parsing -I typing -I bytecomp -I file_formats -I lambda -I middle_end -I middle_end/closure -I middle_end/flambda -I middle_end/flambda/base_types -I asmcomp -I asmcomp/debug -I driver -I toplevel  -c driver/main.ml -I driver
./boot/ocamlrun ./ocamlopt -g -nostdlib -I stdlib -I otherlibs/dynlink  -o ocamlc.opt compilerlibs/ocamlcommon.cmxa compilerlibs/ocamlbytecomp.cmxa driver/main.cmx -cclib "-lm -ldl  -lpthread"
/usr/bin/ld: stdlib/stdlib.a(stdlib.o): in function `.L620':
/home/anders/Src/GitHub/ocaml/stdlib/stdlib.ml:571: undefined reference to `caml_exn_Stack_overflow'
/usr/bin/ld: stdlib/libasmrun.a(fail_nat.n.o): in function `caml_raise_constant':
/home/anders/Src/GitHub/ocaml/runtime/fail_nat.c:88: undefined reference to `caml_exn_Stack_overflow'
collect2: error: ld returned 1 exit status
File "caml_startup", line 1:
Error: Error during linking (exit code 1)
make[2]: *** [Makefile:664: ocamlc.opt] Fel 2
make[2]: Lämnar katalogen ”/home/anders/Src/GitHub/ocaml”
make[1]: *** [Makefile:218: opt.opt] Fel 2
make[1]: Lämnar katalogen ”/home/anders/Src/GitHub/ocaml”
make: *** [Makefile:277: world.opt] Fel 2
anders@anders-pi:~/Src/GitHub/ocaml $ 

Are there something obvious, or should I file a bug report?

@jaxon you say new switch – in the sense of ‘additional’ or ‘first’?

I bootstrap following this procedure: https://mro.name/a8t3ekc – do you want to give that a try?

You will need OCaml on Raspberry Pi - Danny Willems - Blog

I think it would be better to submit a bug report.

As in I do all the stuff from a clean install in the listing. That is, as first.

Yes, installing opam will also install a default switch, based on repository ocaml which are really old.

So I do try to install a newer Ocaml, like 4.12 or 4.11, not 4.03 och 4.08.

So I have tried on RaspberryOS-2021-01-11, Ubuntu-20.10 and Debian 10.8.0. All clean installations in a virtual machine (VirtualBox). So I don’t belive there are special problems in RaspberryOS.

I have a go with your suggestions.

I looked through the links you gave me, and nothing special there. Plain ordinary installation like https://www.ocaml.org/ with install opam and then go from there. I have tried with precompile opam and from the distributions. Same kind of result, failed linking.

I have now tried on a freash Fedora-Workstation-33 with upgraded packages.

This works, until I try to create a switch.

sudo dnf install opam
opam init
opam switch create 4.12.0
....
/usr/bin/ld: stdlib/libasmrun.a(amd64.o): in function 'caml_stack_overflow':
(.text.caml.caml_stack_owerflow+0x6): undefined reference to 'caml_exn_Stack_overflow'
/usr/bin/ld: stdlib/libasmrun.a(fail_nat.n.o): in function 'caml_raise_constant':

and the build fails.

Presumably the last one was not on a rpi (it mentions amd64) ?

Could you maybe post opam config report and env (trim out anything private) ? If it fails consistently for you maybe there’s something in the way you setup your environment (in the past things like having . in your PATH could create problems, but I don’t recognize that here).

I am trying on x86 hardware in VirtualBox. So yes, the RaspberryOS is running in VirtualBox. Same result on ARM hardware though.

There are no personal setup, I using a new installation in VirtualBox, only installing emacs, git, and build-essential, which basically installs gcc and make so you can compile in Debian based distributions.

Basically install a new VirtualMachine with RaspberryOS-2021-01-11 in a VirtualMachine (or on real hardware)

sudo apt install emacs git build-essential opam
opam init
opam switch create 4.11.2

And then it fails in linking with "Reference to undefined global ‘Stack_overflow’ in stdlib.cma

Here are the information you asked for (I wrote it by hand, as I have not logged in from the VirtualMachine).

$ opam config report
# opam config report
# opam-version      2.0.3
# self-upgrade      no
# system            arch=x86_64 os=linux os-distrinbution=debian os-version=10
# sovler            mccs
# install-criteria  -removed,-count[version-lag:,true],changed,-count[version-lag:,false],-new
# upgrade-critera   -removed,-count[version-lag:false],-new
# jobs              1
# resporitories     1 (http) (default repo at 5557fa05)
# pinned            0
# current-switch    default
$ env
SHELL=/bin/bash
CAML_LD_LIBRARY_PATH=/home/pi/.opam/default/lib/studlibs:Updated by package ocaml
OCAML_TOPLEVEL_PATH=/home/pi/.opam/default/lib/toplevel
COLORTERM=truecolor
...
LANGUAGE=sv_SE.UTF-8
XDG_CONFIG_HOME=/home/pi/.config
DESKTOP_SESSION=LXDE-pi
...
LOGNAME=pi
QT_QPA_PLATFORMTHEME=qt5ct
XGD_SESSION_TYPE=x11
MANPATH=/home/pi/.opam/default/man
...
HOME=/home/pi
LANG=sv_SE.UTF-8
...
USER=pi
DISPLAY=:0.0
SHLVL=1
...
PATH=/home/pi/.opam/default/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
...
$ opam list
# Packages matching: installed
# Name        # Installed # Synopsis
base-bigarray base
base-threads  base
base-unix     base
ocaml         4.05.0      The OCaml compile (virtual package)
ocaml-config  1           OCaml Switch Configuration
ocaml-system  4.05.0      The OCaml compiler (system version, from outside o
$

Can’t see any strange here. Path is set up for the default switch, as I think it should.

Isn’t it the case that there’s a mismatch between the architecture and the one ocaml guesses ? What happens if you from the OCaml distribution you:

./configure
grep ARCH Makefile.config

Also that’s slightly weird.

Dont’t think so. Why would the error be on the other dirstributions? And RaspberryOS is just Debian 10, with some adjustments.
I also get errors when trying on Debina 10, Ubunt 20.04 and RaspberryOS (on x86). Even on a Fedora virtual machine I get these errors.
I have only been able to get it to work on Apple OSX. Yes, I have done this about a year ago. But I need this for the course I am giving in Ocaml.

I have now created a new VirtualMachine in VirtualBox for RaspberryOS (creating a new machine from installation ISO image with 2G RAM and 16 G disk).

sudo apt install git build-essential opam
opam init
eval $(opam env)
opam switch create 4.11.2

Hm, got this error when compiling now.

# signals_nat.c:55:14: note: in definition of macro 'Is_in_code_area'
# [...]
#               ^~
# signal_nat.c:226:26: note: in expansion of macro 'CONTEXT_PC'
#       && Is_inn_code_area(CONTEXT_PC)
#                           ^~~~~~~~~~

The CAML_LD_LIBRARY_PATH? Yes, it looks strange, when you mention it.

Found this bug report on it. If I understand it, it should be there when on uses system installed ocaml as the ‘default’ switch?
Anyways, it is set by opam env.

I run a bit out of ideas, but you mentioned above you also get the errors when you try to compile ocaml by hand. So it’s likely better to focus making that succeed first than via the opam indirection.

I didn’t know raspbian was renamed raspberry pi os and that they distribute i386 images nowadays but it’s likely an ocaml configuration problem.

As a starting point I still think you should have a closer look at the results of ocaml’s ./configure to see if there’s not anything suspicious.

Thanks for the help.

I pretty much get the same errors on Debian and Ubuntu, so it would be nice to know if I am the only one, or there are something that need to be sent a bug report.

I will give it a go compiling source from Ocaml too.

I used to bootstrap on raspi hardware like this: Bootstrap Raspi4 + 🐫 OCaml | MRo Blog

I don’t remember the details, but opam via package manager obviously didn’t work out.

1 Like

So I tried this on a x86_64 machine with macos 11.2.3 with virtualbox 6.1.18 and the raspberry pi desktop image “compatible for mac” found here.

Note that this is an i386 image so you need to create a 32-bit Linux virtual machine.

That is your above arch=x86_64 is weird, when I opam config report here I get x86_32.

I suspect this is your problem since here the following instructions:

 sudo apt install git build-essential opam
 opam init
 eval $(opam env)
 opam switch create 4.11.2

worked flawlessly. HTH.

1 Like

Thanks, I will check that, but from top of my head, I tested something like that.

I looks like @dbuenzli was abel to run from RasbianOS, so I will try that on my RPi.

Thanks for the help, it was great! I really appreciate it.

Also running the same hardware and software for my virtual machine as you do. I will try with a i386 virtual machine. I will report back.

I missed that the ISO is only 32 bit. But x86_64 hardware should be able to run i386 without problem, at least that has worked before. It is the OS that should set to only 32 bit API and libraries.
So ‘opam’ should not report the OS to be AMD64, only the hardware. So opam et al should build 32 bit binaries (x86).
That might be an actual bug.

(The virtual machine doesn’t care about if your host is a Mac or not, so it should work equally good, with both types of ISO images. It is still preferable to run the virtual machine as x86_64, even with an 32 bit OS, as that will run IO more efficient as a virtual machine. But great that you found this)

The problem are still there for Debian, Ubuntu and Fedora. They are delivering only 64 bit (AMD64) OS, no 32 bit for x86.

I also had problems with running RPi 4B,m which is a ARM64, and not a 32 CPU. But there RaspberryOS is a 32-bit OS with only 32 bit binaries (there are a 64-bit on the way).

I don’t know the full details, there’s a lot of what is defining what I have no idea about in virtualization.

But what I can tell you for sure is that in this 32-bit Linux VM:

> uname -m
i686
> uname -p
unknown
> uname -i
unknown

And looking at the examples here it seems that indeed -m is the only reliable thing. It seems that both opam and ocaml (which nowadays piggy-backs on autoconf) use that but it seems hardly to be a bug.

Give the full context (virtualization if it is, hardware arch, vm arch and uname -m). If there were problems using opam on debian, ubuntu or fedora I think we would already know about :–)

I think I tested that at some point without problem.

In any case the value of uname -m in all these cases should help figure things out.

Have worked trying to find a solution to my problems creating any switch. By a pure chance, it might have found the problem:

Looks like this will NOT work. When all compiling are done and linking start, it will fail.

 opam create switch 4.12.0

but this will work, when environment LANG set to C, that is, no localization…

LANG=C opam create switch 4.12.0

So it looks like LANG set to something else then C will not work. I have to test this, but if anyone want to try, I have LANG set to Swedish, as it should on a Swedish machine.

$ echo $LANG
sv_SE.UTF-8

If I find that it doesn’t work with a locale set to something else then C (or English) then I will file a bug. But at least now opam work as it should.

1 Like

If the problem only appears with the swedish locale, this is probably another instance of the glibc’s swedish locale bug:25036 – Update collation order for Swedish that excluded w from the a-z range.

2 Likes