-
Notifications
You must be signed in to change notification settings - Fork 25
Fix build toolchain creating root-owned files on Linux #342
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
base: main
Are you sure you want to change the base?
Changes from all commits
f9d7c15
260c33a
c0f5e5a
8d67dd9
97291d3
423b478
d13b939
f85165f
06f1dff
4280842
0b0e3ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
FROM suborbital/subo:dev as subo | ||
|
||
FROM node:16-buster-slim | ||
WORKDIR /root/runnable | ||
WORKDIR /usr/src/runnable | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why was this path chosen? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I...honestly don't remember where The |
||
COPY --from=subo /go/bin/subo /usr/local/bin | ||
RUN npm install -g npm@latest |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
FROM suborbital/subo:dev as subo | ||
|
||
FROM ghcr.io/grain-lang/grain:0.4-slim | ||
WORKDIR /root/runnable | ||
WORKDIR /usr/src/runnable | ||
COPY --from=subo /go/bin/subo /usr/local/bin/subo | ||
RUN mkdir /root/suborbital |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
FROM suborbital/subo:dev as subo | ||
|
||
FROM rust:1.56.1-slim-buster | ||
WORKDIR /root/runnable | ||
COPY --from=subo /go/bin/subo /usr/local/bin | ||
WORKDIR /usr/src/runnable | ||
|
||
# install the wasm target and then force an update of the crates.io index | ||
RUN rustup target install wasm32-wasi && \ | ||
cargo search suborbital | ||
|
||
# install the wasm target and then install something that | ||
# doesn't exist (and ignore the error) to update the crates.io index | ||
RUN mkdir /root/suborbital && \ | ||
rustup target install wasm32-wasi | ||
RUN cargo install lazy_static; exit 0 | ||
# make everything inside CARGO_HOME writable for anyone (again) | ||
RUN chmod -R a+w $RUSTUP_HOME $CARGO_HOME | ||
|
||
# embed subo | ||
COPY --from=subo /go/bin/subo /usr/local/bin |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
FROM suborbital/subo:dev as subo | ||
|
||
FROM ghcr.io/swiftwasm/swift:focal | ||
WORKDIR /root/runnable | ||
WORKDIR /usr/src/runnable | ||
COPY --from=subo /go/bin/subo /usr/local/bin |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
|
||
set -eu | ||
|
||
TEST_PROJECT="buildertest" | ||
|
||
trap 'catch $? $LINENO' EXIT | ||
|
||
catch() { | ||
if [[ "$1" != "0" ]]; then | ||
echo "An Error $1 occurred on $2" | ||
fi | ||
|
||
# return to origin, clear directory stack | ||
pushd -0 > /dev/null && dirs -c | ||
|
||
if [[ -d "$TEST_PROJECT" ]]; then | ||
echo "Cleaning up test artifacts..." | ||
rm -rf "$TEST_PROJECT" || echo "Failed to clean up test artifacts, if this was a permissions error try using 'sudo rm -rf $TEST_PROJECT'" | ||
fi | ||
} | ||
|
||
# build local subo docker image | ||
docker image ls -q suborbital/subo:dev | ||
if [[ "$?" != "0" ]]; then | ||
make subo/docker | ||
fi | ||
|
||
# rebuild local docker build tooling | ||
docker build . -f builder/docker/assemblyscript/Dockerfile -t suborbital/builder-as:dev | ||
docker build . -f builder/docker/grain/Dockerfile --platform linux/amd64 -t suborbital/builder-gr:dev | ||
docker build . -f builder/docker/javascript/Dockerfile -t suborbital/builder-js:dev | ||
docker build . -f builder/docker/rust/Dockerfile -t suborbital/builder-rs:dev | ||
docker build . -f builder/docker/swift/Dockerfile -t suborbital/builder-swift:dev | ||
docker build . -f builder/docker/tinygo/Dockerfile --platform linux/amd64 --build-arg TARGETARCH=amd64 -t suborbital/builder-tinygo:dev | ||
docker build . -f builder/docker/wat/Dockerfile -t suborbital/builder-wat:dev | ||
Comment on lines
+30
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't have an explicit make ver=dev builder/docker/tinygo There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool, I'll change it around! |
||
|
||
|
||
# create a new project | ||
subo create project "$TEST_PROJECT" | ||
|
||
# enter project directory | ||
pushd "$TEST_PROJECT" > /dev/null | ||
|
||
# create a runnable for each supported language | ||
subo create module rs-test --lang rust | ||
subo create module swift-test --lang swift | ||
subo create module as-test --lang assemblyscript | ||
subo create module tinygo-test --lang tinygo | ||
subo create module js-test --lang javascript | ||
|
||
# build project bundle | ||
subo build . --builder-tag dev --verbose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great and obvious in hindsight!