From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:55289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghW3P-00009F-2y for guix-patches@gnu.org; Thu, 10 Jan 2019 03:51:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghW3N-0007r7-78 for guix-patches@gnu.org; Thu, 10 Jan 2019 03:51:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:53642) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ghW3K-0007pp-JH for guix-patches@gnu.org; Thu, 10 Jan 2019 03:51:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ghW3K-0002ti-B8 for guix-patches@gnu.org; Thu, 10 Jan 2019 03:51:02 -0500 Subject: bug#33893: [PATCH v5 2/4] gnu: Add docker-engine. Resent-To: guix-patches@gnu.org Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20181230121754.775-1-dannym@scratchpost.org> <20181230233903.23426-1-dannym@scratchpost.org> <20181230233903.23426-3-dannym@scratchpost.org> <87pnt9y1v0.fsf@gnu.org> <20190107194455.69823f82@scratchpost.org> <87va2z1qxl.fsf@gnu.org> <20190110032210.1242af1f@scratchpost.org> Date: Thu, 10 Jan 2019 09:50:49 +0100 In-Reply-To: <20190110032210.1242af1f@scratchpost.org> (Danny Milosavljevic's message of "Thu, 10 Jan 2019 03:22:10 +0100") Message-ID: <87k1jcew0m.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Danny Milosavljevic Cc: 33893-done@debbugs.gnu.org Howdy! Danny Milosavljevic skribis: > On Tue, 08 Jan 2019 09:42:14 +0100 > Ludovic Court=C3=A8s wrote: > >> > Go has peculiar ideas of how the directory layout is supposed to be se= t up. >> > I could probably figure it out - but if someone with more Go knowledge= could >> > step forward it would be much faster.=20=20 >>=20 >> I see Leo is Cc=E2=80=99d so we=E2=80=99ll see. :-) > > Nevermind, I've fixed it and learned something in the process: > > Linux doesn't actually know the current working directory as a string. > It only knows the inode, so if you call getcwd, what libc actually does is > it opendirs "..", then finds the entry with the same inode number as > the current directory, and then returns the name of that entry. Are you sure? In the Linux port of glibc I see this: --8<---------------cut here---------------start------------->8--- char * __getcwd (char *buf, size_t size) { char *path; char *result; // [=E2=80=A6] retval =3D INLINE_SYSCALL (getcwd, 2, path, alloc_size); --8<---------------cut here---------------end--------------->8--- And indeed, there=E2=80=99s a =E2=80=98getcwd=E2=80=99 syscall: --8<---------------cut here---------------start------------->8--- $ strace -e getcwd guile -c '(getcwd)' getcwd("/home/ludo", 100) =3D 11 +++ exited with 0 +++ --8<---------------cut here---------------end--------------->8--- > Now, gopath uses symlinks to set up their preferred directory hierarchy > in such a way: > > ln -s ../../../.. .gopath/src/github.com/docker/docker > > Now if you chdir into ".gopath/src/github.com/docker/docker" and then Go = later > does getcwd, it will appear as if the chdir did not succeed (because it w= ill > just use the old working directory because it has the same inode). > > So Go was erroring out because the directory structure there was *still* = wrong. > > Solution: Set environment variable PWD to the correct name of the directo= ry. Great that you found a solution. Thanks for taking the time to address this! Ludo=E2=80=99.