-
Notifications
You must be signed in to change notification settings - Fork 36
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
Rust support #27
Rust support #27
Conversation
7564e6c
to
b7528bc
Compare
Added xx-cargo and riscv support. Works with both Alpine and Debian with either rustup or package based installs. RiscV only works on debian, musl support is blocked in rust-lang/libc#1994 Test stages with xx-cargo
|
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
@tonistiigi Looks like it has been merged: rust-lang/libc#2537 |
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Using xx-cargo is optional. Alternative is to install stdlib with xx-apt/xx-apk or with rustup with XX_VENDOR=unknown xx-info. Then CC, and _LINKER needs to be defined via xx-info. Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
132a063
to
2543538
Compare
@crazy-max So I think the last commit needs to be reverted to make CI work. Or do you have additional analysis? |
@tonistiigi I looked across GitHub for I'm a bit worried about this case: Line 38 in 5596639
I think we could just use |
Do you understand what is causing the CI failure. Maybe there is a solution that would allow keeping that line. Having |
8d23e49
to
9e46daa
Compare
Yes it fails with Line 6 in 5596639
|
That file does not use |
9e46daa
to
ea9cf16
Compare
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
ea9cf16
to
b8dde93
Compare
Allow building rust projects. Support installing rust via
rustup
(alpine/debian) and alpine packages (rust/rust-stdlib). Haven't tested official image. Debian package-based installs will probably not be supported as packages don't seem to be properly separated.Currently have tested with these Dockerfile stages:
The main complexity is that the binary releases use triple with
unknown
vendor instead ofalpine
and as C compiler always gets called withcc --target=wrong-triple
it doesn't really matter that the CC is wrapped. I've added a way forcc-clang
to work with any vendor by creating symlinks to the official ones. An alternative would be to try to rename the--target
flag in the wrapper.I think it makes sense to add
xx-cargo
script that would set the 3 env automatically.xx-cargo --setup-target
could make the correct calls torustup target add
orxx-apk add rust-stdlib
(and set upxx-clang
for correct triple).Risc-V doesn't currently work because the gnu triple is
riscv64gc-*
notriscv64
. Might need some special override for that. Inalpine:edge
there is no riscv package forrust-stdlib
yet, and no musl build inrustup
either.xx-cargo
riscv64gc-gnu
triple@crazy-max