Well we can’t get access to that haskell code right? So from my point of view I figured next step is to test anyway we can out here without being blocked.
Normal x86/arm64 linux containers run just fine inside of docker for mac’s linux vm. I’m pretty sure that rosetta still kicks in at the machine level to dynamically translate any native instructions that the VM layer might try to pass through.
I do believe you’re correct that Haskell has great cross compilation support and / or ability to build for arm.
That said though I have to emphasize that normal linux containers run just fine on osx so there is no reason we can’t make it work.
It would be great if I could somehow trap the instruction that causes an issue or inspect a core dump file perhaps?
As for the rest of your message I really don’t know what to tell you at this point. If you have an arm64 Linux machine available, perhaps you can create your own Docker image? The Dockerfile is here, though of course that one won’t help you directly, so let me connect the dots a little bit. You can easily take a look at the https://get.daml.com script by just curl’ing it, and you’ll see it ultimately “just” downloads the tarball and runs the installer.
Of course, if you use one of our published tarballs you’ll get the same Docker image we build and thus the same issue. So, instead, what you’d want to do at this point is build your own tarball, on an arm64 Linux machine, hoping that our build supports it (we’re not trying to prevent it but I’ve never tried so I can’t promise anything).
To build the tarball, you have to:
Clone the daml repo
Make sure you have direnv and nix installed
Run `bazel build //release:sdk-release-tarball-ce.tar.gz"
Wait. A long time, probably, since no binaries for arm64 Linux will be in the cache. I’d say budget about 3 hours for this to run through, though we never run without a cache so that’s just a guess. (Also this may not run all the tests so may be faster, if you’re lucky.)
Once that finishes successfully, you should have the tarball (among many other things) under bazel-bin/release/sdk-release-tarball.tar.gz. You can then use that in your Dockerfile: COPY the tarball, extract it, and run the install.sh script within.
Right, we tried exactly that earlier in the thread and it didn’t work out as expected. I agree though that it would be nice to have an ARM native build.
However I don’t think that has to be a hard requirement. We all use containers built for amd64 on m1/m2 macbooks it works. So I think we could also just try to debug why it segfaults.
With the latest version of Docker Desktop, it’s now possible to run x86_64/amd64 emulation with Rosetta on an Apple M1 chip which solves this issue when running daml commands in Docker on arm64 chipsets. Having tested this already, I can confirm that daml commands successfully execute using this emulation on an Apple M1 chip.
To enable the Rosetta emulation, follow the simple steps here. As per the instructions, run your image with the flag --platform linux/amd64 and the daml commands will execute successfully.
I tested it and it works. You need to enable Apple Virtualization in General Settings and then Rosetta under Beta settings. This is on M1 with MacOS 13.2.1 and 4.16.2. I assume you also need Rosetta installed at the MacOS level as well as it is not installed by default.