-
Notifications
You must be signed in to change notification settings - Fork 108
config: add rust build configurations #1468
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{% extends 'clang-15.jinja2' %} | ||
|
||
{% block packages %} | ||
{{ super() }} | ||
|
||
ARG RUST_VER=1.62.0 | ||
ARG BINDGEN_VER=0.56.0 | ||
|
||
ARG RUST_TRIPLE=rust-${RUST_VER}-x86_64-unknown-linux-gnu | ||
|
||
ENV CARGO_HOME=/home/kernelci/.cargo | ||
ENV PATH=/usr/${RUST_TRIPLE}/bin:${CARGO_HOME}/bin:${PATH} | ||
|
||
ARG SHA256SUM=4172d3cb316498025410bdf33a4d0f756f5e77fbaee1fb042ccdef78239be1db | ||
|
||
# fetch, verify the toolchain | ||
RUN wget https://static.rust-lang.org/dist/${RUST_TRIPLE}.tar.gz && \ | ||
echo "${SHA256SUM} ${RUST_TRIPLE}.tar.gz" | sha256sum --check --quiet | ||
|
||
# install & cleanup tmp files | ||
RUN tar -xf ${RUST_TRIPLE}.tar.gz -C /tmp/ && \ | ||
/tmp/${RUST_TRIPLE}/install.sh --prefix=/usr/${RUST_TRIPLE} \ | ||
--components=rustc,cargo,rust-std-x86_64-unknown-linux-gnu && \ | ||
rm -rf /tmp/${RUST_TRIPLE} && \ | ||
rm /${RUST_TRIPLE}* | ||
|
||
# This image is based on clang-*jinja2 which only has clang installed but rustc | ||
# defaults to linker "cc" which calls the non-existing GNU stack (gcc, libgcc). | ||
# So we point cargo/rustc to use the LLVM stack via the clang linker entrypoint. | ||
RUN mkdir -p ${CARGO_HOME} && \ | ||
printf '[build]\nrustflags = ["-C", "linker=clang"]' > ${CARGO_HOME}/config.toml | ||
|
||
RUN git clone --recurse-submodules --branch $RUST_VER \ | ||
https://github.com/rust-lang/rust \ | ||
$(rustc --print sysroot)/lib/rustlib/src/rust | ||
|
||
RUN cargo install --locked --version ${BINDGEN_VER} bindgen | ||
|
||
{%- endblock %} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.