From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: ld-wrapper and funny bytes in LIBRARY_PATH Date: Sun, 18 Jun 2017 00:21:28 +0200 Message-ID: <87k24a9rx3.fsf@gnu.org> References: <20170617104827.6eda2dbd@scratchpost.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMM63-0005px-6a for guix-devel@gnu.org; Sat, 17 Jun 2017 18:21:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dMM5z-0002xI-6u for guix-devel@gnu.org; Sat, 17 Jun 2017 18:21:35 -0400 In-Reply-To: <20170617104827.6eda2dbd@scratchpost.org> (Danny Milosavljevic's message of "Sat, 17 Jun 2017 10:48:27 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Danny Milosavljevic Cc: guix-devel@gnu.org Hi Danny, Danny Milosavljevic skribis: > so I'm trying to enable Rust tests and one of their tests does the follow= ing (paraphrased) in order to exercise the non-UTF8 linker case (which they= want to succeed): > > ---------------------------------------------- > bad_dir :=3D zzz$$'\xff' > > all: > mkdir $(bad_dir) > cp ... $(bad_dir)/liblibrary.a > LIBRARY_PATH=3D$(bad_dir) rustc exec.rs > ---------------------------------------------- > > This fails for us. So they expect =E2=80=98ld=E2=80=99 to properly deal with UTF-8 file names,= right? > strace yields: > > [pid 15059] open("/tmp/guix-build-rustc-1.16.0.drv-0/rustc-1.16.0-src/src= /test/run-make/linker-output-non-utf8/zzz?/liblibrary.a", O_RDONLY) =3D -1 = ENOENT (No such file or directory) > > But: > > /tmp/guix-build-rustc-1.16.0.drv-0/rustc-1.16.0-src/src/test/run-make/lin= ker-output-non-utf8 [env]$ ls zzz\377/liblibrary.a=20 > 'zzz'$'\377''/liblibrary.a' > > $ ls /tmp/guix-build-rustc-1.16.0.drv-0/rustc-1.16.0-src/src/test/run-mak= e/linker-output-non-utf8/zzz?/liblibrary.a > '/tmp/guix-build-rustc-1.16.0.drv-0/rustc-1.16.0-src/src/test/run-make/li= nker-output-non-utf8/zzz'$'\377''/liblibrary.a' > > How do we best proceed? This is another instance of the file name decoding problem with Guile. As you know, Guile 2.0/2.2 decodes file names according to the current locale, and =E2=80=98ld-wrapper=E2=80=99 runs Guile. However, on Guile 2.0 (current =E2=80=98master=E2=80=99) =E2=80=98ld-wrappe= r=E2=80=99 runs in the C locale because it does not explicitly call =E2=80=98setlocale=E2=80=99, hen= ce the question mark instead of \377 in the file name shown by strace. Fortunately, Guile 2.2 programs (current =E2=80=98core-updates=E2=80=99) al= ways start in the current locale. So I think the problem won=E2=80=99t exist in =E2=80=98core-updates=E2=80=99, as long as the build runs in a UTF-8 locale= (which is the case.) HTH! Ludo=E2=80=99.