https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/ Issue: sys-fs/safecopy-1.7 fails to compile. Discovered on: amd64 (internal ref: tinderbox_musl) NOTE: This machine uses MUSL libc
Created attachment 770378 [details] build.log build log and emerge --info
I'm seeing similar errors (not the one about "O_RDONLY undeclared", just "unknown type name off64_t; did you mean off_t?" and warning "implicit declaration of function lseek64; did you mean lseek?") while making a new Gentoo install on a MacBook using glibc. Since, from <sys/types.h> and <features.h>, "off64_t" is defined when _LARGEFILE64_SOURCE is set, and that macro is set when _GNU_SOURCE is set, maybe something used to cause _GNU_SOURCE to be defined (by default?) and no longer does? In any case, the file that causes the error is in a directory that the ebuild only causes to be built when USE=test, so the package at least builds if its tests are restricted.
Okay, I had assumed this was just musl, which I don't have much time for, but you're right, I've just hit this with glibc too.
This helps, but one test still fails. diff -Naurw a/simulator/src/simulatorlb.c b/simulator/src/simulatorlb.c --- a/simulator/src/simulatorlb.c 2009-07-28 15:31:16.000000000 +0100 +++ b/simulator/src/simulatorlb.c 2023-09-14 09:04:41.321398218 +0100 @@ -2,7 +2,7 @@ * This file is copyright ©2009 Corvus Corax * Distributed under the terms of the GPL version 2 or higher */ -#define _FILE_OFFSET_BITS 64 +#define _LARGEFILE64_SOURCE #include <config.h> #ifdef USE_GNU_SOURCE ---- Running test 0: Testing debug library functionality: FAILED Details: Test if the test library gets loaded and works. Runnign cat on the virtual debug file should result in a 2048 byte file since that is the address of the first simulated IO error. Error: file /var/tmp/portage/sys-fs/safecopy-1.7/work/safecopy-1.7/test/tmpdir/test.dat has size 10240, should be 2048 program reported: -- ... -- simulator initialising - reading config simulator.cfg -- simulator time granularity: 77 usecs -- simulator everything shorter will be busy-waiting -- simulator simulated blocksize: 1024 -- simulator simulated filesize: 10240 -- simulator opening data source: test.dat -- simulator simulating hard error in block: 2 -- opening debug -- closing debug storing temporary files of failed test0 in /var/tmp/portage/sys-fs/safecopy-1.7/work/safecopy-1.7/test/tmp_failed_test0
The test seems flawed. The "simulator" behaviour only kicks in if the opened file is called "debug", but in this case, it's called "test.dat", so it just passes calls through to the normal functions.
Ah, ignore the above, talking crap. What I have noticed though is it behaves differently if you output to a file vs if you pipe to wc. > $ LD_PRELOAD='/var/tmp/portage/sys-fs/safecopy-1.7/work/safecopy-1.7/simulator/src/libsimulatorlb.so.1.0: ' cat debug > foo > simulator initialising - reading config simulator.cfg > simulator time granularity: 231 usecs > simulator everything shorter will be busy-waiting > simulator simulated blocksize: 1024 > simulator simulated filesize: 10240 > simulator opening data source: test.dat > simulator simulating hard error in block: 2 > opening debug > closing debug > $ LD_PRELOAD='/var/tmp/portage/sys-fs/safecopy-1.7/work/safecopy-1.7/simulator/src/libsimulatorlb.so.1.0: ' cat debug | wc -c > simulator initialising - reading config simulator.cfg > simulator time granularity: 93 usecs > simulator everything shorter will be busy-waiting > simulator simulated blocksize: 1024 > simulator simulated filesize: 10240 > simulator opening data source: test.dat > simulator simulating hard error in block: 2 > opening debug > reading from debug file: 131072 at position 0 shrinks due to upcoming failure and reads 2048 bytes > reading from debug file: 131072 at position 2048 simulated hard failure! > cat: debug: Input/output error > closing debug > 2048
Aha! With a file, it's using copy_file_range rather than read! XD
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=547998220914f0d2d7bbf9b4e0ae2335c7deb6c4 commit 547998220914f0d2d7bbf9b4e0ae2335c7deb6c4 Author: James Le Cuirot <chewi@gentoo.org> AuthorDate: 2023-09-16 13:09:52 +0000 Commit: James Le Cuirot <chewi@gentoo.org> CommitDate: 2023-09-16 13:10:39 +0000 sys-fs/safecopy: Fix test issues, EAPI 8 Closes: https://bugs.gentoo.org/838091 Signed-off-by: James Le Cuirot <chewi@gentoo.org> sys-fs/safecopy/files/safecopy-tests.patch | 22 ++++++++++++++++++++++ ...{safecopy-1.7.ebuild => safecopy-1.7-r1.ebuild} | 9 +++++---- 2 files changed, 27 insertions(+), 4 deletions(-)