Skip to content

Commit

Permalink
Merge #3288
Browse files Browse the repository at this point in the history
3288: Rollback all the TARGET_DIR changes r=ptitSeb a=ptitSeb

# Description
Rollback all the TARGET_DIR changes, because `cargo --target-dir` is only the base folder. We would need `--out-dir` but it's only for the unstable channel.

Co-authored-by: ptitSeb <sebastien.chev@gmail.com>
  • Loading branch information
bors[bot] and ptitSeb authored Nov 8, 2022
2 parents da85967 + 3d4da41 commit b7c185b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 26 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/test-sys.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ jobs:
make test-integration-cli
env:
TARGET: ${{ matrix.target }}
TARGET_DIR: target/release
TARGET_DIR: target/${{ matrix.target }}/release
CARGO_TARGET: --target ${{ matrix.target }}
- name: Test integration CLI
if: matrix.run_test && matrix.os == 'windows-2019'
Expand All @@ -219,31 +219,31 @@ jobs:
make test-integration-cli
env:
TARGET: x86_64-pc-windows-msvc
TARGET_DIR: target/release
TARGET_DIR: TARGET_DIR: target/x86_64-pc-windows-msvc/release
CARGO_TARGET: --target x86_64-pc-windows-msvc
- name: Test
if: matrix.run_test && matrix.os != 'windows-2019'
run: |
make
env:
TARGET: ${{ matrix.target }}
TARGET_DIR: target/release
TARGET_DIR: target/${{ matrix.target }}/release
CARGO_TARGET: --target ${{ matrix.target }}
- name: Test
if: matrix.run_test && matrix.os != 'windows-2019'
run: |
make build-capi && make package-capi && export WASMER_DIR=`pwd`/package && make test
env:
TARGET: ${{ matrix.target }}
TARGET_DIR: target/release
TARGET_DIR: target/${{ matrix.target }}/release
CARGO_TARGET: --target ${{ matrix.target }}
- name: Test C API
if: matrix.run_test_capi && matrix.os != 'windows-2019'
run: |
make test-capi
env:
TARGET: ${{ matrix.target }}
TARGET_DIR: target/release
TARGET_DIR: target/${{ matrix.target }}/release
CARGO_TARGET: --target ${{ matrix.target }}
- name: Test
if: matrix.run_test && matrix.os == 'windows-2019'
Expand Down
34 changes: 13 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -283,20 +283,12 @@ endif

HOST_TARGET=$(shell rustup show | grep 'Default host: ' | cut -d':' -f2 | tr -d ' ')

TARGET_DIR ?=
TARGET_DIR ?= target/release

ifneq (, $(TARGET))
TARGET_DIR ?= target/$(TARGET)/release
endif

ifneq (, $(TARGET_DIR))
target_dir := --target-dir $(TARGET_DIR)
endif

ifeq (release, $(notdir $(TARGET_DIR)))
target_dir := --target-dir $(dir $(TARGET_DIR))
endif

$(info -----------)
$(info $(bold)$(green)INFORMATION$(reset))
$(info -----------)
Expand Down Expand Up @@ -370,7 +362,7 @@ check-capi: capi-setup
--no-default-features --features wat,compiler,wasi,middlewares $(capi_compiler_features)

build-wasmer:
$(CARGO_BINARY) build $(CARGO_TARGET) --release --manifest-path lib/cli/Cargo.toml $(compiler_features) --features="webc_runner" --bin wasmer $(target_dir)
$(CARGO_BINARY) build $(CARGO_TARGET) --release --manifest-path lib/cli/Cargo.toml $(compiler_features) --features="webc_runner" --bin wasmer

build-wasmer-debug:
$(CARGO_BINARY) build $(CARGO_TARGET) --manifest-path lib/cli/Cargo.toml $(compiler_features) --features "webc_runner,debug" --bin wasmer
Expand Down Expand Up @@ -429,50 +421,50 @@ build-docs-capi: capi-setup
# when generating the documentation, we rename it to its
# crate's name. Then we restore the lib's name.
sed "$(SEDI)" -e 's/name = "wasmer" # ##lib.name##/name = "wasmer_c_api" # ##lib.name##/' lib/c-api/Cargo.toml
RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) doc $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --no-deps --features wat,compiler,cranelift,wasi $(target_dir)
RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) doc $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --no-deps --features wat,compiler,cranelift,wasi
sed "$(SEDI)" -e 's/name = "wasmer_c_api" # ##lib.name##/name = "wasmer" # ##lib.name##/' lib/c-api/Cargo.toml

build-capi: capi-setup
RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release $(target_dir) \
RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features wat,compiler,wasi,middlewares,webc_runner $(capi_compiler_features)

build-capi-singlepass: capi-setup
RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release $(target_dir) \
RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features wat,compiler,singlepass,wasi,middlewares,webc_runner

build-capi-singlepass-universal: capi-setup
RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release $(target_dir) \
RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features wat,compiler,singlepass,wasi,middlewares,webc_runner

build-capi-cranelift: capi-setup
RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release $(target_dir) \
RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features wat,compiler,cranelift,wasi,middlewares,webc_runner

build-capi-cranelift-universal: capi-setup
RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release $(target_dir) \
RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features wat,compiler,cranelift,wasi,middlewares,webc_runner

build-capi-llvm: capi-setup
RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release $(target_dir) \
RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features wat,compiler,llvm,wasi,middlewares,webc_runner

build-capi-llvm-universal: capi-setup
RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release $(target_dir) \
RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features wat,compiler,llvm,wasi,middlewares,webc_runner

# Headless (we include the minimal to be able to run)

build-capi-headless: capi-setup
ifeq ($(CARGO_TARGET),)
RUSTFLAGS="${RUSTFLAGS} -C panic=abort -C link-dead-code -C lto -O -C embed-bitcode=yes" $(CARGO_BINARY) build --target $(HOST_TARGET) --manifest-path lib/c-api/Cargo.toml --release $(target_dir) \
RUSTFLAGS="${RUSTFLAGS} -C panic=abort -C link-dead-code -C lto -O -C embed-bitcode=yes" $(CARGO_BINARY) build --target $(HOST_TARGET) --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features compiler-headless,wasi
else
RUSTFLAGS="${RUSTFLAGS} -C panic=abort -C link-dead-code -C lto -O -C embed-bitcode=yes" $(CARGO_BINARY) build $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release $(target_dir) \
RUSTFLAGS="${RUSTFLAGS} -C panic=abort -C link-dead-code -C lto -O -C embed-bitcode=yes" $(CARGO_BINARY) build $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features compiler-headless,wasi
endif

build-capi-headless-ios: capi-setup
RUSTFLAGS="${RUSTFLAGS} -C panic=abort" cargo lipo --manifest-path lib/c-api/Cargo.toml --release $(target_dir) \
RUSTFLAGS="${RUSTFLAGS} -C panic=abort" cargo lipo --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features compiler-headless,wasi

#####
Expand Down

0 comments on commit b7c185b

Please sign in to comment.