Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,19 @@ const DEFAULTS_DIR = path.join(
export interface VMConfig {
defaultIncludes: string[];
baseImage: string;
version: string;
}

const CONFIGS: Record<BuildableLanguage, VMConfig> = {
"wasm/rust": {
defaultIncludes: ["Cargo.toml", "Cargo.lock"],
baseImage: "polywrap/vm-base-rs",
version: "0.2.0",
},
"wasm/assemblyscript": {
defaultIncludes: ["package.json", "package-lock.json", "yarn.lock"],
baseImage: "polywrap/vm-base-as",
version: "0.1.0",
},
};

Expand Down Expand Up @@ -194,7 +197,7 @@ export class DockerVMBuildStrategy extends BuildStrategy<void> {
this._volumePaths.linkedPackages
)}:/linked-packages`,
cacheVolume,
`${CONFIGS[language].baseImage}:latest`,
`${CONFIGS[language].baseImage}:${process.arch}-${CONFIGS[language].version}`,
"/bin/bash",
"--verbose",
"/project/polywrap-build.sh",
Expand All @@ -221,7 +224,7 @@ export class DockerVMBuildStrategy extends BuildStrategy<void> {
`${path.resolve(
this._volumePaths.linkedPackages
)}:/linked-packages`,
`${CONFIGS[language].baseImage}:latest`,
`${CONFIGS[language].baseImage}:${process.arch}-${CONFIGS[language].version}`,
"/bin/bash",
"-c",
'"chmod -R 777 /project && chmod -R 777 /linked-packages"',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
FROM rust:1.65.0 as base
FROM rust:1.66-alpine as base
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also what is the reasoning for moving to alpine?


# Install the wasm32 rust build target
RUN rustup target add wasm32-unknown-unknown

WORKDIR /build-deps

# Install curl
RUN apt-get update
RUN apt-get -y install curl clang llvm build-essential
RUN apk add curl build-base pkgconfig openssl-dev bash

# Install wasm-opt
RUN curl -L https://github.com/WebAssembly/binaryen/releases/download/version_101/binaryen-version_101-x86_64-linux.tar.gz | tar -xz \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
FROM rust:1.65.0 as base
FROM rust:1.66-alpine as base

# Install the wasm32 rust build target
RUN rustup target add wasm32-unknown-unknown

WORKDIR /build-deps

# Install curl
RUN apt-get update
RUN apt-get -y install curl clang llvm build-essential
RUN apk add curl build-base pkgconfig openssl-dev bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Niraj-Kamdar, apologies for not asking about this before, but why are we now installing build-base, pkgconfig, openssl-dev and base?

Also I should have caught this before, but for rust builds we require clang, llvm and build-essentials to build & link native C libs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One answer I found is that build-base is the alpine equivalent of build-essentials.


# Install wasm-opt
RUN curl -L https://github.com/WebAssembly/binaryen/releases/download/version_101/binaryen-version_101-x86_64-linux.tar.gz | tar -xz \
Expand Down