-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
v1.1.0-rc1 alr toolchain issues #792
Comments
Thanks for the detailed report, Marcel. Although I see your point, @Fabien-Chouteau , I'm inclined to disabling the autorun of the assistant, and point to it in the error message when Independently of that, being able to use The undetected |
I don't know, the assistant is great for beginner and will save a lot of troubles. |
Do you have the same problem with GNAT Community 2021? Do you know how to build gcc in a compatible way? |
I faced the same problem for our tests, but I knew how to bypass it using |
Will the assistant take a good default toolchain when in non-interactive mode? |
The default option ATM is the newest native compiler from the index. |
So everything should be fine in non-interactive mode. |
I think so. If you run |
Yes.
Not readily, but I'm looking into it. Rich Felker (musl author) has a project for building musl-targeting cross-compilers: https://github.com/richfelker/musl-cross-make I've also realized that providing a single static x86_64 toolchain for Linux is not enough. Even if the compiler itself can run on musl (because it is static) the compiled programs will still target |
The following Dockerfile shows how to build a static GCC 9.4.01 targeting x86_64-linux-musl. I've been able to build XmlAda, GPRBuild, GNATColl, Alire and my own projects with this toolchain. I've also taken a cursory look at GNAT-FSF-builds but I can't figure out how it ticks. If you want to build this image and test it yourselves: To install other packages inside the container you use To extract the toolchain from a running container into your host get its name with The patching is admittedly a bit clunky, I'll try to get it merged into musl-cross-make.
|
So we need a special build of GCC for musl/Alpine. This can probably be done in GNAT-FSF-builds but I don't have time for this right now. Also we would first need Alpine distrib support in Alire first. |
I decided to spin up an alpine VM to mess around with this today. I successfully pulled in the current version of gnat via
localhost:~/hello_1.0.2_5715870b$ /home/aj/.cache/alire/toolchains/gprbuild_22.0.1_24dfc1b5/bin/gprbuild --version
-ash: /home/aj/.cache/alire/toolchains/gprbuild_22.0.1_24dfc1b5/bin/gprbuild: not found
localhost:~/hello_1.0.2_5715870b$ file /usr/local/bin/gprbuild
/usr/local/bin/gprbuild: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-x86_64.so.1, with debug_info, not stripped
localhost:~/hello_1.0.2_5715870b$ file /home/aj/.cache/alire/toolchains/gprbuild_22.0.1_24dfc1b5/bin/gprbuild
/home/aj/.cache/alire/toolchains/gprbuild_22.0.1_24dfc1b5/bin/gprbuild: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, with debug_info, not stripped I know right now we have While most distros use glibc, it looks like quite a few are using musl now.
An alternative is to add something like [origin."case(os)".linux."case(libc_variant)".glibc."case(host-arch)".x86-64]
url = "https://github.com/alire-project/GNAT-FSF-builds/releases/download/gprbuild-22.0.0-1/gprbuild-x86_64-linux-22.0.0-1.tar.gz"
hashes = ["sha256:24dfc1b54655edd4f85589e7e7dbd0bee24d087f25d5b0f13d3224fe7acf85b8"]
[origin."case(os)".linux."case(libc_variant)".musl."case(host-arch)".x86-64]
url = "https://github.com/alire-project/GNAT-FSF-builds/releases/download/gprbuild-22.0.0-1/gprbuild-x86_64-linux-alpine-22.0.0-1.tar.gz"
hashes = ["sha256:hashgoeshere"]
# Would this help for backwards-compatibility? We default to glibc.
[origin."case(os)".linux."case(host-arch)".x86-64]
url = "https://github.com/alire-project/GNAT-FSF-builds/releases/download/gprbuild-22.0.0-1/gprbuild-x86_64-linux-22.0.0-1.tar.gz"
hashes = ["sha256:24dfc1b54655edd4f85589e7e7dbd0bee24d087f25d5b0f13d3224fe7acf85b8"] What do you think? As a bonus, a |
The main issue here is fixed. For the |
Summary (by @mosteo):
alr toolchain --disable-assistant
) (Implementalr toolchain --disable-assistant
#803)alr toolchain --select <release>
) (Non-interactive toolchain selection withalr toolchain --select <release>
#804)gprbuild
missing externalOriginal post follows.
unrelated commands such as
alr clean
spawn an interactive prompt to set up the toolchainTaken from https://gitlab.com/1ma/radatracer/-/jobs/1513532725#L23
I've been using
alr clean
for fetching the sources of dependencies without building them in the same step. When runningalr clean
Alire v1.1.0-rc1 spawns an interactive dialog asking the user to configure the toolchain, and since in this case it runs on a non-interactive context (a CI pipeline) it fails.Maybe Alire 1.1.0 could start configured with the "None" toolchain and let the user
alr toolchain --select
one if he wants. I think that'd be a smoother user experience.toolchain --select
does not have a non-interactive modeRelated to the above problem, I don't seem able to fix the pipeline because I cannot select a toolchain non-interactively.
There is also a
--non-interactive (-n)
flag, but what this does is it automatically picks the first option, not the one I might want.Alire detects external FSF GNAT but not external GPRBuild
gnat_native toolchain and gprbuild are linked against glibc
musl-based distros such as Alpine Linux cannot use the distributed native executables, as they are linked against glibc.
These executables could be linked statically, or separate releases linked against musl could be published.
The text was updated successfully, but these errors were encountered: