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

scripts/install.in: add riscv64 support to installer #10806

Merged
merged 2 commits into from
Jun 3, 2024

Conversation

jdek
Copy link
Contributor

@jdek jdek commented May 30, 2024

Motivation

The artifacts are already built and hosted, the install script just needs to be taught about riscv64.

Context

Making this change manually to the install script the Nix installation was able to succeed.

Priorities and Process

Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

The artifacts are already built and hosted, the install script just needs to be taught about riscv64.

Signed-off-by: J. Dekker <jdek@itanimul.li>
@jdek jdek requested a review from edolstra as a code owner May 30, 2024 13:09
@cole-h
Copy link
Member

cole-h commented May 30, 2024

I believe you'll also need to add riscv64 here:

downloadFile("binaryTarball.i686-linux", "1");
downloadFile("binaryTarball.x86_64-linux", "1");
downloadFile("binaryTarball.aarch64-linux", "1");
downloadFile("binaryTarball.x86_64-darwin", "1");
downloadFile("binaryTarball.aarch64-darwin", "1");

@jdek
Copy link
Contributor Author

jdek commented May 30, 2024

@cole-h wouldn't that require a native riscv64 builder? the cross-compiled one is already downloaded:

eval {
downloadFile("binaryTarballCross.x86_64-linux.riscv64-unknown-linux-gnu", "1");
};
warn "$@" if $@;

Though this should probably be hooked up to the cross-compiled store path for riscv64 here too:

# Upload nix-fallback-paths.nix.
write_file("$tmpDir/fallback-paths.nix",
"{\n" .
" x86_64-linux = \"" . getStorePath("build.x86_64-linux") . "\";\n" .
" i686-linux = \"" . getStorePath("build.i686-linux") . "\";\n" .
" aarch64-linux = \"" . getStorePath("build.aarch64-linux") . "\";\n" .
" x86_64-darwin = \"" . getStorePath("build.x86_64-darwin") . "\";\n" .
" aarch64-darwin = \"" . getStorePath("build.aarch64-darwin") . "\";\n" .
"}\n");

@cole-h
Copy link
Member

cole-h commented May 30, 2024

Oh oops you're right, I meant to point at the fallback-paths.nix writing. Not sure why I decided the place I pointed to was the right place 😅

This uses the x86_64-linux's cross-compiled output as we don't have a
native riscv64 builder.

Signed-off-by: J. Dekker <jdek@itanimul.li>
@jdek
Copy link
Contributor Author

jdek commented May 30, 2024

@cole-h something like 73f9afd, I presume. I'm looking at https://hydra.nixos.org/build/260037794 for reference.

Copy link
Member

@roberth roberth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks to be complete.
Not sure about fallback paths, but I don't see harm in it, so 👍 from me.

@@ -243,6 +243,7 @@ sub downloadFile {
" x86_64-linux = \"" . getStorePath("build.x86_64-linux") . "\";\n" .
" i686-linux = \"" . getStorePath("build.i686-linux") . "\";\n" .
" aarch64-linux = \"" . getStorePath("build.aarch64-linux") . "\";\n" .
" riscv64-linux = \"" . getStorePath("buildCross.riscv64-unknown-linux-gnu.x86_64-linux") . "\";\n" .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lack of armv7 here suggests that this is not strictly necessary, but it seems like adding cross builds here could be useful for those who need it, when they need it, which would be rare.

I don't know the history of this feature. wdyt @edolstra?

@edolstra
Copy link
Member

edolstra commented Jun 3, 2024

Merging this with the caveat that it's best-effort (since we're not actually testing whether it works, only cross-building) and may be disabled if it breaks and blocks the release (since none of the maintainers are really capable of fixing riscv64 issues).

@edolstra edolstra merged commit 1450b55 into NixOS:master Jun 3, 2024
9 checks passed
@jdek
Copy link
Contributor Author

jdek commented Jun 3, 2024

Cool, thanks. Feel free to @ me to test RISC-V related stuff.

@jdek jdek deleted the riscv64_install branch June 3, 2024 17:54
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2024-06-03-nix-team-meeting-minutes-149/46582/1

@Mic92
Copy link
Member

Mic92 commented Jun 6, 2024

I also got access to a bigger riscv64 machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants