Skip to content

Commit

Permalink
Try to always use vendored crates
Browse files Browse the repository at this point in the history
  • Loading branch information
mthh committed Jan 22, 2025
1 parent e24297c commit 8a455f1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 16 deletions.
3 changes: 0 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ echo "using Rust compiler: '${RUSTC_VERSION}'"

if [ "$(uname)" = "Emscripten" ]; then
TARGET="wasm32-unknown-emscripten"
elif [ "${NOT_CRAN}" != "true" ]; then
VENDORING="yes"
fi

# catch DEBUG envvar, which is passed from pkgbuild::compile_dll()
Expand All @@ -44,5 +42,4 @@ fi
sed \
-e "s/@TARGET@/${TARGET}/" \
-e "s/@PROFILE@/${PROFILE}/" \
-e "s|@VENDORING@|${VENDORING}|" \
src/Makevars.in > src/Makevars
5 changes: 0 additions & 5 deletions configure.win
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@ else
PROFILE=release
fi

if [ "${NOT_CRAN}" != "true" ]; then
VENDORING="yes"
fi

sed \
-e "s/@TARGET@/x86_64-pc-windows-gnu/" \
-e "s/@PROFILE@/${PROFILE}/" \
-e "s|@VENDORING@|${VENDORING}|" \
src/Makevars.win.in > src/Makevars.win
7 changes: 3 additions & 4 deletions src/Makevars.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ $(STATLIB):
# to set it here to ensure cargo can be invoked. It is appended to PATH and
# therefore is only used if cargo is absent from the user's PATH.

if [ "$(VENDORING)" = "yes" ]; then \
$(TAR) --extract --xz -f ./rust/vendor.tar.xz -C ./rust && \
# Use vendored crates
$(TAR) --extract --xz -f ./rust/vendor.tar.xz -C ./rust && \
mkdir -p ./rust/.cargo && \
cp ./cargo_vendor_config.toml ./rust/.cargo/config.toml; \
fi
cp ./cargo_vendor_config.toml ./rust/.cargo/config.toml

export PATH="$(PATH):$(HOME)/.cargo/bin" && \
export CC="$(CC)" && \
Expand Down
8 changes: 4 additions & 4 deletions src/Makevars.win.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ $(STATLIB):
# in actual, but we need this tweak to please the compiler.
mkdir -p $(LIBDIR)/libgcc_mock && touch $(LIBDIR)/libgcc_mock/libgcc_eh.a

if [ "$(VENDORING)" = "yes" ]; then \
$(TAR) --extract --xz -f ./rust/vendor.tar.xz -C ./rust && \

# Use vendored crates
$(TAR) --extract --xz -f ./rust/vendor.tar.xz -C ./rust && \
mkdir -p ./rust/.cargo && \
cp ./cargo_vendor_config.toml ./rust/.cargo/config.toml; \
fi
cp ./cargo_vendor_config.toml ./rust/.cargo/config.toml

export CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER="$(CARGO_LINKER)" && \
export LIBRARY_PATH="$${LIBRARY_PATH};$(LIBDIR)/libgcc_mock" && \
Expand Down

0 comments on commit 8a455f1

Please sign in to comment.