From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id uIbsMzWVOGFxiwAAgWs5BA (envelope-from ) for ; Wed, 08 Sep 2021 12:49:25 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id WNwiMDWVOGE4RAAA1q6Kng (envelope-from ) for ; Wed, 08 Sep 2021 10:49:25 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7930A1F6D6 for ; Wed, 8 Sep 2021 12:49:25 +0200 (CEST) Received: from localhost ([::1]:59174 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNv8t-0007k0-I9 for larch@yhetil.org; Wed, 08 Sep 2021 06:49:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45884) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNv07-0005ZG-Nu for guix-devel@gnu.org; Wed, 08 Sep 2021 06:40:20 -0400 Received: from xavier.telenet-ops.be ([2a02:1800:120:4::f00:14]:44602) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNv03-0006Ck-75 for guix-devel@gnu.org; Wed, 08 Sep 2021 06:40:19 -0400 Received: from butterfly.local ([188.188.194.186]) by xavier.telenet-ops.be with bizsmtp id rNg32500741m7uc01Ng592; Wed, 08 Sep 2021 12:40:06 +0200 Message-ID: Subject: Re: avoid wrapper scripts when possible From: Maxime Devos To: Attila Lendvai Date: Wed, 08 Sep 2021 12:39:55 +0200 In-Reply-To: References: Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-QSg60x129MQAI/BLQRuP" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1631097606; bh=hVduszZyy6Nscdh3/3YXAwxBvzhDqkGVjmJMvhYHyzY=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=AGmN08amtrJ4+5luyGnP6kMBS0HqZF1ztIUZSgN7h3PEGyCCH3tqYsfzFD23lg0bT bl4NSaYlBKH6STaCKXJPuGu+yDZBcS1qd5cYCIYXi5dREXC7FPtTubnSErny+hVCuw 6bg+UqEE8J7rbYMuGmBJpNbkyqbWp02OsNcZFxtDV7JVpghzA0gKW+O353xIiCCHo4 1Xt00A3YxA3Ca7x6QMKxUaaQpOBi2r01jwL5s+kKUi1WSzHV3X3kf8S0xnWS7V2BO1 fC4Qq0lGLDbpsu5FYbPpFtxAyL74eCY699PWR7Z8emBrxEbnt5oLCPmdVIEHhwXnn7 wPCzTBrxGGGeA== Received-SPF: pass client-ip=2a02:1800:120:4::f00:14; envelope-from=maximedevos@telenet.be; helo=xavier.telenet-ops.be X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "guix-devel@gnu.org" Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1631098165; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=hVduszZyy6Nscdh3/3YXAwxBvzhDqkGVjmJMvhYHyzY=; b=ft11Nsm6PMcqpAeaciiV9mDeIcgu3IZs8HOUWnZ1PryEMCKJRhyi2YPhToBH5OZCsWvjGe vHrX/ugAsQgr7JFR5wvRYjdgIrRXRi/2a6eUYM28ZzPHsdXKJHShyTBwlwgVjZLzx7U5h+ vqSQNQxxxhMxYcM0yW/FY97N66xrGiXUmRyw0JXWLnNRM07+QX5UQcNqzlGz6HPD4I2d6I eo+kYGPiRGN2O3CMTRwNf9/jOswG7NTNQ4yui5/WmHOH6oHejP+PlfjWJQ1wKV6SSkuTCk Oz07yGPdU80t/DGd+oV6EheRh7p7H/Co/xvJVgdHMi0KGch82EkgXHfySeqwmA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1631098165; a=rsa-sha256; cv=none; b=KFccTAtjI48JhEUHr+n2iO8JkeCeIK/dPq3AlVkINAS+Mevc3GOdA+r7zXnnZeiQ2ixSut 3ONtcuKOgx6vcw+XUDFZYaJIjmz3VgBjP9EutYVgPJsRNkYQnfDGgnvHwvp/KDn8UVHAVU IDFXXes82bE8knv/Qo+7xCE43mUhhqTI0mtIsNOKVbgtiEPwes2qQh5DC7DJPuJJ93Jtz0 EzhxXx8ygo1n3ZH2Fw2On7DhjJkm+lwPUvYQFo7DVeNm5ZExWnI79YfgVu/pk9YUlqXMYv JcPosL2X+QHHhjun8Uun1ir/d8iUNLdMlLLMVZnYBqBmw91Q/QsSxibahc2t1A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=telenet.be header.s=r21 header.b=AGmN08am; dmarc=pass (policy=none) header.from=telenet.be; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -5.21 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=telenet.be header.s=r21 header.b=AGmN08am; dmarc=pass (policy=none) header.from=telenet.be; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: 7930A1F6D6 X-Spam-Score: -5.21 X-Migadu-Scanner: scn0.migadu.com X-TUID: 2SZ3ic7PI3Mm --=-QSg60x129MQAI/BLQRuP Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attila Lendvai schreef op wo 08-09-2021 om 09:20 [+0000]: > thanks for the ideas Maxime! >=20 >=20 > > You could patch trezor-agent with something like > >=20 > > Python syntax might be incorrect > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D > >=20 > > if sys.argv[0] =3D=3D ".trezor-gpg' > > sys.argv[0] =3D "trezor-gpg" > > device_name =3D os.path.basename(sys.argv[0]).rsplit('-',1)[0] > >=20 > > Would that work? >=20 > most probably, but i thought first i'll pursue a more general fix for > this. i will fall back to just patching upstream if i fail. >=20 >=20 > > FWIW, there's 'wrap-program' and there is 'wrap-script'. > >=20 > > wrap-script is less likely to cause errors here (it doesn't rename the = executable) > > but less general. Maybe wrap-script can be used instead of wrap-program= ? >=20 > not sure how to do this. looking at python-build-system.scm it looks > like there is no way to tell it to use wrap-script, so i went ahead > and just changed the wrap-program call to wrap-script globally, and > gave it a try. Are you referring to the lines (for-each (lambda (dir) (let ((files (list-of-files dir))) (for-each (cut wrap-program <> var) files))) bindirs) in the procedure 'wrap' from (guix build python-build-system)? > the first error i encountered was in the package called scons. it has > .bat files that wrap-script fails on. if i delete them in a snippet, > then scons' own build system errors out. The .bat are only for Windows, so you could remove them after the 'install' phase or before the 'wrap' phase. They seem to be useless on GNU/{Linux,Hu= rd}. > any hints on how to proceed from here? Instead of modifying 'wrap', you could replace the 'wrap' phase with something like `(#:phases (modify-phases %standard-phases (replace 'wrap (lambda _ ... customised wrapping code ...)))) Also, replacing wrap-program with wrap-script globally won't work because wrap-script is less general, it only spports python, R, perl and bash. So something like (define (wrap-script-or-program ...) (if it-uses-python-or-ruby-or... (wrap-script ...) (wrap-program ...))) may be required. > was this what you meant at all? >=20 > would it be a worthwhile improvement to hack my way through this path > at all? There were some changes on core-updates to reduce double-wrapping, so possibly it's already solved. > shall i try to make it configurable from the package's definition, > change the default, and force it back to wrap-program for packages > that fail with wrap-script? Perhaps try something like 'wrap-script-or-program' first? That should reduce the number of package definitions that need to be adjusted. Greetings, Maxime. --=-QSg60x129MQAI/BLQRuP Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYTiS/BccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7vZLAP9CJl3LADyr7uAophQLp77+4Mxl p1S6YH3RgIksPBPw/QEA0KYSJJKAaT/hgUlY4CZ4v1hg+pPnTgMFjlBQlpNMhgQ= =WoVW -----END PGP SIGNATURE----- --=-QSg60x129MQAI/BLQRuP--