[vlc-commits] [Git][videolan/vlc][master] 7 commits: contrib: rust: use RUST_ENV to keep the common Rust enviroment variables

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Aug 7 09:56:57 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
2cecac06 by Steve Lhomme at 2024-08-07T09:11:04+00:00
contrib: rust: use RUST_ENV to keep the common Rust enviroment variables

- - - - -
37d4b311 by Steve Lhomme at 2024-08-07T09:11:04+00:00
contrib: rust: don't use local RUST_ENV when using system rustc/cargo

- - - - -
29fdee62 by Steve Lhomme at 2024-08-07T09:11:04+00:00
contrib: rust: remove target from version check

It has no effect on the result. We check before that the target is supported.

- - - - -
c2ead373 by Steve Lhomme at 2024-08-07T09:11:04+00:00
contrib: rav1e: don't build local rustc during vendoring if it's on the system

- - - - -
e1a246da by Steve Lhomme at 2024-08-07T09:11:04+00:00
contrib: rust: don't override RUSTUP_HOME/CARGO_HOME from the system

If the user provided them, we should use them.

- - - - -
8a5b4c38 by Steve Lhomme at 2024-08-07T09:11:04+00:00
CI: update Docker images with rustc/cargo for each triplet we build

- - - - -
66aa9ee8 by Steve Lhomme at 2024-08-07T09:11:04+00:00
tools: don't show untar'ed files in non verbose mode

This avoids being bombarded with logs when building like the 6000 lines of meson.

Similar to 0a555fa1ac6db47923c9db03faa8d49393f571ec for tools.

- - - - -


6 changed files:

- contrib/src/main-rust.mak
- contrib/src/rav1e/rules.mak
- contrib/src/rustc/rules.mak
- contrib/src/rustup/rules.mak
- extras/ci/gitlab-ci.yml
- extras/tools/tools.mak


Changes:

=====================================
contrib/src/main-rust.mak
=====================================
@@ -53,8 +53,10 @@ BUILD_RUST="1"
 endif
 endif
 
-RUSTUP_HOME= $(BUILDBINDIR)/.rustup
-CARGO_HOME = $(BUILDBINDIR)/.cargo
+RUSTUP_HOME?= $(BUILDBINDIR)/.rustup
+CARGO_HOME ?= $(BUILDBINDIR)/.cargo
+
+RUST_ENV = RUSTUP_HOME=$(RUSTUP_HOME) CARGO_HOME=$(CARGO_HOME)
 
 RUSTFLAGS := -C panic=abort
 ifndef WITH_OPTIMIZATION
@@ -75,13 +77,13 @@ CARGO_ENV_NATIVE = TARGET_CC="$(BUILDCC)" TARGET_AR="$(BUILDAR)" TARGET_RANLIB="
 	TARGET_CFLAGS="$(BUILDCFLAGS)"
 
 ifneq ($(call system_tool_majmin, cargo --version),)
-CARGO = RUSTUP_HOME=$(RUSTUP_HOME) CARGO_HOME=$(CARGO_HOME) $(CARGO_ENV) cargo
-CARGO_NATIVE = RUSTUP_HOME=$(RUSTUP_HOME) CARGO_HOME=$(CARGO_HOME) $(CARGO_ENV_NATIVE) cargo
+CARGO = $(RUST_ENV) $(CARGO_ENV) cargo
+CARGO_NATIVE = $(RUST_ENV) $(CARGO_ENV_NATIVE) cargo
 else
 CARGO = . $(CARGO_HOME)/env && \
-        RUSTUP_HOME=$(RUSTUP_HOME) CARGO_HOME=$(CARGO_HOME) $(CARGO_ENV) cargo
+        $(RUST_ENV) $(CARGO_ENV) cargo
 CARGO_NATIVE = . $(CARGO_HOME)/env && \
-        RUSTUP_HOME=$(RUSTUP_HOME) CARGO_HOME=$(CARGO_HOME) $(CARGO_ENV_NATIVE) cargo
+        $(RUST_ENV) $(CARGO_ENV_NATIVE) cargo
 endif
 
 CARGO_INSTALL_ARGS = --target=$(RUST_TARGET) --prefix=$(PREFIX) \


=====================================
contrib/src/rav1e/rules.mak
=====================================
@@ -32,7 +32,10 @@ DEPS_rav1e += vendor-rav1e $(DEPS_vendor-rav1e) cargo-c $(DEPS_cargo-c)
 
 # vendor-rav1e
 
-$(TARBALLS)/rav1e-$(RAV1E_VERSION)-vendor.tar.bz2: .sum-rav1e .rustc
+ifneq ($(call system_tool_matches_min, rustc --version,$(RUST_VERSION_MIN)),)
+$(TARBALLS)/rav1e-$(RAV1E_VERSION)-vendor.tar.bz2: .rustc
+endif
+$(TARBALLS)/rav1e-$(RAV1E_VERSION)-vendor.tar.bz2: .sum-rav1e
 	$(call download_vendor,rav1e-$(RAV1E_VERSION)-vendor.tar.bz2,rav1e,rav1e-$(RAV1E_VERSION).tar.gz)
 
 .sum-vendor-rav1e: rav1e-$(RAV1E_VERSION)-vendor.tar.bz2


=====================================
contrib/src/rustc/rules.mak
=====================================
@@ -11,19 +11,25 @@ PKGS_ALL += rustc-cross
 endif
 
 ifneq ($(call system_tool_version, rustup --version, cat),)
-RUSTUP = RUSTUP_HOME=$(RUSTUP_HOME) CARGO_HOME=$(CARGO_HOME) rustup
+RUSTUP = $(RUST_ENV) rustup
 else
 RUSTUP = . $(CARGO_HOME)/env && \
-         RUSTUP_HOME=$(RUSTUP_HOME) CARGO_HOME=$(CARGO_HOME) rustup
+         $(RUST_ENV) rustup
 endif
 
-ifeq ($(call system_tool_matches_min, echo 'fn main() {}' | rustc --target=$(RUST_HOST) --emit=dep-info - -o /dev/null 2>/dev/null && rustc --target=$(RUST_HOST) --version,$(RUST_VERSION_MIN)),)
+ifeq ($(call system_tool_matches_min, echo 'fn main() {}' | rustc --target=$(RUST_HOST) --emit=dep-info - -o /dev/null 2>/dev/null && rustc --version,$(RUST_VERSION_MIN)),)
 PKGS_FOUND += rustc
+ifndef HAVE_CROSS_COMPILE
+RUST_ENV=
+endif
 else
 DEPS_rustc = rustup $(DEPS_rustup)
 endif
-ifeq ($(call system_tool_matches_min, echo 'fn main() {}' | rustc --target=$(RUST_TARGET) --emit=dep-info - -o /dev/null 2>/dev/null && rustc --target=$(RUST_TARGET) --version,$(RUST_VERSION_MIN)),)
+ifeq ($(call system_tool_matches_min, echo 'fn main() {}' | rustc --target=$(RUST_TARGET) --emit=dep-info - -o /dev/null 2>/dev/null && rustc --version,$(RUST_VERSION_MIN)),)
 PKGS_FOUND += rustc-cross
+ifdef HAVE_CROSS_COMPILE
+RUST_ENV=
+endif
 endif
 
 endif


=====================================
contrib/src/rustup/rules.mak
=====================================
@@ -33,6 +33,6 @@ endif
 
 .rustup: rustup
 	cd $< && RUSTUP_INIT_SKIP_PATH_CHECK=yes \
-	  RUSTUP_HOME=$(RUSTUP_HOME) CARGO_HOME=$(CARGO_HOME) \
+	  $(RUST_ENV) \
 	  ./rustup-init.sh --no-modify-path -y --default-toolchain none
 	touch $@


=====================================
extras/ci/gitlab-ci.yml
=====================================
@@ -20,14 +20,14 @@ default:
 
 variables:
     VLC_TEST_TIMEOUT: 60
-    VLC_WIN64_IMAGE: registry.videolan.org/vlc-debian-win64-posix:20240722111928
-    VLC_WIN_LLVM_MSVCRT_IMAGE: registry.videolan.org/vlc-debian-llvm-msvcrt:20240617101054
-    VLC_WIN_LLVM_UCRT_IMAGE: registry.videolan.org/vlc-debian-llvm-ucrt:20240617101054
+    VLC_WIN64_IMAGE: registry.videolan.org/vlc-debian-win64-posix:20240805192413
+    VLC_WIN_LLVM_MSVCRT_IMAGE: registry.videolan.org/vlc-debian-llvm-msvcrt:20240731083648
+    VLC_WIN_LLVM_UCRT_IMAGE: registry.videolan.org/vlc-debian-llvm-ucrt:20240731083648
     VLC_DEBIAN_IMAGE: registry.videolan.org/vlc-debian-unstable:20240402131352
-    VLC_ANDROID_IMAGE: registry.videolan.org/vlc-debian-android:20240522152555
+    VLC_ANDROID_IMAGE: registry.videolan.org/vlc-debian-android:20240731083648
     VLC_SNAP_IMAGE: registry.videolan.org/vlc-ubuntu-focal:20231013031754
-    VLC_RASPBIAN_IMAGE: registry.videolan.org/vlc-ubuntu-raspberry:20240514145422
-    VLC_WASM_EMSCRIPTEN: registry.videolan.org/vlc-debian-wasm-emscripten:20240522152555
+    VLC_RASPBIAN_IMAGE: registry.videolan.org/vlc-ubuntu-raspberry:20240806085528
+    VLC_WASM_EMSCRIPTEN: registry.videolan.org/vlc-debian-wasm-emscripten:20240731083648
 
 .variables-debian: &variables-debian
         HOST_ARCH: x86_64


=====================================
extras/tools/tools.mak
=====================================
@@ -39,10 +39,14 @@ download_pkg = $(call download,$(VIDEOLAN)/$(2)/$(lastword $(subst /, ,$(@)))) |
 	( $(call download,$(1)) && echo "Please upload this package $(lastword $(subst /, ,$(@))) to our FTP" )  \
 	&& grep $(@) $(TOOLS)/SHA512SUMS| $(SHA512SUM)
 
+ifeq ($(V),1)
+TAR_VERBOSE := v
+endif
+
 UNPACK = $(RM) -R $@ \
-    $(foreach f,$(filter %.tar.gz %.tgz,$^), && tar xvzfo $(f)) \
-    $(foreach f,$(filter %.tar.bz2,$^), && tar xvjfo $(f)) \
-    $(foreach f,$(filter %.tar.xz,$^), && tar xvJfo $(f)) \
+    $(foreach f,$(filter %.tar.gz %.tgz,$^), && tar $(TAR_VERBOSE)xzfo $(f)) \
+    $(foreach f,$(filter %.tar.bz2,$^), && tar $(TAR_VERBOSE)xjfo $(f)) \
+    $(foreach f,$(filter %.tar.xz,$^), && tar $(TAR_VERBOSE)xJfo $(f)) \
     $(foreach f,$(filter %.zip,$^), && unzip $(f))
 
 UNPACK_DIR = $(patsubst %.tar,%,$(basename $(notdir $<)))



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a562fb586cbe75e697034e7bc14cc057635325f6...66aa9ee86f897bcabf0a36cc0b90ec4687a57bfa

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a562fb586cbe75e697034e7bc14cc057635325f6...66aa9ee86f897bcabf0a36cc0b90ec4687a57bfa
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list