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

Rasbperry 3 (armv7l-unknown-linux-musl) #1736

Closed
Quantium opened this issue Oct 5, 2020 · 7 comments · Fixed by #2137
Closed

Rasbperry 3 (armv7l-unknown-linux-musl) #1736

Quantium opened this issue Oct 5, 2020 · 7 comments · Fixed by #2137
Labels
✨ enhancement A new feature implementation. 💻 new platform Support for a new architecure or operating system

Comments

@Quantium
Copy link

Quantium commented Oct 5, 2020

Feature Request

Is your feature request related to a problem? Please describe.

Install starship in raspberry pi 3

Describe the solution you'd like

When I run the installation script in a rasbian system based on armv7l-unknown-linux-musl starship should be installed normaly

Describe alternatives you've considered

May be to have an installation script for raspbian

@Quantium Quantium added the ✨ enhancement A new feature implementation. label Oct 5, 2020
@chipbuster chipbuster added the 💻 new platform Support for a new architecure or operating system label Oct 6, 2020
@kakulukia
Copy link

With the upcoming OSX ARM version this will probably effect a lot more than just the few Raspberry users out there. :)

@Quantium
Copy link
Author

With the upcoming OSX ARM version this will probably effect a lot more than just the few Raspberry users out there. :)

That's true!!!

@crahan
Copy link

crahan commented Nov 24, 2020

Took a stab at cross-compiling Starship on macOS for ARM and ended up with working 32-bit and 64-bit binaries for the Raspberry Pi (no expert at cross-compiling so it was a learning experience). Did some minor testing and so far so good.

Screen Shot 2020-11-24 at 01 20 01

@theorician
Copy link

@crahan Can you post your shell history for cross compiling to ARM? I'm happy to build my own pipeline to generate an ARM binary for my own Pis but I'm not having a lot of luck getting it working. (Though I was trying to get it to compile with the official rust Docker image, rather than on my Mac.)

@davidkna
Copy link
Member

davidkna commented Jan 7, 2021

@theorician Try this:

cargo install cross
# Make sure podman/docker are installed
cd starship
cross build --release --target armv7l-unknown-linux-musl

@davidkna
Copy link
Member

davidkna commented Jan 7, 2021

I think you might need to add --features tls-vendored too

@theorician
Copy link

theorician commented Jan 7, 2021

Okay, I've had another go at this. I put it in the form of a Gitlab CI job running in a Docker executor. Copying out the script sections and putting them in a Dockerfile for the rust image works just fine as well.

stages:
  - build
build_for_arm: 
  image: rust
  stage: build
  script: 
    - apt-get update
    - apt-get -yq install gcc-arm-linux-gnueabi
    - rustup target add arm-unknown-linux-gnueabi
    - git clone https://github.com/starship/starship starship-repo
    - cd starship-repo
    - git checkout $(git describe --tags --abbrev=0)
    - mkdir .cargo
    - printf '[target.arm-unknown-linux-gnueabi]\nlinker = "arm-linux-gnueabi-gcc"' > .cargo/config
    - cargo build --release --target arm-unknown-linux-gnueabi --features tls-vendored
    - mv ./target/arm-unknown-linux-gnueabi/release/starship ../
  artifacts:
    name: starship
    paths:
      - ./starship

It does not build HEAD but instead looks for the latest release tag and builds that. That's probably safer for 'production' use. I've confirmed that it works on both the Raspberry Pi 3b and a Pi Zero W, though it's possible that the Pi Zero W will show some weird behaviour, since this is compiling for a newer ARM architecture I think.

Thanks everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement A new feature implementation. 💻 new platform Support for a new architecure or operating system
Projects
None yet
7 participants
@kakulukia @crahan @theorician @davidkna @Quantium @chipbuster and others