GNU bug report logs - #55270
unpack phase randomly changes the cwd

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix; Reported by: Attila Lendvai <attila@HIDDEN>; dated Thu, 5 May 2022 11:17:01 UTC; Maintainer for guix is bug-guix@HIDDEN.

Message received at 55270 <at> debbugs.gnu.org:


Received: (at 55270) by debbugs.gnu.org; 5 May 2022 13:15:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 05 09:15:47 2022
Received: from localhost ([127.0.0.1]:44804 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nmbKc-0006x5-Vb
	for submit <at> debbugs.gnu.org; Thu, 05 May 2022 09:15:47 -0400
Received: from mail-4323.proton.ch ([185.70.43.23]:11088)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <attila@HIDDEN>) id 1nmbKZ-0006lp-Bb
 for 55270 <at> debbugs.gnu.org; Thu, 05 May 2022 09:15:45 -0400
Date: Thu, 05 May 2022 13:15:28 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name;
 s=protonmail3; t=1651756536;
 bh=jB6f2sTbM7hQ7UEGxBJXAiKsBa50JHGNMYF7k+oXMA4=;
 h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To:
 References:Feedback-ID:From:To:Cc:Date:Subject:Reply-To:
 Feedback-ID:Message-ID;
 b=N0B1bx4qR2/SeRINiGq3qt7yU6rWqQs/43BJ2hWQlnD/YzkPvAwpwmYWxfbUobzVH
 gfOEZf0rA4cm506Di4yHpV/EpJ+Su3eIqRE4hBYpWqP4zL6TBsew/smihekKirFnZ0
 Vks1jeEnuRS4e+bMqCs73BWuMKkkZGK01V7Q0+d45XNCxllNfr18q8tGbVRxetILZU
 71aUDSR24gsuzhNzq8X2bJfdl4M73CetJNnMxZ66+GQHFCGEN4OqyOApQOfZ+6do8s
 jmSBZ5csVu1s3E/4EK7vIoKAbpgD3KkJNT8XfrgWp6fZlVpax6+/i9ckQI2K6Hmk5T
 /oR1Yxt0j4UmQ==
To: Maxime Devos <maximedevos@HIDDEN>
From: Attila Lendvai <attila@HIDDEN>
Subject: Re: bug#55270: unpack phase randomly changes the cwd
Message-ID: <Bp8HCSiQBKqwlPg7xZPY-2mqTh7jppBKwk0rBCg5cJ2N7MHGm2ci-jsXnKjRqDRc7N2oXR5xJ_eeekBJfUZQew45gnA1WeGFTMwMEcGZ0_I=@lendvai.name>
In-Reply-To: <378a823f4ae3a60c2d3ad419b22958524c933b19.camel@HIDDEN>
References: <IN6Ty5_9Tk68JceEubR3zTKjm8XTJOPv4-llOHUM18euCVLhGnRAeB_ncVn3AC2PbfDu_63Zq0YXlxXYHX8186pUHrciuQdCJCfH8TS69k4=@lendvai.name>
 <378a823f4ae3a60c2d3ad419b22958524c933b19.camel@HIDDEN>
Feedback-ID: 28384833:user:proton
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 55270
Cc: 55270 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Attila Lendvai <attila@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> It takes the first result 'scandir' -- i.e., the 'smallest' file name
> according to string-locale<?, so technically it's not random (so no
> reproducibility problems)


fair enough. what i meant to communicate is that it's arbitrary, not random=
.

another potential issue:

if the root of the archive contains a file called 'environment-variables', =
then this way it would overwrite the one generated by Guix. this may not ne=
cessarily be an issue, though, if that file is never used after the unpack =
phase.

maybe the cleanest would be to:

1) mkdir a directory ('extracted/'?) and chdir into it prior to
   unpacking, and

2) only do the DWIM chdir if the toplevel of the archive was a single
   dir.

but i lack the necessary perspective to see all the implications.

--
=E2=80=A2 attila lendvai
=E2=80=A2 PGP: 963F 5D5F 45C7 DFCD 0A39
--
=E2=80=9CThere is always a philosophy for lack of courage.=E2=80=9D
=09=E2=80=94 Albert Camus (1913=E2=80=931960)





Information forwarded to bug-guix@HIDDEN:
bug#55270; Package guix. Full text available.

Message received at 55270 <at> debbugs.gnu.org:


Received: (at 55270) by debbugs.gnu.org; 5 May 2022 12:18:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 05 08:18:31 2022
Received: from localhost ([127.0.0.1]:44636 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nmaRD-0006T8-7e
	for submit <at> debbugs.gnu.org; Thu, 05 May 2022 08:18:31 -0400
Received: from albert.telenet-ops.be ([195.130.137.90]:44212)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@HIDDEN>) id 1nmaRB-0006Sz-1g
 for 55270 <at> debbugs.gnu.org; Thu, 05 May 2022 08:18:29 -0400
Received: from [IPv6:2a02:2c40:200:b001::1:c51f]
 ([IPv6:2a02:2c40:200:b001::1:c51f])
 by albert.telenet-ops.be with bizsmtp
 id T0JS270011673cg060JTMc; Thu, 05 May 2022 14:18:27 +0200
Message-ID: <378a823f4ae3a60c2d3ad419b22958524c933b19.camel@HIDDEN>
Subject: Re: bug#55270: unpack phase randomly changes the cwd
From: Maxime Devos <maximedevos@HIDDEN>
To: Attila Lendvai <attila@HIDDEN>, 55270 <at> debbugs.gnu.org
Date: Thu, 05 May 2022 14:18:21 +0200
In-Reply-To: <IN6Ty5_9Tk68JceEubR3zTKjm8XTJOPv4-llOHUM18euCVLhGnRAeB_ncVn3AC2PbfDu_63Zq0YXlxXYHX8186pUHrciuQdCJCfH8TS69k4=@lendvai.name>
References: <IN6Ty5_9Tk68JceEubR3zTKjm8XTJOPv4-llOHUM18euCVLhGnRAeB_ncVn3AC2PbfDu_63Zq0YXlxXYHX8186pUHrciuQdCJCfH8TS69k4=@lendvai.name>
Content-Type: multipart/signed; micalg="pgp-sha512";
 protocol="application/pgp-signature"; boundary="=-8nR/8CzggRC0XvhF0o4q"
User-Agent: Evolution 3.38.3-1 
MIME-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22;
 t=1651753107; bh=LRC+FolItBDbxDh6MvLn0McfU1n364CCwPVQ26dL9HA=;
 h=Subject:From:To:Date:In-Reply-To:References;
 b=ALo98k/U1d4dxCHyYiKgW4tD/qUsscpVvHwjJU15LvWI24iQk7rEYb2qGLMk59cpp
 nmWgqJFlLzLm5097Z+r9gn25i1btzgohxWCpk6uaqFgGDTV8kk5f9MG1eeM2+hGGr1
 u9mssSQ5+Xsz4p1Wh/qs86A/g7OnJsN+jRN+wW71esa7TtyJYIXUtFGCuCQVJb1rns
 vhNh6GqiDbLsMsdEubWuzn9WwmTiPTmxNmMeNH3BqC0gssL/sZ5If+dP1PTJiWm6Eb
 e5sUWwcK+NgdMGugnEKm763hy3Ylgkfi2HcWfHRhZOTsRHcGsG/NlrGFGpDyq8zko6
 OZrecJ6mKyXzQ==
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 55270
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


--=-8nR/8CzggRC0XvhF0o4q
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Attila Lendvai schreef op do 05-05-2022 om 11:16 [+0000]:
> at the end of the unpack phase, the working directory is changed to a ran=
dom directory.
>=20
> https://git.savannah.gnu.org/cgit/guix.git/tree/guix/build/gnu-build-syst=
em.scm#n178

It takes the first result 'scandir' -- i.e., the 'smallest' file name
according to string-locale<?, so technically it's not random (so no
reproducibility problems)

>=20
> this is fine *when* the archive contains a single dir... but this DWIM'ne=
ss has just burned 15 mintues of my life, and i recommend removing it.
>=20
> if it is to stay, then at least it should be patched that it only happens=
 when the dir after extraction only contains a single subdir, and no files =
otherwise.

Except maybe when using 'out-of-source?', I think it has to stay in
some form -- somehow, we will have to run build scripts, "make", maybe
do some 'substitute*', and having to type the version number and
directory name inside build phases seems a bit error-prone (what if the
source is changed fom tarball or 'zip' to a vcs checkout?).

I agree with only chdiring if there's only one subdir (and no other
files) though -- =E2=80=98just the first=E2=80=99 is a bit arbitrary.

Greetings,
Maxime.

--=-8nR/8CzggRC0XvhF0o4q
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+4iGRcl7gUCYnPAjRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7hcPAQCFW/Nxza6Q/6DPskwK3/dzFebz
aUV1g5TI31LsC29bPwD/SVm+R3wlX4KhqNDtMtfQ3vKEDM/rLKd+8HkMLCSshgc=
=ci5l
-----END PGP SIGNATURE-----

--=-8nR/8CzggRC0XvhF0o4q--





Information forwarded to bug-guix@HIDDEN:
bug#55270; Package guix. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 5 May 2022 11:16:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 05 07:16:49 2022
Received: from localhost ([127.0.0.1]:44528 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nmZTU-00064m-ME
	for submit <at> debbugs.gnu.org; Thu, 05 May 2022 07:16:49 -0400
Received: from lists.gnu.org ([209.51.188.17]:56474)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <attila@HIDDEN>) id 1nmZTS-000631-No
 for submit <at> debbugs.gnu.org; Thu, 05 May 2022 07:16:47 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:40096)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <attila@HIDDEN>)
 id 1nmZTQ-0008Mh-I6
 for bug-guix@HIDDEN; Thu, 05 May 2022 07:16:46 -0400
Received: from mail-4317.proton.ch ([185.70.43.17]:33450)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <attila@HIDDEN>)
 id 1nmZTM-0002nL-Ds
 for bug-guix@HIDDEN; Thu, 05 May 2022 07:16:44 -0400
Date: Thu, 05 May 2022 11:16:29 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name;
 s=protonmail3; t=1651749397;
 bh=yRjvvIdsIMtw2IxA0C41PwJJvHpdy1L+z0domLrgeks=;
 h=Date:To:From:Reply-To:Subject:Message-ID:Feedback-ID:From:To:Cc:
 Date:Subject:Reply-To:Feedback-ID:Message-ID;
 b=UZ5rajcDutisvuTGManbWROFUULDe1ATHjvEtuAH0UVxv85XWU1fXmHcVbL58xpQy
 iE17UV799ql4bf2cCWo38IgAEEGg7PQqKcFDZ5bQi8R9Dld1VfnxDr1Su0OIwa6UYt
 qomNQoYQPWpamBFNGtYQP2FhOp0IyCAOZqOqr5ER1QKYOinSN+TfN5nDIUQenW9bFV
 HEutwMbfpqNLO5X0i1yW6lpzg9dphiwaA8q2AfaEIVbtn0dtj3UY5bAgloDYIXVDl8
 oyw7DXjfwz1G0ixYgjrI66ukLPcQM6QNYqiOAL0mtLxV1rNUw4+qTofOH7z/yFVgPl
 2pI2Twv5Xtfeg==
To: "bug-guix@HIDDEN" <bug-guix@HIDDEN>
From: Attila Lendvai <attila@HIDDEN>
Subject: unpack phase randomly changes the cwd
Message-ID: <IN6Ty5_9Tk68JceEubR3zTKjm8XTJOPv4-llOHUM18euCVLhGnRAeB_ncVn3AC2PbfDu_63Zq0YXlxXYHX8186pUHrciuQdCJCfH8TS69k4=@lendvai.name>
Feedback-ID: 28384833:user:proton
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=185.70.43.17; envelope-from=attila@HIDDEN;
 helo=mail-4317.proton.ch
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Attila Lendvai <attila@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

at the end of the unpack phase, the working directory is changed to a rando=
m directory.

https://git.savannah.gnu.org/cgit/guix.git/tree/guix/build/gnu-build-system=
.scm#n178

this is fine *when* the archive contains a single dir... but this DWIM'ness=
 has just burned 15 mintues of my life, and i recommend removing it.

if it is to stay, then at least it should be patched that it only happens w=
hen the dir after extraction only contains a single subdir, and no files ot=
herwise.

--
=E2=80=A2 attila lendvai
=E2=80=A2 PGP: 963F 5D5F 45C7 DFCD 0A39
--
=E2=80=9CWhen men hire themselves out to shoot other men to order, asking n=
othing about the justice of their cause, I don=E2=80=99t care if they are s=
hot themselves.=E2=80=9D
=09=E2=80=94 Herbert Spencer (1820=E2=80=931903), during Britain's second A=
fghan war





Acknowledgement sent to Attila Lendvai <attila@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guix@HIDDEN. Full text available.
Report forwarded to bug-guix@HIDDEN:
bug#55270; Package guix. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 5 May 2022 13:30:03 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.