pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

rust189: merge changes from lang/rust



Module Name:	pkgsrc-wip
Committed By:	Thomas Klausner <wiz%NetBSD.org@localhost>
Pushed By:	wiz
Date:		Mon Aug 25 23:07:16 2025 +0200
Changeset:	c760a9b74e1c3173e2ddea568f60b98c845b8c12

Modified Files:
	rust189/buildlink3.mk
	rust189/cross.mk
	rust189/distinfo
	rust189/options.mk
	rust189/platform.mk
Added Files:
	rust189/patches/patch-vendor_libc-0.2.168_src_unix_bsd_netbsdlike_netbsd_mod.rs
Removed Files:
	rust189/patches/patch-libc-0.2.168_src_unix_bsd_netbsdlike_netbsd_mod.rs

Log Message:
rust189: merge changes from lang/rust

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=c760a9b74e1c3173e2ddea568f60b98c845b8c12

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 rust189/buildlink3.mk                                     | 10 +++++++---
 rust189/cross.mk                                          |  8 ++++----
 rust189/distinfo                                          |  2 +-
 rust189/options.mk                                        | 15 ++++++++++++++-
 ...tch-libc-0.2.168_src_unix_bsd_netbsdlike_netbsd_mod.rs | 15 ---------------
 ...dor_libc-0.2.168_src_unix_bsd_netbsdlike_netbsd_mod.rs | 15 +++++++++++++++
 rust189/platform.mk                                       |  8 +++++++-
 7 files changed, 48 insertions(+), 25 deletions(-)

diffs:
diff --git a/rust189/buildlink3.mk b/rust189/buildlink3.mk
index b8cd208042..ab312a1daa 100644
--- a/rust189/buildlink3.mk
+++ b/rust189/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.17 2025/03/31 16:38:43 jakllsch Exp $
+# $NetBSD: buildlink3.mk,v 1.18 2025/07/24 10:33:38 jperkin Exp $
 
 BUILDLINK_TREE+=	rust
 
@@ -10,12 +10,16 @@ BUILDLINK_TREE+=	rust
 RUST_BUILDLINK3_MK:=
 
 BUILDLINK_API_DEPENDS.rust+=	rust>=1.56.1
-BUILDLINK_PKGSRCDIR.rust?=	../../wip/rust
+BUILDLINK_PKGSRCDIR.rust?=	../../wip/rust189
 BUILDLINK_PASSTHRU_DIRS+=	${PREFIX}/lib/rustlib
 
+.include "../../mk/bsd.fast.prefs.mk"
+
 pkgbase:= rust
 .include "../../mk/pkg-build-options.mk"
-.if empty(PKG_BUILD_OPTIONS.rust:Mrust-internal-llvm)
+# XXX: unclear why this is necessary, but is actively harmful on Darwin, and
+# likely broken for most uses anyway as rust defaults to DEPMETHOD=build.
+.if empty(PKG_BUILD_OPTIONS.rust:Mrust-internal-llvm) && ${OPSYS} != "Darwin"
 .  include "../../lang/libunwind/buildlink3.mk"
 .endif
 
diff --git a/rust189/cross.mk b/rust189/cross.mk
index a9a53164f1..26d79473fb 100644
--- a/rust189/cross.mk
+++ b/rust189/cross.mk
@@ -1,4 +1,4 @@
-# $NetBSD: cross.mk,v 1.11 2023/07/10 12:01:24 he Exp $
+# $NetBSD: cross.mk,v 1.15 2025/08/25 17:51:11 wiz Exp $
 
 # These settings may be used to cross-build rust.
 #
@@ -20,8 +20,8 @@
 #CROSS_ROOT=		/u/evbarm64
 #CROSS_ROOT=		/u/evbarm64eb
 #CROSS_ROOT=		/u/i386
-#CROSS_ROOT=		/u/riscv64
 #CROSS_ROOT=		/u/mipsel
+#CROSS_ROOT=		/u/riscv64
 #CROSS_ROOT=		/
 #MAKE_ENV+=		CROSS_ROOT=${CROSS_ROOT}
 
@@ -33,8 +33,8 @@
 #GNU_CROSS_TARGET=	aarch64--netbsd
 #GNU_CROSS_TARGET=	aarch64_be--netbsd
 #GNU_CROSS_TARGET=	i486--netbsdelf
-#GNU_CROSS_TARGET=	riscv64--netbsd
 #GNU_CROSS_TARGET=	mipsel--netbsd
+#GNU_CROSS_TARGET=	riscv64--netbsd
 #MAKE_ENV+=		GNU_CROSS_TARGET=${GNU_CROSS_TARGET}
 
 # To cross-build rust, you need to specify
@@ -49,8 +49,8 @@
 #TARGET=		aarch64_be-unknown-netbsd
 #TARGET=		i686-unknown-netbsd
 #TARGET=		i586-unknown-netbsd
-#TARGET=		riscv64gc-unknown-netbsd
 #TARGET=		mipsel-unknown-netbsd
+#TARGET=		riscv64gc-unknown-netbsd
 #
 #SCRIPTS=		${WRKDIR}/scripts
 #CONFIGURE_ARGS+=	--host=${TARGET}
diff --git a/rust189/distinfo b/rust189/distinfo
index 3329135a25..85f1fb6280 100644
--- a/rust189/distinfo
+++ b/rust189/distinfo
@@ -117,7 +117,6 @@ SHA1 (patch-compiler_rustc__target_src_spec_targets_aarch64__be__unknown__netbsd
 SHA1 (patch-compiler_rustc__target_src_spec_targets_aarch64__unknown__netbsd.rs) = 1a02f2dd61a5f9cc4be1f66ac3404c961810c731
 SHA1 (patch-compiler_rustc__target_src_spec_targets_mips64el__unknown__netbsd.rs) = 0c5b7c31abe514e3394b910c6e601e40ebbd45c1
 SHA1 (patch-compiler_rustc__target_src_spec_targets_mipsel__unknown__netbsd.rs) = 7deeb7d1d3306e96891dec144ac90398b88c6ad4
-SHA1 (patch-libc-0.2.168_src_unix_bsd_netbsdlike_netbsd_mod.rs) = c5cd529719daee44aead47ffd97e682ca9d9a1ae
 SHA1 (patch-library_backtrace_src_symbolize_gimli.rs) = 9d5ef634c5a454e474ea5fee76da9bb768f5b3d9
 SHA1 (patch-library_backtrace_src_symbolize_gimli_elf.rs) = 8b18e1dbde59f3e8f20e93c7669618b2c7a13294
 SHA1 (patch-library_std_src_sys_pal_unix_mod.rs) = 2e68c3a71b221cb1bfeb313327f366758782fe51
@@ -139,6 +138,7 @@ SHA1 (patch-tests_assembly_targets_targets-elf.rs) = ee7d036c055ed2a2b3b303f381a
 SHA1 (patch-vendor_crossbeam-utils-0.8.18_no__atomic.rs) = d4d9288cb199af9bc7e321fbd2b42860aed954ec
 SHA1 (patch-vendor_libc-0.2.155_src_unix_bsd_netbsdlike_netbsd_mod.rs) = 36d927a0c3fd6ef8d211da5389a981e077aedc29
 SHA1 (patch-vendor_libc-0.2.155_src_unix_solarish_mod.rs) = 97505b88875aa80fa2b5589b6090237c3786e143
+SHA1 (patch-vendor_libc-0.2.168_src_unix_bsd_netbsdlike_netbsd_mod.rs) = c5cd529719daee44aead47ffd97e682ca9d9a1ae
 SHA1 (patch-vendor_libc-0.2.168_src_unix_bsd_netbsdlike_netbsd_riscv64.rs) = acbd63b911637fef336a92169a8130133eb64c8c
 SHA1 (patch-vendor_libc-0.2.168_src_unix_solarish_mod.rs) = edbb81319e5f685fd9c2ffe94138c377855a982d
 SHA1 (patch-vendor_libc-0.2.169_src_unix_bsd_netbsdlike_netbsd_mod.rs) = 02c4efefbf1e9e1bd98eb9524515677250ae7454
diff --git a/rust189/options.mk b/rust189/options.mk
index 999196b96b..925667938a 100644
--- a/rust189/options.mk
+++ b/rust189/options.mk
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.26 2022/07/11 20:13:50 jperkin Exp $
+# $NetBSD: options.mk,v 1.49 2025/08/25 17:51:11 wiz Exp $
 
 PKG_OPTIONS_VAR=	PKG_OPTIONS.rust
 PKG_SUPPORTED_OPTIONS+=	rust-cargo-static rust-docs
@@ -40,6 +40,19 @@ GCC_REQD+=	12
 .  endif
 .endif
 
+# Apparently, using pkgsrc LLVM 19.x does not work on
+# NetBSD/x86_64 9.x and NetBSD/i386 9.x unless rust is built
+# with a newer gcc than the platform-included 7.5.0.  Ref.
+# https://gnats.netbsd.org/59435 and
+# https://mail-index.netbsd.org/pkgsrc-users/2025/05/20/msg041603.html
+# and following discussion.
+.if empty(PKG_OPTIONS:Mrust-internal-llvm)
+.  if ${MACHINE_PLATFORM:MNetBSD-9.*-x86_64} || \
+      ${MACHINE_PLATFORM:MNetBSD-9.*-i386}
+GCC_REQD+=	10
+.  endif
+.endif
+
 # Fix for problem seen during rust-installer run w/rust 1.84.1 on macppc,
 # "of course" experienced near the end of the build process:
 # assertion "memcmp(mf_ptr(mf) - 1, mf_ptr(mf) - matches[i].dist - 2, matches[i].len) == 0" failed: file "xz-5.2/src/liblzma/lz/lz_encoder_mf.c", line 40, function "lzma_mf_find"
diff --git a/rust189/patches/patch-libc-0.2.168_src_unix_bsd_netbsdlike_netbsd_mod.rs b/rust189/patches/patch-libc-0.2.168_src_unix_bsd_netbsdlike_netbsd_mod.rs
deleted file mode 100644
index 2127d0f1bc..0000000000
--- a/rust189/patches/patch-libc-0.2.168_src_unix_bsd_netbsdlike_netbsd_mod.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD$
-
-Apply https://github.com/rust-lang/libc/pull/4265/files
-to fix getmntinfo() from rust.
-
---- vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/mod.rs.orig	2025-04-05 11:35:20.818765987 +0000
-+++ vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/mod.rs
-@@ -2850,6 +2850,7 @@ extern "C" {
-         hint: *const c_void,
-     ) -> c_int;
- 
-+    #[link_name = "__getmntinfo13"]
-     pub fn getmntinfo(mntbufp: *mut *mut crate::statvfs, flags: c_int) -> c_int;
-     pub fn getvfsstat(buf: *mut statvfs, bufsize: size_t, flags: c_int) -> c_int;
- }
diff --git a/rust189/patches/patch-vendor_libc-0.2.168_src_unix_bsd_netbsdlike_netbsd_mod.rs b/rust189/patches/patch-vendor_libc-0.2.168_src_unix_bsd_netbsdlike_netbsd_mod.rs
new file mode 100644
index 0000000000..2127d0f1bc
--- /dev/null
+++ b/rust189/patches/patch-vendor_libc-0.2.168_src_unix_bsd_netbsdlike_netbsd_mod.rs
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Apply https://github.com/rust-lang/libc/pull/4265/files
+to fix getmntinfo() from rust.
+
+--- vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/mod.rs.orig	2025-04-05 11:35:20.818765987 +0000
++++ vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/mod.rs
+@@ -2850,6 +2850,7 @@ extern "C" {
+         hint: *const c_void,
+     ) -> c_int;
+ 
++    #[link_name = "__getmntinfo13"]
+     pub fn getmntinfo(mntbufp: *mut *mut crate::statvfs, flags: c_int) -> c_int;
+     pub fn getvfsstat(buf: *mut statvfs, bufsize: size_t, flags: c_int) -> c_int;
+ }
diff --git a/rust189/platform.mk b/rust189/platform.mk
index d3ef0fd1d6..e094334ea2 100644
--- a/rust189/platform.mk
+++ b/rust189/platform.mk
@@ -1,4 +1,4 @@
-# $NetBSD: platform.mk,v 1.27 2024/08/01 15:24:39 tnn Exp $
+# $NetBSD: platform.mk,v 1.33 2025/06/16 21:10:43 he Exp $
 
 # This file encodes whether a given platform has support for rust.
 
@@ -16,6 +16,12 @@ RUST_PLATFORMS+=	${rust_os}-*-${rust_arch}
 .  endfor
 .endfor
 
+# rust does not build in the VA space available on earm.
+# \todo Consider extension to other platforms.
+.if ${NATIVE_MACHINE_PLATFORM:M*-*-earm*}
+RUST_TYPE?=	bin
+.endif
+
 RUST_DIR?=	../../lang/rust
 
 .for rust_platform in ${RUST_PLATFORMS}


Home | Main Index | Thread Index | Old Index