Created attachment 241711 [details] Full poudriere error log Cross-building lang/gcc12 for arm64.aarch64 with poudriere qemu-user-static fails during extract phase: # poudriere jail -l 132arm64 13.2-RELEASE arm64.aarch64 http 2023-04-14 23:37:20 /usr/local/poudriere/jails/132arm64 # poudriere testport -j 132arm64 -b latest -p usrports -i lang/gcc12 [...] Making GCC 12.2.0 for aarch64-portbld-freebsd13.2 [c,c++,objc,fortran,jit] ===> License GPLv3 GPLv3RLE accepted by the user ===> gcc12-12.2.0_6 depends on file: /usr/local/sbin/pkg - found ===> Fetching all distfiles required by gcc12-12.2.0_6 for building ===> Extracting for gcc12-12.2.0_6 => SHA256 Checksum OK for gcc-12.2.0.tar.xz. tar: Pathname can't be converted from UTF-8 to current locale. tar: Pathname can't be converted from UTF-8 to current locale. tar: Error exit delayed from previous errors. ===> Failed to extract "/portdistfiles//gcc-12.2.0.tar.xz". *** Error code 1
I have started to study the issue. Can you please provide some more details about the locale in the jail: is it the default? which one is it? Thanks.
(In reply to Lorenzo Salvadore from comment #1) It's default, I haven't changed any locale settings. nobody@132arm64-usrports:/usr/ports/lang/gcc12 % locale LANG=C.UTF-8 LC_CTYPE="C.UTF-8" LC_COLLATE="C.UTF-8" LC_TIME="C.UTF-8" LC_NUMERIC="C.UTF-8" LC_MONETARY="C.UTF-8" LC_MESSAGES="C.UTF-8" LC_ALL=
I can reproduce the bug. Still studying the issue. Interesting note: trying to extract the distfile within the jail with tar -xvf works. So I guess the issue must be searched either in the specifc command run in the port extraction phase or in the environment set by poudriere.
I am still working on it. Here are a few more observations: - lang/gcc12 appears to be the only problematic port: testing lang/gcc12-devel and lang/gcc13 works; - I am preparing the update of lang/gcc12 to 12.3.0. I have already tested it on aarch64 and unfortunately the bug is still present. - The locale used by poudriere at build time is different than the one used in the poudriere jail. It is LANG=C LC_CTYPE="C" LC_COLLATE="C" LC_TIME="C" LC_NUMERIC="C" LC_MONETARY="C" LC_MESSAGES="C" LC_ALL=C I have obtained it by patching the `do-extract:` target in bsd.port.mk. The same locale are used with lang/gcc12 on amd64 and with lang/gcc13 on aarch64 without issues. - The problematic files are gcc-12.3.0/gcc/testsuite/go.test/test/fixedbugs/issue27836.dir/\303\204foo.go gcc-12.3.0/gcc/testsuite/go.test/test/fixedbugs/issue27836.dir/\303\204main.go also known as gcc-12.3.0/gcc/testsuite/go.test/test/fixedbugs/issue27836.dir/Äfoo.go gcc-12.3.0/gcc/testsuite/go.test/test/fixedbugs/issue27836.dir/Ämain.go The files are present in lang/gcc13 too. Since the problem is version specific, GCC 13 is already out and my hope is to have it become GCC_DEFAULT soon enough, I might fix this port with a workaround rather than a real bug fix. However, I still have no workaround ready. CCing a few more people: - bapt, who might help with poudriere internals; - mm, who is the main maintainer of libarchive in the src repository and thus might understand better what is going on here; - gerald, past maintainer of the GCC ports, he might remember similar issues in the past.
(In reply to Lorenzo Salvadore from comment #4) > - gerald, past maintainer of the GCC ports, he might remember > similar issues in the past. This is a first for me. I definitely do not recall this in the FreeBSD context, nor from my following the upstream mailing lists.
IIRC it's a bug in qemu-user
Created attachment 242079 [details] workaround Here is a patch that seems to work around the problem: it switches to GNU tar for aarch64. I am still testing it. Feel free to also give it a try.
Did this very patch work for you? As far as I can tell ${ARCH} is only defined after .include <bsd.port.pre.mk>.
(In reply to Gerald Pfeifer from comment #8) I am still testing it, but for now I can confirm that extraction is successfully using gtar in an aarch64 13.2-RELEASE poudriere jail. I also confirm that this is exactly the patch I am testing.
Interesting! I am getting this on ref12-amd64: ~/ports/lang/gcc12> uname -or FreeBSD 12.4-STABLE ~/ports/lang/gcc12> make -V EXTRACT_CMD make: "/home/gerald/ports/lang/gcc12/Makefile" line 30: Malformed conditional (${ARCH} == aarch64) make: Fatal errors encountered -- cannot continue
Created attachment 242083 [details] workaround v2 I tested ref12-amd64 with the same result as you got Gerald. I have changed the patch so that ARCH is tested after importing bsd.port.pre.mk. I do not know why it was working fine on my machine and why it is not on the reference machine. By the way, the reference machine acts weirdly for me: when I login I get the following message: Cannot read termcap database; using dumb terminal settings. And vim cannot be used properly: I am unable to move the cursor using arrows. It works however using hjkl. Is it expected or should I contact clusteradm@?
(In reply to Lorenzo Salvadore from comment #11) > I tested ref12-amd64 with the same result as you got Gerald. > > I have changed the patch so that ARCH is tested after importing > bsd.port.pre.mk. I do not know why it was working fine on my machine > and why it is not on the reference machine. I am guessing you have defined ARCH in the environment somewhere? > By the way, the reference machine acts weirdly for me: when I login > I get the following message: > > Cannot read termcap database; > using dumb terminal settings. The shell I am invoking SSH from (i.e., on my local system) has TERM=xterm-256color which then works fine on the cluster machine.
See also: bug #246670
Created attachment 242096 [details] workaround v3 Thanks Mikael, I have improved the patch with the information that I have found in the bug report you provided, so that it now does not add an extra dependency on gtar any more. Still testing the new version, but for now it seems to work. Thanks Gerald, your suggestion about TERM is useful: setting it to xterm-256color works.
All my tests passed with the proposed patch. I am now testing the same patch for lang/gcc11. Vidar: Can you please confirm the patch works for you too? Thanks.
All tests passed successfully for lang/gcc11 too.
(In reply to Lorenzo Salvadore from comment #15) > Vidar: Can you please confirm the patch works for you too? Thanks. The workaround v3 patch works for me on 13.2 arm64.aarch64 (qemu).
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=5b4cadb23cbc2db23d7e2a40c16abd3e862fcf62 commit 5b4cadb23cbc2db23d7e2a40c16abd3e862fcf62 Author: Lorenzo Salvadore <salvadore@FreeBSD.org> AuthorDate: 2023-05-09 15:26:00 +0000 Commit: Lorenzo Salvadore <salvadore@FreeBSD.org> CommitDate: 2023-05-12 15:39:47 +0000 lang/gcc12: Work around aarch64 extraction bug Extraction fails with poudriere on aarch64 with the following error: => SHA256 Checksum OK for gcc-12.2.0.tar.xz. tar: Pathname can't be converted from UTF-8 to current locale. tar: Pathname can't be converted from UTF-8 to current locale. tar: Error exit delayed from previous errors. Enforcing use of bsdtar works around the issue. The issue is specific to lang/gcc11 and lang/gcc12: no other GCC port is affected. See also bug https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246670. PR: 271052 Reported by: Vidar Karlsen <vidar@karlsen.tech> Reviewed by: gerald, mikael lang/gcc12/Makefile | 9 +++++++++ 1 file changed, 9 insertions(+)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=22530ba28be79b947e617dc1288896bfc3c6f6ef commit 22530ba28be79b947e617dc1288896bfc3c6f6ef Author: Lorenzo Salvadore <salvadore@FreeBSD.org> AuthorDate: 2023-05-10 15:11:05 +0000 Commit: Lorenzo Salvadore <salvadore@FreeBSD.org> CommitDate: 2023-05-12 15:39:38 +0000 lang/gcc11: Work around aarch64 extraction bug Extraction fails with poudriere on aarch64 with the following error: => SHA256 Checksum OK for gcc-11.3.0.tar.xz. tar: Pathname can't be converted from UTF-8 to current locale. tar: Pathname can't be converted from UTF-8 to current locale. tar: Error exit delayed from previous errors. Enforcing use of bsdtar works around the issue. The issue is specific to lang/gcc11 and lang/gcc12: no other GCC port is affected. See also bug https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246670. PR: 271052 Reported by: Vidar Karlsen <vidar@karlsen.tech> Reviewed by: gerald, mikael lang/gcc11/Makefile | 9 +++++++++ 1 file changed, 9 insertions(+)
Fixed, thanks to everyone.
A commit in branch 2023Q2 references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=2cbbd136ada7dc9207759b698830d5a9d58b22df commit 2cbbd136ada7dc9207759b698830d5a9d58b22df Author: Lorenzo Salvadore <salvadore@FreeBSD.org> AuthorDate: 2023-05-10 15:11:05 +0000 Commit: Lorenzo Salvadore <salvadore@FreeBSD.org> CommitDate: 2023-05-12 17:15:17 +0000 lang/gcc11: Work around aarch64 extraction bug Extraction fails with poudriere on aarch64 with the following error: => SHA256 Checksum OK for gcc-11.3.0.tar.xz. tar: Pathname can't be converted from UTF-8 to current locale. tar: Pathname can't be converted from UTF-8 to current locale. tar: Error exit delayed from previous errors. Enforcing use of bsdtar works around the issue. The issue is specific to lang/gcc11 and lang/gcc12: no other GCC port is affected. See also bug https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246670. PR: 271052 Reported by: Vidar Karlsen <vidar@karlsen.tech> Reviewed by: gerald, mikael (cherry picked from commit 22530ba28be79b947e617dc1288896bfc3c6f6ef) lang/gcc11/Makefile | 9 +++++++++ 1 file changed, 9 insertions(+)
A commit in branch 2023Q2 references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=8e62ef36512902760104fb756edba5cb0704bb0f commit 8e62ef36512902760104fb756edba5cb0704bb0f Author: Lorenzo Salvadore <salvadore@FreeBSD.org> AuthorDate: 2023-05-09 15:26:00 +0000 Commit: Lorenzo Salvadore <salvadore@FreeBSD.org> CommitDate: 2023-05-12 17:15:18 +0000 lang/gcc12: Work around aarch64 extraction bug Extraction fails with poudriere on aarch64 with the following error: => SHA256 Checksum OK for gcc-12.2.0.tar.xz. tar: Pathname can't be converted from UTF-8 to current locale. tar: Pathname can't be converted from UTF-8 to current locale. tar: Error exit delayed from previous errors. Enforcing use of bsdtar works around the issue. The issue is specific to lang/gcc11 and lang/gcc12: no other GCC port is affected. See also bug https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246670. PR: 271052 Reported by: Vidar Karlsen <vidar@karlsen.tech> Reviewed by: gerald, mikael (cherry picked from commit 5b4cadb23cbc2db23d7e2a40c16abd3e862fcf62) lang/gcc12/Makefile | 9 +++++++++ 1 file changed, 9 insertions(+)
I had to apply the same fix to: - devel/aarch64-none-elf-gcc So poudriere could cross-compile.