Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] combine rust and cargo templates
@ 2022-03-31  1:04 classabbyamp
  2022-03-31  1:05 ` [PR PATCH] [Updated] " classabbyamp
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: classabbyamp @ 2022-03-31  1:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1652 bytes --]

There is a new pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages rust-unified
https://github.com/void-linux/void-packages/pull/36426

combine rust and cargo templates
<!-- Uncomment relevant sections and delete options which are not applicable -->

@q66, wanted to get your opinion on these changes before I go further. I did my best to fold the `cargo{,-bootstrap}` templates into the `rust{,-bootstrap}` ones, preserving all patches and fixes. Tested successfully with a cross build x86_64 to aarch64. If this looks fine, I can continute working on doing some cleanups and update to 1.59 (although there is a PR for that already).

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

[skip ci]

A patch file from https://github.com/void-linux/void-packages/pull/36426.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-rust-unified-36426.patch --]
[-- Type: text/x-diff, Size: 15706 bytes --]

From ac4af73eca05a9a9e52e3affbc54e6c479f99378 Mon Sep 17 00:00:00 2001
From: classabbyamp <dev@kb6.ee>
Date: Wed, 30 Mar 2022 20:57:20 -0400
Subject: [PATCH 1/2] cargo-bootstrap: merge into rust-bootstrap template

---
 srcpkgs/cargo-bootstrap          |  1 +
 srcpkgs/cargo-bootstrap/template | 60 --------------------------------
 srcpkgs/rust-bootstrap/template  | 59 +++++++++++++++++++++++--------
 3 files changed, 45 insertions(+), 75 deletions(-)
 create mode 120000 srcpkgs/cargo-bootstrap
 delete mode 100644 srcpkgs/cargo-bootstrap/template

diff --git a/srcpkgs/cargo-bootstrap b/srcpkgs/cargo-bootstrap
new file mode 120000
index 000000000000..e14ce94c4598
--- /dev/null
+++ b/srcpkgs/cargo-bootstrap
@@ -0,0 +1 @@
+rust-bootstrap
\ No newline at end of file
diff --git a/srcpkgs/cargo-bootstrap/template b/srcpkgs/cargo-bootstrap/template
deleted file mode 100644
index e75f8763b5b8..000000000000
--- a/srcpkgs/cargo-bootstrap/template
+++ /dev/null
@@ -1,60 +0,0 @@
-# Template file for 'cargo-bootstrap'
-pkgname=cargo-bootstrap
-version=0.58.0
-revision=1
-short_desc="Bootstrap binaries of Rust package manager"
-maintainer="q66 <daniel@octaforge.org>"
-license="MIT, Apache-2.0"
-homepage="https://www.rust-lang.org/"
-conflicts="cargo>=0"
-lib32disabled=yes
-nostrip=yes
-
-_bootstrap_url="https://static.rust-lang.org/dist"
-_bootver=1.57.0
-
-# we don't use upstream cargo binaries for ppc32, as they are busted (probably
-# a dependency is wrong, which results in failed signature verification when
-# updating the crates.io index)
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|i686|ppc64le) ;;
-	*)
-		_bootstrap_url="https://alpha.de.repo.voidlinux.org/distfiles"
-		_bootver=${version}
-		;;
-esac
-
-wrksrc="cargo-${_bootver}-${RUST_TARGET}"
-distfiles="${_bootstrap_url}/cargo-${_bootver}-${RUST_TARGET}.tar.xz"
-
-case "$XBPS_TARGET_MACHINE" in
-	i686)
-		checksum="9898a1fae2647f930fa14b9c160a1d22e67ccc70ac0d2d8f79ef1ffcf8d89af7"
-		;;
-	x86_64)
-		checksum="ed2013713ae742895af5df8d91c5430ba9ba3c781e3bc7f3471b220cc06d565d"
-		;;
-	x86_64-musl)
-		checksum="0d8564d0348843d6c08d98990d9eac50b7b7ab790f89d514b4f45079e786d932"
-		;;
-	ppc64le)
-		checksum="599cf1b5a8cdbf76d591621bc9222aefa60e2f5fd378ae71c4dcf4514c47122e"
-		;;
-	ppc64le-musl)
-		checksum="99ae7661c62617ac42adacb50cce9ae8d019bcf85e987b98fbc27240bceb1dd9"
-		;;
-	ppc64)
-		checksum="c64b9cce7a3ceaf5c310fad70be33077f1e6dea1384767fcf744732c0daa7473"
-		;;
-	ppc)
-		checksum="e67c2a7d16b3c732a1dcb663d031daf6eaca4b74d1d15196086c53c0c3a5b0a2"
-		;;
-	*) broken="cargo bootstrap binaries unavailable for ${XBPS_MACHINE}";;
-esac
-
-do_install() {
-	vbin cargo/bin/cargo
-	vlicense LICENSE-APACHE
-	vlicense LICENSE-MIT
-	vlicense LICENSE-THIRD-PARTY
-}
diff --git a/srcpkgs/rust-bootstrap/template b/srcpkgs/rust-bootstrap/template
index bbedb66430b6..6111d1ea974a 100644
--- a/srcpkgs/rust-bootstrap/template
+++ b/srcpkgs/rust-bootstrap/template
@@ -1,7 +1,7 @@
 # Template file for 'rust-bootstrap'
 pkgname=rust-bootstrap
 version=1.57.0
-revision=1
+revision=2
 create_wrksrc=yes
 short_desc="Rust programming language bootstrap toolchain"
 maintainer="q66 <daniel@octaforge.org>"
@@ -15,58 +15,74 @@ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	depends="libexecinfo-devel"
 fi
 
-_bootstrap_url="https://static.rust-lang.org/dist"
-
 case "$XBPS_MACHINE" in
-	x86_64*|i686|ppc64le|ppc) ;;
-	*) _bootstrap_url="https://alpha.de.repo.voidlinux.org/distfiles";;
+	x86_64*|i686|ppc64le|ppc) _bootstrap_url="https://static.rust-lang.org/dist" ;;
+	*) _bootstrap_url="https://alpha.de.repo.voidlinux.org/distfiles" ;;
 esac
 
+# we don't use upstream cargo binaries for ppc32, as they are busted (probably
+# a dependency is wrong, which results in failed signature verification when
+# updating the crates.io index)
+if [ "$XBPS_MACHINE" = "ppc" ]; then
+	_cargo_bootstrap_url="https://alpha.de.repo.voidlinux.org/distfiles"
+else
+	_cargo_bootstrap_url="$_bootstrap_url"
+fi
+
 distfiles="
  ${_bootstrap_url}/rustc-${version}-${RUST_TARGET}.tar.xz
- ${_bootstrap_url}/rust-std-${version}-${RUST_TARGET}.tar.xz"
+ ${_bootstrap_url}/rust-std-${version}-${RUST_TARGET}.tar.xz
+ ${_cargo_bootstrap_url}/cargo-${version}-${RUST_TARGET}.tar.xz"
 
 case "$XBPS_TARGET_MACHINE" in
 	i686)
 		checksum="
 		 9bade3fcd246b0ad6859fcf5d0a80d3eb833e5410efa3a5552c241865562461e
-		 586e7fd521a058cbf4778abb67d7d078dd4820d356351d0b6a719e21d00966db"
+		 586e7fd521a058cbf4778abb67d7d078dd4820d356351d0b6a719e21d00966db
+		 9898a1fae2647f930fa14b9c160a1d22e67ccc70ac0d2d8f79ef1ffcf8d89af7"
 		;;
 	x86_64)
 		checksum="
 		 c42f40c5279a3a9d539cae93dbcab9d333777ad9a60a5b9f1086b874ef63db86
-		 ccdc72d06c90841b7227ec3630337881eeda3da5fbe87328d2e9d705f6f8016c"
+		 ccdc72d06c90841b7227ec3630337881eeda3da5fbe87328d2e9d705f6f8016c
+		 ed2013713ae742895af5df8d91c5430ba9ba3c781e3bc7f3471b220cc06d565d"
 		;;
 	x86_64-musl)
 		checksum="
 		 5b04e0e0bbf140f7c49baa6280114c28f59f6de50481bdd45074eebf629c174c
-		 818213a6444503ed6adf0231d3c71de990d4c26926c62e8c602bb7e2d636fb94"
+		 818213a6444503ed6adf0231d3c71de990d4c26926c62e8c602bb7e2d636fb94
+		 0d8564d0348843d6c08d98990d9eac50b7b7ab790f89d514b4f45079e786d932"
 		;;
 	ppc64le)
 		checksum="
 		 f43cb99109c3438c77c7079cdce4673df3320e310158e0b4d949c1babc4300fc
-		 fc07eb3e9f3d227428cc5b53ca868e3de375bc198ce4dce7b87a9246e6fec81a"
+		 fc07eb3e9f3d227428cc5b53ca868e3de375bc198ce4dce7b87a9246e6fec81a
+		 599cf1b5a8cdbf76d591621bc9222aefa60e2f5fd378ae71c4dcf4514c47122e"
 		;;
 	ppc64le-musl)
 		checksum="
 		 6b48e521ba8a070a7b992595e82c5a164cc01c93bbd9a7b3d4db362f4b060df8
-		 d7876e817fc95df2e81858fc9ddb95b10fb83b413277ea6dbdfa9a80fa0d990e"
+		 d7876e817fc95df2e81858fc9ddb95b10fb83b413277ea6dbdfa9a80fa0d990e
+		 99ae7661c62617ac42adacb50cce9ae8d019bcf85e987b98fbc27240bceb1dd9"
 		;;
 	ppc64)
 		checksum="
 		 2ea5b66d2cd8b9c251590fd5bd3e23cedec658b61f541e2824ce3fdcda263982
-		 e9c1394771b1b24241d8938ad75c4a6ed8bfa043522c74767b3528f2289095c0"
+		 e9c1394771b1b24241d8938ad75c4a6ed8bfa043522c74767b3528f2289095c0
+		 c64b9cce7a3ceaf5c310fad70be33077f1e6dea1384767fcf744732c0daa7473"
 		;;
 	ppc)
 		checksum="
 		 a1d7611b2d39224ba9a915009ae2a6639def42767370f50effd57770b3eb2150
-		 bc117ce5f0c81d2e14ea2d1832c0e908b1153caf49f295a9d28af2128f5fae44"
+		 bc117ce5f0c81d2e14ea2d1832c0e908b1153caf49f295a9d28af2128f5fae44
+		 e67c2a7d16b3c732a1dcb663d031daf6eaca4b74d1d15196086c53c0c3a5b0a2"
 		;;
-	*) broken="rust bootstrap binaries unavailable for ${XBPS_MACHINE}";;
+	*) broken="rust/cargo bootstrap binaries unavailable for ${XBPS_MACHINE}";;
 esac
 
+
 do_install() {
-	for d in *; do
+	for d in rust*; do
 		cd $d
 		./install.sh --prefix=/usr --destdir="${DESTDIR}"
 		cd ..
@@ -78,3 +94,16 @@ do_install() {
 
 	rm -f ${DESTDIR}/usr/lib/rustlib/${RUST_TARGET}/bin/rust-ll*
 }
+
+cargo-bootstrap_package() {
+	short_desc="Bootstrap binaries of Rust package manager"
+	conflicts="cargo>=0"
+	lib32disabled=yes
+	nostrip=yes
+	pkg_install() {
+		cd cargo-${version}-${RUST_TARGET}
+		./install.sh --prefix=/usr --destdir="${PKGDESTDIR}"
+		cd ..
+		rm -rf ${PKGDESTDIR}/usr/lib/rustlib/
+	}
+}

From 8b91641022f719de3ed6d3b81fd65ae19236400e Mon Sep 17 00:00:00 2001
From: classabbyamp <dev@kb6.ee>
Date: Wed, 30 Mar 2022 20:58:25 -0400
Subject: [PATCH 2/2] cargo: merge into rust template

---
 srcpkgs/cargo                                 |  1 +
 srcpkgs/cargo/template                        | 90 -------------------
 .../patches/crossbeam-ppcle.patch             |  4 +-
 .../{cargo => rust}/patches/link-static.patch |  4 +-
 srcpkgs/rust/template                         | 50 ++++++++++-
 5 files changed, 51 insertions(+), 98 deletions(-)
 create mode 120000 srcpkgs/cargo
 delete mode 100644 srcpkgs/cargo/template
 rename srcpkgs/{cargo => rust}/patches/crossbeam-ppcle.patch (79%)
 rename srcpkgs/{cargo => rust}/patches/link-static.patch (56%)

diff --git a/srcpkgs/cargo b/srcpkgs/cargo
new file mode 120000
index 000000000000..6ef8575b5fa4
--- /dev/null
+++ b/srcpkgs/cargo
@@ -0,0 +1 @@
+rust
\ No newline at end of file
diff --git a/srcpkgs/cargo/template b/srcpkgs/cargo/template
deleted file mode 100644
index c512e7005833..000000000000
--- a/srcpkgs/cargo/template
+++ /dev/null
@@ -1,90 +0,0 @@
-# Template file for 'cargo'
-pkgname=cargo
-version=0.58.0
-revision=1
-wrksrc="cargo-${version}"
-build_helper=rust
-hostmakedepends="cargo-bootstrap rust python3 curl cmake pkg-config zlib-devel"
-makedepends="rust libcurl-devel openssl-devel"
-depends="rust"
-short_desc="Rust package manager"
-maintainer="Enno Boland <gottox@voidlinux.org>"
-license="MIT, Apache-2.0"
-homepage="https://crates.io/"
-distfiles="https://github.com/rust-lang/cargo/archive/${version}.tar.gz
- https://github.com/crossbeam-rs/crossbeam/archive/refs/tags/crossbeam-utils-0.8.5.tar.gz"
-checksum="e1d6f55414a29906d24b13c687996b5220e08ccce9c682e4c02851138fc7093f
- 57db07eb38b0aaf7951c79b4639819cb84bc4269507091afea7267e10a54e079"
-replaces="cargo-tree>=0"
-
-build_options="static bindist"
-desc_option_bindist="Generate a tarball for bootstrap"
-
-if [ -n "$build_option_static" -o -n "$build_option_bindist" ]; then
-	_build_static=yes
-fi
-
-if [ -z "$_build_static" ]; then
-	makedepends+=" libgit2-devel"
-fi
-
-post_extract() {
-	mv ../crossbeam-* crossbeam-utils
-}
-
-post_patch() {
-	rm crossbeam-utils/crossbeam-utils/no_atomic.rs
-	cp crossbeam-utils/no_atomic.rs crossbeam-utils/crossbeam-utils
-
-	cat >> Cargo.toml <<- EOF
-		[patch.crates-io]
-		crossbeam-utils = { path = './crossbeam-utils/crossbeam-utils' }
-	EOF
-}
-
-do_build() {
-	local cargs
-
-	if [ -n "$_build_static" ]; then
-		unset LIBSSH2_SYS_USE_PKG_CONFIG
-		export OPENSSL_STATIC=1
-		# rust-openssl can not be linked static if pkg-config is used
-		export OPENSSL_NO_PKG_CONFIG
-		export OPENSSL_DIR="${XBPS_CROSS_BASE}/usr"
-	fi
-
-	if [ -n "$_build_static" ]; then
-		cargs+=" --features=all-static"
-	fi
-
-	cargo build --release ${cargs}
-}
-
-do_install() {
-	local cbin="target/release/cargo"
-	if [ "$CROSS_BUILD" ]; then
-		cbin="target/${RUST_TARGET}/release/cargo"
-	fi
-
-	if [ "$build_option_bindist" ]; then
-		local dest="cargo-${version}-${RUST_TARGET}"
-		mkdir -p ${XBPS_SRCDISTDIR}/distfiles ${dest}/cargo/bin
-		install -m 0755 ${cbin} ${dest}/cargo/bin
-		install -m 0644 LICENSE-APACHE LICENSE-MIT LICENSE-THIRD-PARTY ${dest}
-		bsdtar cvJf ${dest}.tar.xz ${dest}
-		install -m 0644 ${dest}.tar.xz ${XBPS_SRCDISTDIR}/distfiles
-		exit 1
-	fi
-
-	vbin ${cbin}
-	for f in src/etc/man/*.?; do
-		vman $f
-	done
-	vinstall src/etc/cargo.bashcomp.sh 0644 \
-	 usr/share/bash-completion/completions cargo
-	vinstall src/etc/_cargo 0644 usr/share/zsh/site-functions
-
-	vlicense LICENSE-APACHE
-	vlicense LICENSE-MIT
-	vlicense LICENSE-THIRD-PARTY
-}
diff --git a/srcpkgs/cargo/patches/crossbeam-ppcle.patch b/srcpkgs/rust/patches/crossbeam-ppcle.patch
similarity index 79%
rename from srcpkgs/cargo/patches/crossbeam-ppcle.patch
rename to srcpkgs/rust/patches/crossbeam-ppcle.patch
index 36d9256e1071..c2d445f74809 100644
--- a/srcpkgs/cargo/patches/crossbeam-ppcle.patch
+++ b/srcpkgs/rust/patches/crossbeam-ppcle.patch
@@ -1,5 +1,5 @@
---- a/crossbeam-utils/no_atomic.rs
-+++ b/crossbeam-utils/no_atomic.rs
+--- a/vendor/crossbeam-utils/no_atomic.rs
++++ b/vendor/crossbeam-utils/no_atomic.rs
 @@ -33,6 +33,8 @@ const NO_ATOMIC_64: &[&str] = &[
      "powerpc-unknown-linux-gnu",
      "powerpc-unknown-linux-gnuspe",
diff --git a/srcpkgs/cargo/patches/link-static.patch b/srcpkgs/rust/patches/link-static.patch
similarity index 56%
rename from srcpkgs/cargo/patches/link-static.patch
rename to srcpkgs/rust/patches/link-static.patch
index 6f38b77ce95c..536db7110379 100644
--- a/srcpkgs/cargo/patches/link-static.patch
+++ b/srcpkgs/rust/patches/link-static.patch
@@ -1,5 +1,5 @@
---- a/Cargo.toml	2019-01-02 22:49:06.000000000 +0100
-+++ b/Cargo.toml	2019-02-13 15:12:44.616810828 +0100
+--- a/src/tools/cargo/Cargo.toml	2019-01-02 22:49:06.000000000 +0100
++++ b/src/tools/cargo/Cargo.toml	2019-02-13 15:12:44.616810828 +0100
 @@ -116,3 +116,5 @@ doc = false
  deny-warnings = []
  vendored-openssl = ["openssl/vendored"]
diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index 560a629f3da2..1c95a5ef37f3 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -9,10 +9,11 @@
 #
 pkgname=rust
 version=1.57.0
-revision=1
+revision=2
 wrksrc="rustc-${version}-src"
 hostmakedepends="cmake curl pkg-config python3 tar cargo-bootstrap"
-makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm12"
+makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel openssl-devel llvm12
+ libcurl-devel"
 depends="rust-std"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -26,6 +27,10 @@ make_check=no # CBA for now
 build_options="bindist"
 desc_option_bindist="Generate tarballs for bootstrap"
 
+if [ -n "$build_option_bindist" ]; then
+	makedepends+=" libgit2-devel"
+fi
+
 if [ "$XBPS_LIBC" = "musl" ]; then
 	hostmakedepends+=" libexecinfo-devel"
 fi
@@ -64,6 +69,7 @@ post_patch() {
 	_clear_vendor_checksums rustc-ap-rustc_target
 	_clear_vendor_checksums target-lexicon
 	_clear_vendor_checksums tikv-jemallocator
+	_clear_vendor_checksums libz-sys
 }
 
 do_configure() {
@@ -112,9 +118,9 @@ do_configure() {
 		vendor = true
 		full-bootstrap = false
 		local-rebuild = ${_local_rebuild}
-		extended = false
+		extended = true
 		docs = ${_use_docs}
-		tools = []
+		tools = ["cargo"]
 		[install]
 		prefix = "/usr"
 		[rust]
@@ -163,6 +169,15 @@ do_configure() {
 # for it during stage1. Otherwise it attemps to use CFLAGS, which are the CFLAGS
 # of the cross host.
 do_build() {
+	if [ -n "$build_option_bindist" ]; then
+		unset LIBSSH2_SYS_USE_PKG_CONFIG
+		export OPENSSL_STATIC=1
+		# rust-openssl can not be linked static if pkg-config is used
+		export OPENSSL_NO_PKG_CONFIG
+		export OPENSSL_DIR="${XBPS_CROSS_BASE}/usr"
+		echo 'default = ["all-static"]' >> src/tools/cargo/Cargo.toml
+	fi
+
 	export RUST_BACKTRACE=1
 	export CARGO_HOME="$wrksrc/.cargo"
 	export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
@@ -196,6 +211,7 @@ do_install() {
 		install -m 0644 \
 			build/dist/rustc-${version}-${RUST_TARGET}.tar.xz \
 			build/dist/rust-std-${version}-${RUST_TARGET}.tar.xz \
+			build/dist/cargo-${version}-${RUST_TARGET}.tar.xz \
 			${XBPS_SRCDISTDIR}/distfiles
 		exit 1
 	fi
@@ -209,6 +225,9 @@ do_install() {
 	 -C "$DESTDIR/usr/lib" --strip-components=3 --exclude=manifest.in
 	tar xf build/dist/rust-docs-${version}-${RUST_TARGET}.tar.gz \
 	 -C "$DESTDIR/usr" --strip-components=2 --exclude=manifest.in
+	tar xf build/dist/cargo-${version}-${RUST_TARGET}.tar.gz \
+	 -C "$DESTDIR/usr" --strip-components=2 --exclude=manifest.in \
+	 cargo-${version}-${RUST_TARGET}/cargo/bin cargo-${version}-${RUST_TARGET}/cargo/libexec
 
 	vlicense COPYRIGHT
 	vlicense LICENSE-APACHE
@@ -234,6 +253,7 @@ rust-doc_package() {
 }
 
 rust-std_package() {
+	lib32disabled=yes
 	short_desc+=" - standard library"
 	if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 		depends="libexecinfo-devel"
@@ -242,3 +262,25 @@ rust-std_package() {
 		vmove usr/lib/rustlib
 	}
 }
+
+cargo_package() {
+	short_desc="Rust package manager"
+	depends="rust"
+	pkg_install() {
+		vmove usr/bin/cargo
+		vmove usr/libexec/cargo-credential-1password
+
+		_cargo_src="src/tools/cargo"
+
+		vcompletion $_cargo_src/src/etc/_cargo zsh
+		vcompletion $_cargo_src/src/etc/cargo.bashcomp.sh bash
+
+		for f in $_cargo_src/src/etc/man/*.?; do
+			vman $f
+		done
+
+		vlicense $_cargo_src/LICENSE-APACHE
+		vlicense $_cargo_src/LICENSE-MIT
+		vlicense $_cargo_src/LICENSE-THIRD-PARTY
+	}
+}

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR PATCH] [Updated] combine rust and cargo templates
  2022-03-31  1:04 [PR PATCH] combine rust and cargo templates classabbyamp
@ 2022-03-31  1:05 ` classabbyamp
  2022-03-31  3:42 ` q66
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: classabbyamp @ 2022-03-31  1:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1657 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages rust-unified
https://github.com/void-linux/void-packages/pull/36426

combine rust and cargo templates
<!-- Uncomment relevant sections and delete options which are not applicable -->

@q66, wanted to get your opinion on these changes before I go further. I did my best to fold the `cargo{,-bootstrap}` templates into the `rust{,-bootstrap}` ones, preserving all patches and fixes. Tested successfully with a cross build x86_64 to aarch64. If this looks fine, I can continute working on doing some cleanups and update to 1.59 (although there is a PR for that already).

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/36426.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-rust-unified-36426.patch --]
[-- Type: text/x-diff, Size: 15706 bytes --]

From ac4af73eca05a9a9e52e3affbc54e6c479f99378 Mon Sep 17 00:00:00 2001
From: classabbyamp <dev@kb6.ee>
Date: Wed, 30 Mar 2022 20:57:20 -0400
Subject: [PATCH 1/2] cargo-bootstrap: merge into rust-bootstrap template

---
 srcpkgs/cargo-bootstrap          |  1 +
 srcpkgs/cargo-bootstrap/template | 60 --------------------------------
 srcpkgs/rust-bootstrap/template  | 59 +++++++++++++++++++++++--------
 3 files changed, 45 insertions(+), 75 deletions(-)
 create mode 120000 srcpkgs/cargo-bootstrap
 delete mode 100644 srcpkgs/cargo-bootstrap/template

diff --git a/srcpkgs/cargo-bootstrap b/srcpkgs/cargo-bootstrap
new file mode 120000
index 000000000000..e14ce94c4598
--- /dev/null
+++ b/srcpkgs/cargo-bootstrap
@@ -0,0 +1 @@
+rust-bootstrap
\ No newline at end of file
diff --git a/srcpkgs/cargo-bootstrap/template b/srcpkgs/cargo-bootstrap/template
deleted file mode 100644
index e75f8763b5b8..000000000000
--- a/srcpkgs/cargo-bootstrap/template
+++ /dev/null
@@ -1,60 +0,0 @@
-# Template file for 'cargo-bootstrap'
-pkgname=cargo-bootstrap
-version=0.58.0
-revision=1
-short_desc="Bootstrap binaries of Rust package manager"
-maintainer="q66 <daniel@octaforge.org>"
-license="MIT, Apache-2.0"
-homepage="https://www.rust-lang.org/"
-conflicts="cargo>=0"
-lib32disabled=yes
-nostrip=yes
-
-_bootstrap_url="https://static.rust-lang.org/dist"
-_bootver=1.57.0
-
-# we don't use upstream cargo binaries for ppc32, as they are busted (probably
-# a dependency is wrong, which results in failed signature verification when
-# updating the crates.io index)
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|i686|ppc64le) ;;
-	*)
-		_bootstrap_url="https://alpha.de.repo.voidlinux.org/distfiles"
-		_bootver=${version}
-		;;
-esac
-
-wrksrc="cargo-${_bootver}-${RUST_TARGET}"
-distfiles="${_bootstrap_url}/cargo-${_bootver}-${RUST_TARGET}.tar.xz"
-
-case "$XBPS_TARGET_MACHINE" in
-	i686)
-		checksum="9898a1fae2647f930fa14b9c160a1d22e67ccc70ac0d2d8f79ef1ffcf8d89af7"
-		;;
-	x86_64)
-		checksum="ed2013713ae742895af5df8d91c5430ba9ba3c781e3bc7f3471b220cc06d565d"
-		;;
-	x86_64-musl)
-		checksum="0d8564d0348843d6c08d98990d9eac50b7b7ab790f89d514b4f45079e786d932"
-		;;
-	ppc64le)
-		checksum="599cf1b5a8cdbf76d591621bc9222aefa60e2f5fd378ae71c4dcf4514c47122e"
-		;;
-	ppc64le-musl)
-		checksum="99ae7661c62617ac42adacb50cce9ae8d019bcf85e987b98fbc27240bceb1dd9"
-		;;
-	ppc64)
-		checksum="c64b9cce7a3ceaf5c310fad70be33077f1e6dea1384767fcf744732c0daa7473"
-		;;
-	ppc)
-		checksum="e67c2a7d16b3c732a1dcb663d031daf6eaca4b74d1d15196086c53c0c3a5b0a2"
-		;;
-	*) broken="cargo bootstrap binaries unavailable for ${XBPS_MACHINE}";;
-esac
-
-do_install() {
-	vbin cargo/bin/cargo
-	vlicense LICENSE-APACHE
-	vlicense LICENSE-MIT
-	vlicense LICENSE-THIRD-PARTY
-}
diff --git a/srcpkgs/rust-bootstrap/template b/srcpkgs/rust-bootstrap/template
index bbedb66430b6..6111d1ea974a 100644
--- a/srcpkgs/rust-bootstrap/template
+++ b/srcpkgs/rust-bootstrap/template
@@ -1,7 +1,7 @@
 # Template file for 'rust-bootstrap'
 pkgname=rust-bootstrap
 version=1.57.0
-revision=1
+revision=2
 create_wrksrc=yes
 short_desc="Rust programming language bootstrap toolchain"
 maintainer="q66 <daniel@octaforge.org>"
@@ -15,58 +15,74 @@ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	depends="libexecinfo-devel"
 fi
 
-_bootstrap_url="https://static.rust-lang.org/dist"
-
 case "$XBPS_MACHINE" in
-	x86_64*|i686|ppc64le|ppc) ;;
-	*) _bootstrap_url="https://alpha.de.repo.voidlinux.org/distfiles";;
+	x86_64*|i686|ppc64le|ppc) _bootstrap_url="https://static.rust-lang.org/dist" ;;
+	*) _bootstrap_url="https://alpha.de.repo.voidlinux.org/distfiles" ;;
 esac
 
+# we don't use upstream cargo binaries for ppc32, as they are busted (probably
+# a dependency is wrong, which results in failed signature verification when
+# updating the crates.io index)
+if [ "$XBPS_MACHINE" = "ppc" ]; then
+	_cargo_bootstrap_url="https://alpha.de.repo.voidlinux.org/distfiles"
+else
+	_cargo_bootstrap_url="$_bootstrap_url"
+fi
+
 distfiles="
  ${_bootstrap_url}/rustc-${version}-${RUST_TARGET}.tar.xz
- ${_bootstrap_url}/rust-std-${version}-${RUST_TARGET}.tar.xz"
+ ${_bootstrap_url}/rust-std-${version}-${RUST_TARGET}.tar.xz
+ ${_cargo_bootstrap_url}/cargo-${version}-${RUST_TARGET}.tar.xz"
 
 case "$XBPS_TARGET_MACHINE" in
 	i686)
 		checksum="
 		 9bade3fcd246b0ad6859fcf5d0a80d3eb833e5410efa3a5552c241865562461e
-		 586e7fd521a058cbf4778abb67d7d078dd4820d356351d0b6a719e21d00966db"
+		 586e7fd521a058cbf4778abb67d7d078dd4820d356351d0b6a719e21d00966db
+		 9898a1fae2647f930fa14b9c160a1d22e67ccc70ac0d2d8f79ef1ffcf8d89af7"
 		;;
 	x86_64)
 		checksum="
 		 c42f40c5279a3a9d539cae93dbcab9d333777ad9a60a5b9f1086b874ef63db86
-		 ccdc72d06c90841b7227ec3630337881eeda3da5fbe87328d2e9d705f6f8016c"
+		 ccdc72d06c90841b7227ec3630337881eeda3da5fbe87328d2e9d705f6f8016c
+		 ed2013713ae742895af5df8d91c5430ba9ba3c781e3bc7f3471b220cc06d565d"
 		;;
 	x86_64-musl)
 		checksum="
 		 5b04e0e0bbf140f7c49baa6280114c28f59f6de50481bdd45074eebf629c174c
-		 818213a6444503ed6adf0231d3c71de990d4c26926c62e8c602bb7e2d636fb94"
+		 818213a6444503ed6adf0231d3c71de990d4c26926c62e8c602bb7e2d636fb94
+		 0d8564d0348843d6c08d98990d9eac50b7b7ab790f89d514b4f45079e786d932"
 		;;
 	ppc64le)
 		checksum="
 		 f43cb99109c3438c77c7079cdce4673df3320e310158e0b4d949c1babc4300fc
-		 fc07eb3e9f3d227428cc5b53ca868e3de375bc198ce4dce7b87a9246e6fec81a"
+		 fc07eb3e9f3d227428cc5b53ca868e3de375bc198ce4dce7b87a9246e6fec81a
+		 599cf1b5a8cdbf76d591621bc9222aefa60e2f5fd378ae71c4dcf4514c47122e"
 		;;
 	ppc64le-musl)
 		checksum="
 		 6b48e521ba8a070a7b992595e82c5a164cc01c93bbd9a7b3d4db362f4b060df8
-		 d7876e817fc95df2e81858fc9ddb95b10fb83b413277ea6dbdfa9a80fa0d990e"
+		 d7876e817fc95df2e81858fc9ddb95b10fb83b413277ea6dbdfa9a80fa0d990e
+		 99ae7661c62617ac42adacb50cce9ae8d019bcf85e987b98fbc27240bceb1dd9"
 		;;
 	ppc64)
 		checksum="
 		 2ea5b66d2cd8b9c251590fd5bd3e23cedec658b61f541e2824ce3fdcda263982
-		 e9c1394771b1b24241d8938ad75c4a6ed8bfa043522c74767b3528f2289095c0"
+		 e9c1394771b1b24241d8938ad75c4a6ed8bfa043522c74767b3528f2289095c0
+		 c64b9cce7a3ceaf5c310fad70be33077f1e6dea1384767fcf744732c0daa7473"
 		;;
 	ppc)
 		checksum="
 		 a1d7611b2d39224ba9a915009ae2a6639def42767370f50effd57770b3eb2150
-		 bc117ce5f0c81d2e14ea2d1832c0e908b1153caf49f295a9d28af2128f5fae44"
+		 bc117ce5f0c81d2e14ea2d1832c0e908b1153caf49f295a9d28af2128f5fae44
+		 e67c2a7d16b3c732a1dcb663d031daf6eaca4b74d1d15196086c53c0c3a5b0a2"
 		;;
-	*) broken="rust bootstrap binaries unavailable for ${XBPS_MACHINE}";;
+	*) broken="rust/cargo bootstrap binaries unavailable for ${XBPS_MACHINE}";;
 esac
 
+
 do_install() {
-	for d in *; do
+	for d in rust*; do
 		cd $d
 		./install.sh --prefix=/usr --destdir="${DESTDIR}"
 		cd ..
@@ -78,3 +94,16 @@ do_install() {
 
 	rm -f ${DESTDIR}/usr/lib/rustlib/${RUST_TARGET}/bin/rust-ll*
 }
+
+cargo-bootstrap_package() {
+	short_desc="Bootstrap binaries of Rust package manager"
+	conflicts="cargo>=0"
+	lib32disabled=yes
+	nostrip=yes
+	pkg_install() {
+		cd cargo-${version}-${RUST_TARGET}
+		./install.sh --prefix=/usr --destdir="${PKGDESTDIR}"
+		cd ..
+		rm -rf ${PKGDESTDIR}/usr/lib/rustlib/
+	}
+}

From c28efc2d2f63192d1a53cd2314b7fd72e8e9c74a Mon Sep 17 00:00:00 2001
From: classabbyamp <dev@kb6.ee>
Date: Wed, 30 Mar 2022 20:58:25 -0400
Subject: [PATCH 2/2] cargo: merge into rust template

---
 srcpkgs/cargo                                 |  1 +
 srcpkgs/cargo/template                        | 90 -------------------
 .../patches/crossbeam-ppcle.patch             |  4 +-
 .../{cargo => rust}/patches/link-static.patch |  4 +-
 srcpkgs/rust/template                         | 50 ++++++++++-
 5 files changed, 51 insertions(+), 98 deletions(-)
 create mode 120000 srcpkgs/cargo
 delete mode 100644 srcpkgs/cargo/template
 rename srcpkgs/{cargo => rust}/patches/crossbeam-ppcle.patch (79%)
 rename srcpkgs/{cargo => rust}/patches/link-static.patch (56%)

diff --git a/srcpkgs/cargo b/srcpkgs/cargo
new file mode 120000
index 000000000000..6ef8575b5fa4
--- /dev/null
+++ b/srcpkgs/cargo
@@ -0,0 +1 @@
+rust
\ No newline at end of file
diff --git a/srcpkgs/cargo/template b/srcpkgs/cargo/template
deleted file mode 100644
index c512e7005833..000000000000
--- a/srcpkgs/cargo/template
+++ /dev/null
@@ -1,90 +0,0 @@
-# Template file for 'cargo'
-pkgname=cargo
-version=0.58.0
-revision=1
-wrksrc="cargo-${version}"
-build_helper=rust
-hostmakedepends="cargo-bootstrap rust python3 curl cmake pkg-config zlib-devel"
-makedepends="rust libcurl-devel openssl-devel"
-depends="rust"
-short_desc="Rust package manager"
-maintainer="Enno Boland <gottox@voidlinux.org>"
-license="MIT, Apache-2.0"
-homepage="https://crates.io/"
-distfiles="https://github.com/rust-lang/cargo/archive/${version}.tar.gz
- https://github.com/crossbeam-rs/crossbeam/archive/refs/tags/crossbeam-utils-0.8.5.tar.gz"
-checksum="e1d6f55414a29906d24b13c687996b5220e08ccce9c682e4c02851138fc7093f
- 57db07eb38b0aaf7951c79b4639819cb84bc4269507091afea7267e10a54e079"
-replaces="cargo-tree>=0"
-
-build_options="static bindist"
-desc_option_bindist="Generate a tarball for bootstrap"
-
-if [ -n "$build_option_static" -o -n "$build_option_bindist" ]; then
-	_build_static=yes
-fi
-
-if [ -z "$_build_static" ]; then
-	makedepends+=" libgit2-devel"
-fi
-
-post_extract() {
-	mv ../crossbeam-* crossbeam-utils
-}
-
-post_patch() {
-	rm crossbeam-utils/crossbeam-utils/no_atomic.rs
-	cp crossbeam-utils/no_atomic.rs crossbeam-utils/crossbeam-utils
-
-	cat >> Cargo.toml <<- EOF
-		[patch.crates-io]
-		crossbeam-utils = { path = './crossbeam-utils/crossbeam-utils' }
-	EOF
-}
-
-do_build() {
-	local cargs
-
-	if [ -n "$_build_static" ]; then
-		unset LIBSSH2_SYS_USE_PKG_CONFIG
-		export OPENSSL_STATIC=1
-		# rust-openssl can not be linked static if pkg-config is used
-		export OPENSSL_NO_PKG_CONFIG
-		export OPENSSL_DIR="${XBPS_CROSS_BASE}/usr"
-	fi
-
-	if [ -n "$_build_static" ]; then
-		cargs+=" --features=all-static"
-	fi
-
-	cargo build --release ${cargs}
-}
-
-do_install() {
-	local cbin="target/release/cargo"
-	if [ "$CROSS_BUILD" ]; then
-		cbin="target/${RUST_TARGET}/release/cargo"
-	fi
-
-	if [ "$build_option_bindist" ]; then
-		local dest="cargo-${version}-${RUST_TARGET}"
-		mkdir -p ${XBPS_SRCDISTDIR}/distfiles ${dest}/cargo/bin
-		install -m 0755 ${cbin} ${dest}/cargo/bin
-		install -m 0644 LICENSE-APACHE LICENSE-MIT LICENSE-THIRD-PARTY ${dest}
-		bsdtar cvJf ${dest}.tar.xz ${dest}
-		install -m 0644 ${dest}.tar.xz ${XBPS_SRCDISTDIR}/distfiles
-		exit 1
-	fi
-
-	vbin ${cbin}
-	for f in src/etc/man/*.?; do
-		vman $f
-	done
-	vinstall src/etc/cargo.bashcomp.sh 0644 \
-	 usr/share/bash-completion/completions cargo
-	vinstall src/etc/_cargo 0644 usr/share/zsh/site-functions
-
-	vlicense LICENSE-APACHE
-	vlicense LICENSE-MIT
-	vlicense LICENSE-THIRD-PARTY
-}
diff --git a/srcpkgs/cargo/patches/crossbeam-ppcle.patch b/srcpkgs/rust/patches/crossbeam-ppcle.patch
similarity index 79%
rename from srcpkgs/cargo/patches/crossbeam-ppcle.patch
rename to srcpkgs/rust/patches/crossbeam-ppcle.patch
index 36d9256e1071..c2d445f74809 100644
--- a/srcpkgs/cargo/patches/crossbeam-ppcle.patch
+++ b/srcpkgs/rust/patches/crossbeam-ppcle.patch
@@ -1,5 +1,5 @@
---- a/crossbeam-utils/no_atomic.rs
-+++ b/crossbeam-utils/no_atomic.rs
+--- a/vendor/crossbeam-utils/no_atomic.rs
++++ b/vendor/crossbeam-utils/no_atomic.rs
 @@ -33,6 +33,8 @@ const NO_ATOMIC_64: &[&str] = &[
      "powerpc-unknown-linux-gnu",
      "powerpc-unknown-linux-gnuspe",
diff --git a/srcpkgs/cargo/patches/link-static.patch b/srcpkgs/rust/patches/link-static.patch
similarity index 56%
rename from srcpkgs/cargo/patches/link-static.patch
rename to srcpkgs/rust/patches/link-static.patch
index 6f38b77ce95c..536db7110379 100644
--- a/srcpkgs/cargo/patches/link-static.patch
+++ b/srcpkgs/rust/patches/link-static.patch
@@ -1,5 +1,5 @@
---- a/Cargo.toml	2019-01-02 22:49:06.000000000 +0100
-+++ b/Cargo.toml	2019-02-13 15:12:44.616810828 +0100
+--- a/src/tools/cargo/Cargo.toml	2019-01-02 22:49:06.000000000 +0100
++++ b/src/tools/cargo/Cargo.toml	2019-02-13 15:12:44.616810828 +0100
 @@ -116,3 +116,5 @@ doc = false
  deny-warnings = []
  vendored-openssl = ["openssl/vendored"]
diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index 560a629f3da2..1c95a5ef37f3 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -9,10 +9,11 @@
 #
 pkgname=rust
 version=1.57.0
-revision=1
+revision=2
 wrksrc="rustc-${version}-src"
 hostmakedepends="cmake curl pkg-config python3 tar cargo-bootstrap"
-makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm12"
+makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel openssl-devel llvm12
+ libcurl-devel"
 depends="rust-std"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -26,6 +27,10 @@ make_check=no # CBA for now
 build_options="bindist"
 desc_option_bindist="Generate tarballs for bootstrap"
 
+if [ -n "$build_option_bindist" ]; then
+	makedepends+=" libgit2-devel"
+fi
+
 if [ "$XBPS_LIBC" = "musl" ]; then
 	hostmakedepends+=" libexecinfo-devel"
 fi
@@ -64,6 +69,7 @@ post_patch() {
 	_clear_vendor_checksums rustc-ap-rustc_target
 	_clear_vendor_checksums target-lexicon
 	_clear_vendor_checksums tikv-jemallocator
+	_clear_vendor_checksums libz-sys
 }
 
 do_configure() {
@@ -112,9 +118,9 @@ do_configure() {
 		vendor = true
 		full-bootstrap = false
 		local-rebuild = ${_local_rebuild}
-		extended = false
+		extended = true
 		docs = ${_use_docs}
-		tools = []
+		tools = ["cargo"]
 		[install]
 		prefix = "/usr"
 		[rust]
@@ -163,6 +169,15 @@ do_configure() {
 # for it during stage1. Otherwise it attemps to use CFLAGS, which are the CFLAGS
 # of the cross host.
 do_build() {
+	if [ -n "$build_option_bindist" ]; then
+		unset LIBSSH2_SYS_USE_PKG_CONFIG
+		export OPENSSL_STATIC=1
+		# rust-openssl can not be linked static if pkg-config is used
+		export OPENSSL_NO_PKG_CONFIG
+		export OPENSSL_DIR="${XBPS_CROSS_BASE}/usr"
+		echo 'default = ["all-static"]' >> src/tools/cargo/Cargo.toml
+	fi
+
 	export RUST_BACKTRACE=1
 	export CARGO_HOME="$wrksrc/.cargo"
 	export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
@@ -196,6 +211,7 @@ do_install() {
 		install -m 0644 \
 			build/dist/rustc-${version}-${RUST_TARGET}.tar.xz \
 			build/dist/rust-std-${version}-${RUST_TARGET}.tar.xz \
+			build/dist/cargo-${version}-${RUST_TARGET}.tar.xz \
 			${XBPS_SRCDISTDIR}/distfiles
 		exit 1
 	fi
@@ -209,6 +225,9 @@ do_install() {
 	 -C "$DESTDIR/usr/lib" --strip-components=3 --exclude=manifest.in
 	tar xf build/dist/rust-docs-${version}-${RUST_TARGET}.tar.gz \
 	 -C "$DESTDIR/usr" --strip-components=2 --exclude=manifest.in
+	tar xf build/dist/cargo-${version}-${RUST_TARGET}.tar.gz \
+	 -C "$DESTDIR/usr" --strip-components=2 --exclude=manifest.in \
+	 cargo-${version}-${RUST_TARGET}/cargo/bin cargo-${version}-${RUST_TARGET}/cargo/libexec
 
 	vlicense COPYRIGHT
 	vlicense LICENSE-APACHE
@@ -234,6 +253,7 @@ rust-doc_package() {
 }
 
 rust-std_package() {
+	lib32disabled=yes
 	short_desc+=" - standard library"
 	if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 		depends="libexecinfo-devel"
@@ -242,3 +262,25 @@ rust-std_package() {
 		vmove usr/lib/rustlib
 	}
 }
+
+cargo_package() {
+	short_desc="Rust package manager"
+	depends="rust"
+	pkg_install() {
+		vmove usr/bin/cargo
+		vmove usr/libexec/cargo-credential-1password
+
+		_cargo_src="src/tools/cargo"
+
+		vcompletion $_cargo_src/src/etc/_cargo zsh
+		vcompletion $_cargo_src/src/etc/cargo.bashcomp.sh bash
+
+		for f in $_cargo_src/src/etc/man/*.?; do
+			vman $f
+		done
+
+		vlicense $_cargo_src/LICENSE-APACHE
+		vlicense $_cargo_src/LICENSE-MIT
+		vlicense $_cargo_src/LICENSE-THIRD-PARTY
+	}
+}

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: combine rust and cargo templates
  2022-03-31  1:04 [PR PATCH] combine rust and cargo templates classabbyamp
  2022-03-31  1:05 ` [PR PATCH] [Updated] " classabbyamp
@ 2022-03-31  3:42 ` q66
  2022-03-31  4:57 ` classabbyamp
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: q66 @ 2022-03-31  3:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 285 bytes --]

New comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/36426#issuecomment-1084041331

Comment:
i don't see how this is supposed to cross compile, considering it does not really fix anything and rustbuild for cross stage 2 tools is *not* ready

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: combine rust and cargo templates
  2022-03-31  1:04 [PR PATCH] combine rust and cargo templates classabbyamp
  2022-03-31  1:05 ` [PR PATCH] [Updated] " classabbyamp
  2022-03-31  3:42 ` q66
@ 2022-03-31  4:57 ` classabbyamp
  2022-03-31 11:18 ` q66
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: classabbyamp @ 2022-03-31  4:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 266 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/36426#issuecomment-1084075369

Comment:
If stage 2 tools can't be crossed, then how was I able to successfully cross-build and use cargo using these templates?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: combine rust and cargo templates
  2022-03-31  1:04 [PR PATCH] combine rust and cargo templates classabbyamp
                   ` (2 preceding siblings ...)
  2022-03-31  4:57 ` classabbyamp
@ 2022-03-31 11:18 ` q66
  2022-03-31 11:20 ` q66
  2022-05-05 20:33 ` [PR PATCH] [Closed]: " classabbyamp
  5 siblings, 0 replies; 7+ messages in thread
From: q66 @ 2022-03-31 11:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 372 bytes --]

New comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/36426#issuecomment-1084441006

Comment:
luck with a particular target combo? the tools get built with the right compiler, but they get the host's flags and environment, which results in weirdness (in my cases, actual build failures; i tested this when doing the 1.57 update)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: combine rust and cargo templates
  2022-03-31  1:04 [PR PATCH] combine rust and cargo templates classabbyamp
                   ` (3 preceding siblings ...)
  2022-03-31 11:18 ` q66
@ 2022-03-31 11:20 ` q66
  2022-05-05 20:33 ` [PR PATCH] [Closed]: " classabbyamp
  5 siblings, 0 replies; 7+ messages in thread
From: q66 @ 2022-03-31 11:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 681 bytes --]

New comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/36426#issuecomment-1084441006

Comment:
luck with a particular target combo? the tools get built with the right compiler, but they get the host's flags and environment (in rust build, they get build+host == the build env and target == the target env, while all correctly cross-compiled stuff should be build == build env and host+target == target env, but the logic for tools is hardcoded in the rustbuild code and when I looked into it it seemed extremely non-trivial to fix), which results in weirdness (in my cases, actual build failures; i tested this when doing the 1.57 update)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR PATCH] [Closed]: combine rust and cargo templates
  2022-03-31  1:04 [PR PATCH] combine rust and cargo templates classabbyamp
                   ` (4 preceding siblings ...)
  2022-03-31 11:20 ` q66
@ 2022-05-05 20:33 ` classabbyamp
  5 siblings, 0 replies; 7+ messages in thread
From: classabbyamp @ 2022-05-05 20:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1486 bytes --]

There's a closed pull request on the void-packages repository

combine rust and cargo templates
https://github.com/void-linux/void-packages/pull/36426

Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->

@q66, wanted to get your opinion on these changes before I go further. I did my best to fold the `cargo{,-bootstrap}` templates into the `rust{,-bootstrap}` ones, preserving all patches and fixes. Tested successfully with a cross build x86_64 to aarch64. If this looks fine, I can continute working on doing some cleanups and update to 1.59 (although there is a PR for that already).

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

[ci skip]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-05-05 20:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-31  1:04 [PR PATCH] combine rust and cargo templates classabbyamp
2022-03-31  1:05 ` [PR PATCH] [Updated] " classabbyamp
2022-03-31  3:42 ` q66
2022-03-31  4:57 ` classabbyamp
2022-03-31 11:18 ` q66
2022-03-31 11:20 ` q66
2022-05-05 20:33 ` [PR PATCH] [Closed]: " classabbyamp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).