From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 9A8C8158074 for ; Wed, 25 Jun 2025 23:14:13 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 87830340F6E for ; Wed, 25 Jun 2025 23:14:13 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 7E550110278; Wed, 25 Jun 2025 23:14:12 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 74DC9110278 for ; Wed, 25 Jun 2025 23:14:11 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A94B7340F21 for ; Wed, 25 Jun 2025 23:14:11 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1282427B9 for ; Wed, 25 Jun 2025 23:14:10 +0000 (UTC) From: "Haelwenn Monnier" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Haelwenn Monnier" Message-ID: <1750893235.e5322bbd5c9ad3558bfd44186fa8a5ce1ba69955.lanodan@gentoo> Subject: [gentoo-commits] repo/proj/guru:dev commit in: dev-lang/hare/, dev-lang/hare/files/ X-VCS-Repository: repo/proj/guru X-VCS-Files: dev-lang/hare/files/hare-0.25.2-os_exec-fix-clearenv.patch dev-lang/hare/hare-0.25.2-r1.ebuild dev-lang/hare/hare-0.25.2-r2.ebuild X-VCS-Directories: dev-lang/hare/ dev-lang/hare/files/ X-VCS-Committer: lanodan X-VCS-Committer-Name: Haelwenn Monnier X-VCS-Revision: e5322bbd5c9ad3558bfd44186fa8a5ce1ba69955 X-VCS-Branch: dev Date: Wed, 25 Jun 2025 23:14:10 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 11bb0918-7e7d-4de7-99ab-f7eb2efd8ff5 X-Archives-Hash: 37150327b8bb5ee20bfb3401ee432da2 commit: e5322bbd5c9ad3558bfd44186fa8a5ce1ba69955 Author: Haelwenn (lanodan) Monnier hacktivis me> AuthorDate: Wed Jun 25 23:13:06 2025 +0000 Commit: Haelwenn Monnier hacktivis me> CommitDate: Wed Jun 25 23:13:55 2025 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=e5322bbd dev-lang/hare: add patch to fix os::clearenv This patch has been applied upstream: https://git.sr.ht/~sircmpwn/hare/commit/4039f65285e5fbd89192319e52cd8fa0ea1ec214 And reported here: https://lists.sr.ht/~sircmpwn/hare-dev/%3C20250617083804.112699-1-apreiml@strohwolke.at%3E#%3CDAVE0JNU5ATC.10TZVZM0C3UB3 willowbarraco.fr%3E Signed-off-by: Haelwenn (lanodan) Monnier hacktivis.me> .../files/hare-0.25.2-os_exec-fix-clearenv.patch | 93 ++++++++++++++++++++++ ...hare-0.25.2-r1.ebuild => hare-0.25.2-r2.ebuild} | 4 + 2 files changed, 97 insertions(+) diff --git a/dev-lang/hare/files/hare-0.25.2-os_exec-fix-clearenv.patch b/dev-lang/hare/files/hare-0.25.2-os_exec-fix-clearenv.patch new file mode 100644 index 0000000000..47ec815eac --- /dev/null +++ b/dev-lang/hare/files/hare-0.25.2-os_exec-fix-clearenv.patch @@ -0,0 +1,93 @@ +From 4039f65285e5fbd89192319e52cd8fa0ea1ec214 Mon Sep 17 00:00:00 2001 +From: Armin Preiml +Date: Wed, 25 Jun 2025 10:57:23 +0200 +Subject: [PATCH hare] os::exec: fix clearenv + +Signed-off-by: Armin Preiml +--- + os/exec/+freebsd/platform_cmd.ha | 2 +- + os/exec/+linux/platform_cmd.ha | 2 +- + os/exec/+netbsd/platform_cmd.ha | 2 +- + os/exec/+openbsd/platform_cmd.ha | 2 +- + os/exec/env+test.ha | 19 +++++++++++++++++++ + 5 files changed, 23 insertions(+), 4 deletions(-) + +diff --git a/os/exec/+freebsd/platform_cmd.ha b/os/exec/+freebsd/platform_cmd.ha +index 2c0d972d..f328f9ac 100644 +--- a/os/exec/+freebsd/platform_cmd.ha ++++ b/os/exec/+freebsd/platform_cmd.ha +@@ -91,7 +91,7 @@ fn platform_setenv( + + fn platform_unsetenv(cmd: *command, key: str) (void | errors::invalid) = { + // XXX: This can be a binary search +- for (let i = 0z; i < len(cmd.env) - 1; i += 1) { ++ for (let i = 0z; i < len(cmd.env) && cmd.env[i] != null; i += 1) { + let e = c::tostr(cmd.env[i]: *const c::char)!; + if (strings::cut(e, "=").0 == key) { + free(cmd.env[i]); +diff --git a/os/exec/+linux/platform_cmd.ha b/os/exec/+linux/platform_cmd.ha +index 1ec0ddd4..4bf65cb9 100644 +--- a/os/exec/+linux/platform_cmd.ha ++++ b/os/exec/+linux/platform_cmd.ha +@@ -89,7 +89,7 @@ fn platform_setenv( + + fn platform_unsetenv(cmd: *command, key: str) (void | errors::invalid) = { + // XXX: This can be a binary search +- for (let i = 0z; cmd.env[i] != null; i += 1) { ++ for (let i = 0z; i < len(cmd.env) && cmd.env[i] != null; i += 1) { + let e = c::tostr(cmd.env[i]: *const c::char)!; + if (strings::cut(e, "=").0 == key) { + free(cmd.env[i]); +diff --git a/os/exec/+netbsd/platform_cmd.ha b/os/exec/+netbsd/platform_cmd.ha +index 2c26cff6..0ccd99bf 100644 +--- a/os/exec/+netbsd/platform_cmd.ha ++++ b/os/exec/+netbsd/platform_cmd.ha +@@ -92,7 +92,7 @@ fn platform_setenv( + + fn platform_unsetenv(cmd: *command, key: str) (void | errors::invalid) = { + // XXX: This can be a binary search +- for (let i = 0z; i < len(cmd.env) - 1; i += 1) { ++ for (let i = 0z; i < len(cmd.env) && cmd.env[i] != null; i += 1) { + let e = c::tostr(cmd.env[i]: *const c::char)!; + if (strings::cut(e, "=").0 == key) { + free(cmd.env[i]); +diff --git a/os/exec/+openbsd/platform_cmd.ha b/os/exec/+openbsd/platform_cmd.ha +index 9826111f..d1e1f667 100644 +--- a/os/exec/+openbsd/platform_cmd.ha ++++ b/os/exec/+openbsd/platform_cmd.ha +@@ -89,7 +89,7 @@ fn platform_setenv( + + fn platform_unsetenv(cmd: *command, key: str) (void | errors::invalid) = { + // XXX: This can be a binary search +- for (let i = 0z; i < len(cmd.env) - 1; i += 1) { ++ for (let i = 0z; i < len(cmd.env) && cmd.env[i] != null; i += 1) { + let e = c::tostr(cmd.env[i]: *const c::char)!; + if (strings::cut(e, "=").0 == key) { + free(cmd.env[i]); +diff --git a/os/exec/env+test.ha b/os/exec/env+test.ha +index cfd62733..e41395ad 100644 +--- a/os/exec/env+test.ha ++++ b/os/exec/env+test.ha +@@ -43,3 +43,22 @@ use bufio; + io::close(rd)!; + wait(&proc)!; + }; ++ ++@test fn clearenv() void = { ++ let cmd = cmd("env")!; ++ clearenv(&cmd); ++ setenv(&cmd, "HARETEST", "single")!; ++ ++ const (rd, wr) = pipe(); ++ addfile(&cmd, os::stdout_file, wr)!; ++ let proc = start(&cmd)!; ++ io::close(wr)!; ++ ++ let sc = bufio::newscanner(rd); ++ defer io::close(&sc)!; ++ for (let l => bufio::scan_line(&sc)!) { ++ assert(l == "HARETEST=single"); ++ }; ++ io::close(rd)!; ++ wait(&proc)!; ++}; diff --git a/dev-lang/hare/hare-0.25.2-r1.ebuild b/dev-lang/hare/hare-0.25.2-r2.ebuild similarity index 95% rename from dev-lang/hare/hare-0.25.2-r1.ebuild rename to dev-lang/hare/hare-0.25.2-r2.ebuild index 28a142b085..ea2e67a9fa 100644 --- a/dev-lang/hare/hare-0.25.2-r1.ebuild +++ b/dev-lang/hare/hare-0.25.2-r2.ebuild @@ -31,6 +31,10 @@ RDEPEND="${DEPEND}" # hare and haredoc are built by hare QA_FLAGS_IGNORED="usr/bin/hare usr/bin/haredoc" +PATCHES=( + "${FILESDIR}/hare-0.25.2-os_exec-fix-clearenv.patch" +) + src_configure() { local target_arch case ${ARCH} in