Browse Source

Replace cargo-web with wasm-pack on build environment

pull/897/head
Kitaiti Makoto 3 months ago
parent
commit
affe24b9c6
7 changed files with 11 additions and 11 deletions
  1. +2
    -2
      .circleci/config.yml
  2. +1
    -1
      .circleci/images/plume-buildenv/Dockerfile
  3. +1
    -1
      Dockerfile
  4. +1
    -1
      Dockerfile.dev
  5. +2
    -2
      script/plume-front.sh
  6. +1
    -1
      script/prebuild.sh
  7. +3
    -3
      snap/snapcraft.yaml

+ 2
- 2
.circleci/config.yml View File

@@ -168,7 +168,7 @@ jobs:
steps:
- restore_env:
cache: <<#parameters.postgres>>postgres<</ parameters.postgres>><<^parameters.postgres>>sqlite<</parameters.postgres>>
- run: cargo web deploy -p plume-front
- run: RUSTFLAGS="--cfg=web_sys_unstable_apis" wasm-pack build --target web --release plume-front
- run_with_coverage:
cmd: |
cmd="cargo install --debug --no-default-features --features="${FEATURES}",test --force --path . -j"
@@ -203,7 +203,7 @@ jobs:
steps:
- restore_env:
cache: release-<<#parameters.postgres>>postgres<</ parameters.postgres>><<^parameters.postgres>>sqlite<</parameters.postgres>>
- run: cargo web deploy -p plume-front --release
- run: RUSTFLAGS="--cfg=web_sys_unstable_apis" wasm-pack build --target web --release plume-front
- build:
package: plume
release: true


+ 1
- 1
.circleci/images/plume-buildenv/Dockerfile View File

@@ -16,7 +16,7 @@ RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2021-0
rustup component add rust-std --target wasm32-unknown-unknown

#compile some deps
RUN cargo install cargo-web &&\
RUN cargo install wasm-pack &&\
cargo install grcov &&\
strip /root/.cargo/bin/* &&\
rm -fr ~/.cargo/registry


+ 1
- 1
Dockerfile View File

@@ -19,7 +19,7 @@ RUN chmod a+x ./wasm-deps.sh && sleep 1 && ./wasm-deps.sh

WORKDIR /app
COPY Cargo.toml Cargo.lock rust-toolchain ./
RUN cargo install cargo-web
RUN cargo install wasm-pack

COPY . .



+ 1
- 1
Dockerfile.dev View File

@@ -20,7 +20,7 @@ RUN chmod a+x ./wasm-deps.sh && sleep 1 && ./wasm-deps.sh
WORKDIR /app
COPY Cargo.toml Cargo.lock rust-toolchain ./
RUN cargo install diesel_cli --no-default-features --features postgres --version '=1.3.0'
RUN cargo install cargo-web
RUN cargo install wasm-pack

COPY . .



+ 2
- 2
script/plume-front.sh View File

@@ -21,7 +21,7 @@ EOF
if [ $ARCH == "aarch64" -o $ARCH == "armv71" ] ; then
export PATH=/opt/local/llvm/bin:${PATH}
cd /app
RUSTFLAGS="-C linker=lld" cargo web deploy -p plume-front
RUSTFLAGS="-C linker=lld --cfg=web_sys_unstable_apis" wasm-pack build --target web --release plume-front
else
cargo web deploy -p plume-front
RUSTFLAGS="--cfg=web_sys_unstable_apis" wasm-pack build --target web --release plume-front
fi

+ 1
- 1
script/prebuild.sh View File

@@ -9,7 +9,7 @@ pkg="$4"
build () {
features="$1"
cargo clean
cargo web deploy -p plume-front --release
RUSTFLAGS="--cfg=web_sys_unstable_apis" wasm-pack build --target web --release plume-front
cargo build --release --no-default-features --features="${features}" --package=plume-cli
cargo build --release --no-default-features --features="${features}"
./script/generate_artifact.sh


+ 3
- 3
snap/snapcraft.yaml View File

@@ -38,17 +38,17 @@ parts:
snapcraftctl set-version $(git describe --tags)
export PATH=$PATH:$HOME/.cargo/bin
rustup install stable
cargo +stable install --force cargo-web
cargo +stable install --force wasm-pack

# Only Tier 1 Rust platforms get rust-lld
# On the others (arm64, armhf, powerpc64, s390x) fall back to using
# the system LLD we've installed earlier.
case ${SNAPCRAFT_ARCH_TRIPLET} in \
aarch64-linux-gnu|arm-linux-gnueabihf|powerpc64-linux-gnu|s390x-linux-gnu) \
RUSTFLAGS="-C linker=lld-8" cargo web deploy -p plume-front --release \
RUSTFLAGS="-C linker=lld --cfg=web_sys_unstable_apis" wasm-pack build --target web --release plume-front \
;; \
*) \
cargo web deploy -p plume-front --release \
RUSTFLAGS="--cfg=web_sys_unstable_apis" wasm-pack build --target web --release plume-front \
;; \
esac



Loading…
Cancel
Save