NetBSD Problem Report #59842

From www@netbsd.org  Tue Dec 16 04:03:15 2025
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 417E41A923A
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 16 Dec 2025 04:03:15 +0000 (UTC)
Message-Id: <20251216040314.0A8B21A923C@mollari.NetBSD.org>
Date: Tue, 16 Dec 2025 04:03:13 +0000 (UTC)
From: coypu@sdf.org
Reply-To: coypu@sdf.org
To: gnats-bugs@NetBSD.org
Subject: cwrappers doesn't transform if "cc @command-line-aguments" syntax is used
X-Send-Pr-Version: www-1.0

>Number:         59842
>Category:       pkg
>Synopsis:       cwrappers doesn't transform if "cc @command-line-aguments" syntax is used
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 16 04:05:00 +0000 2025
>Last-Modified:  Tue Dec 16 15:15:02 +0000 2025
>Originator:     coypu
>Release:        pkgsrc-current as of 2025-12-15, cwrappers-20220403
>Organization:
>Environment:
NetBSD  10.1 NetBSD 10.1 (GENERIC) #0: Mon Dec 16 13:08:11 UTC 2024  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64

>Description:
Here is a reproducer trying to build things "normally" and then with @command-line-arguments. Both are using -lnonexistent, which should be removed by cwrappers config, but isn't in the second case.

A package (mongodb) was using this syntax to avoid exceeding max command line length.

#!/bin/sh

set -ex

cat << EOF > main.c
int main() { return 0; }
EOF

cat << EOF > cc
worklog=.work.log
exec=/usr/bin/cc
exec_path=/usr/pkg/libexec/cwrappers/cc-wrapper
transform=rm:-lnonexistent
EOF

cat << EOF > mainlink
main.c -lnonexistent
EOF

# Normal command, works fine
env CWRAPPERS_CONFIG_DIR=. /usr/pkg/libexec/cwrappers/cc-wrapper main.c -lnonexistent

# Same command passed with '@mainlink', transform doesn't work
env CWRAPPERS_CONFIG_DIR=. /usr/pkg/libexec/cwrappers/cc-wrapper '@mainlink'
>How-To-Repeat:

>Fix:

>Audit-Trail:
From: "Maya Rashish" <maya@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/59842 CVS commit: pkgsrc/databases/mongodb
Date: Tue, 16 Dec 2025 15:13:16 +0000

 Module Name:	pkgsrc
 Committed By:	maya
 Date:		Tue Dec 16 15:13:16 UTC 2025

 Modified Files:
 	pkgsrc/databases/mongodb: Makefile

 Log Message:
 mongodb: Introduce workarond for PR pkg/59842

 cwrappers doesn't transform when `cc @args` syntax is used (to avoid very
 long commands). Tell the package we can handle the long commands so this
 syntax isn't necessary.

 Build failure seen on NetBSD-10/x86_64 - which relies on pkgsrc GCC, which
 relies on cwrappers transform.


 To generate a diff of this commit:
 cvs rdiff -u -r1.101 -r1.102 pkgsrc/databases/mongodb/Makefile

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

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2025 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.