Fix toolchain Docker build: pre-fetch Nanvix OS artifacts#15
Closed
ppenna wants to merge 1 commit into
Closed
Conversation
The GCC `z` script (v13.3.0) downloads the public nanvix/nanvix OS release via `gh` during `z configure` to obtain libposix.a, user.ld and the nanvixd binaries. `gh` is not installed or authenticated inside the Docker builder, so the toolchain build failed at the GCC stage0 configure step with "Failed to download Nanvix release". Stage these artifacts into the install prefix with curl before building GCC. The `z` script then detects them and skips the `gh` download. The release tag, asset name and SHA-256 mirror the constants in nanvix/gcc's `z` script. Validated locally: full image build succeeds and i686-nanvix-gcc 13.3.0 cross-compiles tests/hello.c to a valid i686 ELF executable. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Author
|
Superseded by nanvix/gcc#58, which decouples the Nanvix OS artifact download from |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The toolchain image build fails at the GCC stage 0 configure step:
The GCC
zscript on the v13.3.0 branch added a step indownload_steps()(run during./z configure) that downloads the publicnanvix/nanvixOS release (v0.13.17) viagh release downloadto stagelibposix.a,user.ld, and thenanvixdbinaries into the install prefix.ghis not installed or authenticated inside this Docker builder, so the build fails. (Thenanvix/gccandnanvix/newlibCI builds succeed because GitHub-hosted runners shipghwith a token.)Fix
Stage the same Nanvix OS artifacts into
${PREFIX}withcurlbefore building GCC. Thezscript then detects them as already present and skips theghdownload:The release tag, asset name and SHA-256 mirror the constants in
nanvix/gcc'szscript, and are exposed asARGs for easy maintenance. No build secrets or auth required (the asset is public).Validation
Built the image locally with the latest published component tags:
BINUTILS_COMMIT=nanvix-v2.42-686c3b0673cGCC_COMMIT=nanvix-v13.3.0-e795b98ca52-stage1NEWLIB_COMMIT=nanvix-v4.4.0-c3cdbe37a-gccResults:
i686-nanvix-gcc (GCC) 13.3.0,i686-nanvix-g++ (GCC) 13.3.0,GNU assembler/ld (GNU Binutils) 2.42.i686-nanvix-gcccompilestests/hello.cto a valid i686ELF32 EXECexecutable.Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com