unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#55270: unpack phase randomly changes the cwd
@ 2022-05-05 11:16 Attila Lendvai
  2022-05-05 12:18 ` Maxime Devos
  2022-05-05 20:12 ` Liliana Marie Prikler
  0 siblings, 2 replies; 6+ messages in thread
From: Attila Lendvai @ 2022-05-05 11:16 UTC (permalink / raw)
  To: 55270

at the end of the unpack phase, the working directory is changed to a random 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 when the dir after extraction only contains a single subdir, and no files otherwise.

--
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“When men hire themselves out to shoot other men to order, asking nothing about the justice of their cause, I don’t care if they are shot themselves.”
	— Herbert Spencer (1820–1903), during Britain's second Afghan war





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#55270: unpack phase randomly changes the cwd
  2022-05-05 11:16 bug#55270: unpack phase randomly changes the cwd Attila Lendvai
@ 2022-05-05 12:18 ` Maxime Devos
  2022-05-05 13:15   ` Attila Lendvai
  2022-05-05 20:12 ` Liliana Marie Prikler
  1 sibling, 1 reply; 6+ messages in thread
From: Maxime Devos @ 2022-05-05 12:18 UTC (permalink / raw)
  To: Attila Lendvai, 55270

[-- Attachment #1: Type: text/plain, Size: 1226 bytes --]

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 random directory.
> 
> https://git.savannah.gnu.org/cgit/guix.git/tree/guix/build/gnu-build-system.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)

> 
> 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 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 -- ‘just the first’ is a bit arbitrary.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#55270: unpack phase randomly changes the cwd
  2022-05-05 12:18 ` Maxime Devos
@ 2022-05-05 13:15   ` Attila Lendvai
  0 siblings, 0 replies; 6+ messages in thread
From: Attila Lendvai @ 2022-05-05 13:15 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 55270

> 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 necessarily 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.

--
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“There is always a philosophy for lack of courage.”
	— Albert Camus (1913–1960)





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#55270: unpack phase randomly changes the cwd
  2022-05-05 11:16 bug#55270: unpack phase randomly changes the cwd Attila Lendvai
  2022-05-05 12:18 ` Maxime Devos
@ 2022-05-05 20:12 ` Liliana Marie Prikler
  2022-07-12 14:11   ` Maxim Cournoyer
  1 sibling, 1 reply; 6+ messages in thread
From: Liliana Marie Prikler @ 2022-05-05 20:12 UTC (permalink / raw)
  To: Attila Lendvai, 55270

Am Donnerstag, dem 05.05.2022 um 11:16 +0000 schrieb Attila Lendvai:
> at the end of the unpack phase, the working directory is changed to a
> random 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.
url-fetch/tarbomb: Now this looks like a job for me.






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#55270: unpack phase randomly changes the cwd
  2022-05-05 20:12 ` Liliana Marie Prikler
@ 2022-07-12 14:11   ` Maxim Cournoyer
  2022-07-12 16:47     ` Liliana Marie Prikler
  0 siblings, 1 reply; 6+ messages in thread
From: Maxim Cournoyer @ 2022-07-12 14:11 UTC (permalink / raw)
  To: Liliana Marie Prikler; +Cc: Attila Lendvai, 55270

Hi,

Liliana Marie Prikler <liliana.prikler@gmail.com> writes:

> Am Donnerstag, dem 05.05.2022 um 11:16 +0000 schrieb Attila Lendvai:
>> at the end of the unpack phase, the working directory is changed to a
>> random 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.

> url-fetch/tarbomb: Now this looks like a job for me.

Just to make sure, are you suggesting the archive type used here would
have been better handled by url-fetch/tarboom?

Thanks,

Maxim




^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#55270: unpack phase randomly changes the cwd
  2022-07-12 14:11   ` Maxim Cournoyer
@ 2022-07-12 16:47     ` Liliana Marie Prikler
  0 siblings, 0 replies; 6+ messages in thread
From: Liliana Marie Prikler @ 2022-07-12 16:47 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: Attila Lendvai, 55270

Am Dienstag, dem 12.07.2022 um 10:11 -0400 schrieb Maxim Cournoyer:
> Hi,
> 
> Liliana Marie Prikler <liliana.prikler@gmail.com> writes:
> 
> > Am Donnerstag, dem 05.05.2022 um 11:16 +0000 schrieb Attila
> > Lendvai:
> > > at the end of the unpack phase, the working directory is changed
> > > to a
> > > random 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.
> 
> > url-fetch/tarbomb: Now this looks like a job for me.
> 
> Just to make sure, are you suggesting the archive type used here
> would have been better handled by url-fetch/tarboom?
That's what the docstring of url-fetch/tarbomb leads me to believe,
yes.  Is it not helpful?




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-07-12 16:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-05 11:16 bug#55270: unpack phase randomly changes the cwd Attila Lendvai
2022-05-05 12:18 ` Maxime Devos
2022-05-05 13:15   ` Attila Lendvai
2022-05-05 20:12 ` Liliana Marie Prikler
2022-07-12 14:11   ` Maxim Cournoyer
2022-07-12 16:47     ` Liliana Marie Prikler

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).