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

Add multiplatform linux build to CI #1372

Closed
wants to merge 4 commits into from

Conversation

abihf
Copy link

@abihf abihf commented Nov 3, 2022

Fix #1049

  • Add linux-aarch64 build and assets
  • Update volta-install.sh scripts to support aarch64 platform on linux

@abihf abihf force-pushed the linux-multi-platform branch from 2d8d832 to e1a2c28 Compare November 3, 2022 18:46
@avaly
Copy link

avaly commented Nov 4, 2022

Shouldn't this install script also be updated with the support for this architecture?

@charlespierce
Copy link
Contributor

Hi @abihf, thanks for the contribution! I'm a little worried this is conflating two related but not identical issues, making it a little more risky. Creating an arm build in the existing Linux pipeline is something we've been looking at for a while (which should be a lot easier now that we dropped the OpenSSL dependency). On the other hand, switching to a fully statically-linked libc is a bigger change that we haven't fully investigated. For that, we should have an RFC so that we can be reasonably confident that we've thought through the impact of that change.

Given that, would you be open to breaking this into two parts? The first being creating a pre-built binary for ARM Linux (using the existing pipeline) and the second being an RFC for switching to statically-linked libc. Totally reasonable to do one or the other (or neither if you don't have the bandwidth!), but I don't think we're in a state right now where we can take on both of these changes at once.

@abihf abihf force-pushed the linux-multi-platform branch from e1a2c28 to 58ed28b Compare November 5, 2022 11:33
@abihf
Copy link
Author

abihf commented Nov 5, 2022

I've disabled static link & updated volta-install.sh

@avaly
Copy link

avaly commented Nov 10, 2022

How can we help moving this PR along?

My team is blocked on using the new pnpm support from #1273, because we also need a linux-aarch64 binary.

@nevir
Copy link

nevir commented Feb 2, 2023

Also interested in this

@ditachev
Copy link

Our team is also in need of a pre-built ARM64 linux binary. Is there any progress on this or is there a plan of action on this going forward?

@avarun42
Copy link

avarun42 commented Mar 8, 2023

Hi @abihf, thanks for the contribution! I'm a little worried this is conflating two related but not identical issues, making it a little more risky. Creating an arm build in the existing Linux pipeline is something we've been looking at for a while (which should be a lot easier now that we dropped the OpenSSL dependency). On the other hand, switching to a fully statically-linked libc is a bigger change that we haven't fully investigated. For that, we should have an RFC so that we can be reasonably confident that we've thought through the impact of that change.

Given that, would you be open to breaking this into two parts? The first being creating a pre-built binary for ARM Linux (using the existing pipeline) and the second being an RFC for switching to statically-linked libc. Totally reasonable to do one or the other (or neither if you don't have the bandwidth!), but I don't think we're in a state right now where we can take on both of these changes at once.

Hi @charlespierce, it seems that this PR no longer uses a fully statically-linked libc. Would it be possible to get this merged now?

@nevir
Copy link

nevir commented Mar 31, 2023

Also very interested in this

@this-is-tobi
Copy link

Hi, any news about this one ?

Comment on lines +32 to +37
- name: Install cross
run: cargo install cross
- name: Build
run: cross build --release --target ${{ matrix.target }}
- name: Create artifact
run: tar -czvf volta-${{ matrix.name }}.tar.gz volta volta-shim volta-migrate
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not on a machine right now where I can cleanly check, but does this change the glibc dependency for the standard linux build? The Docker system setup right now is built intentionally to support running on an old version of glibc.

For the ARM build, since we haven't supported it in the past, it's not a big deal to use a more recent version, but for the existing linux build we've been committed to backwards compatibility.

Copy link

@this-is-tobi this-is-tobi Apr 22, 2023

Choose a reason for hiding this comment

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

I have never done any development in Rust so it would take me a long time to do a good analysis but I can try to make a proposal.

Could QEMU be used in Github actions with another step to build a second linux builder image (linux/arm64 platform) and then use this image with the docker run --platform flag to build volta for both architectures?

EDIT : I didn't mention this but it would result in a change to the base image in the Dockerfile (cern/slc6-base) as it's an amd64 image, but I don't know why you're using that image so I can't say if that's something possible.

Copy link
Contributor

@charlespierce charlespierce left a comment

Choose a reason for hiding this comment

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

Overall looks good! Just one open question about the glibc compatibility for the existing Linux build.

@abihf
Copy link
Author

abihf commented Apr 23, 2023

Overall looks good! Just one open question about the glibc compatibility for the existing Linux build.

the cross build uses ubuntu:20.04 as base image link

I have tried running it on ubuntu 18.04 and it still running

❯ docker run -i -t --rm -v $(pwd):/volta -w /volta ubuntu:18.04 ./volta -v
Updating your Volta directory. This may take a few moments...
1.1.1

But unfortunately it can't run on centos:7

❯ docker run -i -t --rm -v $(pwd):/volta -w /volta centos:7 ./volta -v
./volta: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by ./volta)

will try to investigate it later

@@ -129,6 +129,8 @@ parse_os_info() {
Linux)
if [ "$arch" == "x86_64" ]; then
echo "linux"
elif [ "$arch" == "aarch64" ]; then
echo "linux-aarch64"
else
error "Releases for non x64 architectures are not currently supported."
Copy link

Choose a reason for hiding this comment

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

Thank you for this. Might be worth updating the message as well

Copy link
Author

Choose a reason for hiding this comment

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

Hi @Fydon would you point me which message I need to update?

Copy link

@Fydon Fydon Jan 8, 2024

Choose a reason for hiding this comment

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

Sure. For macOS there is no error text, so perhaps the same is true for Linux when ARM64 is supported. Otherwise the error message should be something like "Only x64 and ARM64 architectures are currently supported". I believe that x64 is x86_64 and not all architectures ending in 64.

@Fydon
Copy link

Fydon commented Nov 7, 2023

Will using cargo clean resolve the GLIBC issue, as recommended here?

@Fydon
Copy link

Fydon commented Nov 7, 2023

I assume that a similar change to this for Linux would be ideal, in another pull request?

@charlespierce
Copy link
Contributor

I believe this is handled by #1696. Thanks again for the inspiration!

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

Successfully merging this pull request may close these issues.

Provide prebuilt binaries for alpine arm64 environments
8 participants