Subject: bug#45165: binutils-mesboot0 fails at configure, cannot find lex

From: Ludovic Courtès <[email-masked]>
Date: Tue, 22 Dec 2020 15:33:02 +0100

Hi!

Carl Dong <[email-masked]> skribis:

> This led me to look at ./configure’s shebang, which is:
> 	/gnu/store/m89p469fxwn4hj7an9givd1ry9vk7j2l-bash-mesboot0-2.05b/bin/sh
>
> Then I did:
> 	/gnu/store/m89p469fxwn4hj7an9givd1ry9vk7j2l-bash-mesboot0-2.05b/bin/sh -c "test -w config.cache”
>
> Which _did_ exit with status=1 !
>
> So I believe that this is a problem with the “test” builtin in /gnu/store/m89p469fxwn4hj7an9givd1ry9vk7j2l-bash-mesboot0-2.05b
>
> So I ran:
> 	env -i bash --rcfile environment-variables -c 'strace -v -e trace=file /gnu/store/m89p469fxwn4hj7an9givd1ry 9vk7j2l-bash-mesboot0-2.05b/bin/sh -c "test -w config.cache”'
>
> And the output:
> execve("/gnu/store/m89p469fxwn4hj7an9givd1ry9vk7j2l-bash-mesboot0-2.05b/bin/sh", ["/gnu/store/m89p469fxwn4hj7an9giv"..., "-c", "test -w config.cache"], ["PWD=/tmp/guix-build-binutils-mes"..., "SHLVL=0", "_=/usr/bin/strace"]) = 0
> [ Process PID=2049037 runs in 32 bit mode. ]
> open("/dev/tty", O_RDWR)                = 3
> stat("/tmp/guix-build-binutils-mesboot0-2.14.drv-0", {st_dev=makedev(0, 0x2f), st_ino=2546749, st_mode=S_IFDIR|0755, st_nlink=3, st_uid=1000, st_gid=1000, st_blksize=4096, st_blocks=0, st_size=80, st_atime=1608079054 /* 2020-12-15T19:37:34.095396729-0500 */, st_atime_nsec=95396729, st_mtime=1607635957 /* 2020-12-10T16:32:37.842047431-0500 */, st_mtime_nsec=842047431, st_ctime=1607636165 /* 2020-12-10T16:36:05.793930344-0500 */, st_ctime_nsec=793930344}) = 0
> stat(".", {st_dev=makedev(0, 0x2f), st_ino=2546749, st_mode=S_IFDIR|0755, st_nlink=3, st_uid=1000, st_gid=1000, st_blksize=4096, st_blocks=0, st_size=80, st_atime=1608079054 /* 2020-12-15T19:37:34.095396729-0500 */, st_atime_nsec=95396729, st_mtime=1607635957 /* 2020-12-10T16:32:37.842047431-0500 */, st_mtime_nsec=842047431, st_ctime=1607636165 /* 2020-12-10T16:36:05.793930344-0500 */, st_ctime_nsec=793930344}) = 0
> stat("config.cache", 0xfff9affc)        = -1 ENOENT (No such file or directory)
> +++ exited with 1 +++

Wait, here ‘stat’ returns ENOENT, so it’s no wonder that ‘test -w
config.cache’ returns 1, no?  Could you rerun ‘strace’ after making sure
‘config.cache’ exists?

The builtin seems to work for me:

--8<---------------cut here---------------start------------->8---
$ ls -l config.cache
-rw-r--r-- 1 ludo users 9009 Dec 13 22:49 config.cache
$ strace -e stat /gnu/store/m89p469fxwn4hj7an9givd1ry9vk7j2l-bash-mesboot0-2.05b/bin/sh -c "test -w config.cache"
[ Process PID=9623 runs in 32 bit mode. ]
stat("/home/ludo/src/guix", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("config.cache", {st_mode=S_IFREG|0644, st_size=9009, ...}) = 0
+++ exited with 0 +++
$ echo $?
0
--8<---------------cut here---------------end--------------->8---

What kernel are you running?

Weird!

Thanks for investigating,
Ludo’.