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
unknownvendor instead ofalpineand as C compiler always gets called withcc --target=wrong-tripleit doesn't really matter that the CC is wrapped. I've added a way forcc-clangto work with any vendor by creating symlinks to the official ones. An alternative would be to try to rename the--targetflag in the wrapper.I think it makes sense to add
xx-cargoscript that would set the 3 env automatically.xx-cargo --setup-targetcould make the correct calls torustup target addorxx-apk add rust-stdlib(and set upxx-clangfor correct triple).Risc-V doesn't currently work because the gnu triple is
riscv64gc-*notriscv64. Might need some special override for that. Inalpine:edgethere is no riscv package forrust-stdlibyet, and no musl build inrustupeither.xx-cargoriscv64gc-gnutriple@crazy-max