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 Rust toolchain to provided_al2 to build Rust functions. #62

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions build-image-src/ATTRIBUTION.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ https://github.com/FasterXML/jackson-databind
** requests; version 2.7.0 -- https://github.com/psf/requests
** s3transfer; version 0.3.3 -- https://github.com/boto/s3transfer
** serverlessrepo; version 0.1.9 -- https://pypi.org/project/serverlessrepo/
** Rust; version 1.63.0 -- https://github.com/rust-lang/rust
** Rustup; version 1.25.1 -- https://github.com/rust-lang/rustup

Apache License

Expand Down Expand Up @@ -377,6 +379,57 @@ limitations under the License.

------

** Zig; version 0.9.1 -- https://ziglang.org/
The MIT License (Expat)

Copyright (c) 2015-2022, Zig contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

------

** Cargo Lambda; version 0.11.1 -- https://www.cargo-lambda.info
Copyright (c) 2022 David Calavera <[email protected]>

MIT License

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

------

** ruby; version 2.5.8 -- https://www.ruby-lang.org/
Ruby is copyrighted free software by Yukihiro Matsumoto <[email protected]>.
** ruby; version 2.7.1 -- https://www.ruby-lang.org/
Expand Down
11 changes: 11 additions & 0 deletions build-image-src/Dockerfile-provided_al2
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ COPY --from=1 /rootfs /
ARG AWS_CLI_ARCH
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-$AWS_CLI_ARCH.zip" -o "awscliv2.zip" && unzip awscliv2.zip && ./aws/install && rm awscliv2.zip && rm -rf ./aws

# Install Rust toolchain
ARG RUST_VERSION=1.63.0
ENV RUST_ARCH=${AWS_CLI_ARCH}-unknown-linux-gnu
ENV RUSTUP_HOME=/usr/local/rustup CARGO_HOME=/usr/local/cargo PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUST_VERSION=${RUST_VERSION}
RUN url="https://static.rust-lang.org/rustup/archive/1.25.1/${RUST_ARCH}/rustup-init"; curl -sSOL "$url"; chmod +x rustup-init; ./rustup-init -y --no-modify-path --profile minimal --default-toolchain ${RUST_VERSION} --default-host ${RUST_ARCH}; rm rustup-init; chmod -R a+w ${RUSTUP_HOME} ${CARGO_HOME}
calavera marked this conversation as resolved.
Show resolved Hide resolved
RUN rustup target install x86_64-unknown-linux-gnu; rustup target install aarch64-unknown-linux-gnu

# Install Cargo Lambda and depedendencies
ARG CARGO_LAMBDA_VERSION=0.11.1
RUN pip3 install cargo-lambda==${CARGO_LAMBDA_VERSION}

# Install SAM CLI in a dedicated Python virtualenv
ARG SAM_CLI_VERSION
RUN curl -L "https://github.com/awslabs/aws-sam-cli/archive/v$SAM_CLI_VERSION.zip" -o "samcli.zip" && \
Expand Down