forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: build noctilucent WASM library in a container (aws#26123)
Due to the addition of noctilucent to cdk, contributors needed to download rust/rustup to be able to build the cdk. This uses the pre-existing dependency on Docker/Finch to containerize the process in order to not incur any further dependencies for contributors to manage. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
1 parent
2e6cde8
commit bc409ba
Showing
7 changed files
with
68 additions
and
49 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
|
@@ -39,6 +39,3 @@ test/integ/cli/*.d.ts | |
.DS_Store | ||
|
||
junit.xml | ||
|
||
# Exclude the noctilucent WASM package | ||
lib/vendor/noctilucent/ |
This file contains 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 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 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,4 @@ | ||
# Ignore all files in this directory except the Dockerfile | ||
/* | ||
!/.gitignore | ||
!/Dockerfile |
This file contains 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,41 @@ | ||
FROM public.ecr.aws/debian/debian:buster-slim as build | ||
|
||
# Install basic pre-requisites | ||
RUN apt-get update \ | ||
&& apt-get install -y build-essential curl git libssl-dev openssl pkg-config zsh | ||
|
||
# Make sure we use the correct shell going forward | ||
SHELL ["/bin/zsh", "-c"] | ||
|
||
# Install Rustup | ||
ENV RUSTUP_HOME=/usr/local/rustup | ||
ENV CARGO_HOME=/usr/local/cargo | ||
RUN set -eo pipefail \ | ||
&& curl -fSsL "https://sh.rustup.rs" | sh -s -- -y --no-modify-path --profile=minimal \ | ||
&& echo "source ${CARGO_HOME}/env" >> /etc/profile.d/cargo.sh \ | ||
&& chmod -R a+rw ${CARGO_HOME} | ||
ENV PATH=$PATH:${CARGO_HOME}/bin | ||
|
||
# Install Node | ||
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ | ||
&& apt-get install -y nodejs | ||
|
||
# Install wasm-pack | ||
RUN cargo install wasm-opt wasm-pack | ||
|
||
ARG NOCTILUCENT_GIT | ||
ARG NOCTILUCENT_COMMIT_ID | ||
|
||
# Check out noctilucent | ||
RUN git clone "${NOCTILUCENT_GIT}" "${TMPDIR}/noctilucent" \ | ||
&& git -C "${TMPDIR}/noctilucent" checkout -b wasm "${NOCTILUCENT_COMMIT_ID}" | ||
|
||
# Build noctilucent to WASM | ||
RUN cd "${TMPDIR}/noctilucent" \ | ||
&& wasm-pack build --target=nodejs --out-name=index --out-dir=/wasm-out \ | ||
&& rm --force /wasm-out/.gitignore /wasm-out/README.md /wasm-out/package.json \ | ||
&& echo "${NOCTILUCENT_GIT}:${NOCTILUCENT_COMMIT_ID}" > /wasm-out/.version | ||
|
||
#################################################################################################### | ||
FROM scratch as wasm | ||
COPY --from=build /wasm-out / |
This file was deleted.
Oops, something went wrong.