Index | Thread | Search

From:
Kirill A. Korinsky <kirill@korins.ky>
Subject:
devel/cargo-audit: drop current_exe() workaround
To:
OpenBSD ports <ports@openbsd.org>
Date:
Sat, 05 Sep 2026 18:07:21 +0200

Download raw body.

Thread
  • Kirill A. Korinsky:

    devel/cargo-audit: drop current_exe() workaround

ports@,

rust in ports contains a patch to use getexecpath() for current_exe() that
makes this workaround outdate.

Ok to drop it?

Index: Makefile
===================================================================
RCS file: /home/cvs/ports/devel/cargo-audit/Makefile,v
diff -u -p -r1.13 Makefile
--- Makefile	6 Jan 2026 19:45:55 -0000	1.13
+++ Makefile	5 Sep 2026 16:04:04 -0000
@@ -4,6 +4,7 @@ NOT_FOR_ARCHS =		sparc64
 COMMENT =		audit Cargo.lock files for security vulnerabilities
 
 V =			0.22.0
+REVISION =		0
 CRATE =			cargo-audit
 DISTNAME =		${CRATE}-${V}
 
Index: patches/patch-modcargo-crates_canonical-path-2_0_2_src_lib_rs
===================================================================
RCS file: patches/patch-modcargo-crates_canonical-path-2_0_2_src_lib_rs
diff -N patches/patch-modcargo-crates_canonical-path-2_0_2_src_lib_rs
--- patches/patch-modcargo-crates_canonical-path-2_0_2_src_lib_rs	6 Jan 2026 19:45:55 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,18 +0,0 @@
-Index: modcargo-crates/canonical-path-2.0.2/src/lib.rs
---- modcargo-crates/canonical-path-2.0.2/src/lib.rs.orig
-+++ modcargo-crates/canonical-path-2.0.2/src/lib.rs
-@@ -327,7 +327,13 @@ impl ToOwned for CanonicalPath {
- /// Returns the full, canonicalized filesystem path of the current running
- /// executable.
- pub fn current_exe() -> Result<CanonicalPathBuf> {
--    let p = env::current_exe()?;
-+    let argv0 = env::args()
-+        .next()
-+        .ok_or_else(|| Error::new(ErrorKind::InvalidInput, "can't get argv[0]"))?;
-+    let exe_name = Path::new(&argv0)
-+        .file_name()
-+        .ok_or_else(|| Error::new(ErrorKind::InvalidInput, "can't get file name from argv[0]"))?;
-+    let p = PathBuf::from("${LOCALBASE}").join("bin").join(exe_name);
-     Ok(CanonicalPathBuf::canonicalize(p)?)
- }
- 


-- 
wbr, Kirill