Subject: Re: bug#33848: Store references in SBCL-compiled code are "invisible"

From: Ludovic Courtès <[email-masked]>
Date: Thu, 27 Dec 2018 22:54:36 +0100

Pierre Neidhardt <[email-masked]> skribis:

>> Every file in the store is properly scanned for references.  It’s just
>> that users cannot create top-level items with a non-ASCII file name.
>
> So if '/gnu/store/...-foo/á' is stored as UTF-8 in a binary, then it will be
> found?  Is it because the filesystem encoding is also UTF-8 and Guix scans over
> byte arrays?

The reference scanner, currently written in C++, traverses whole
directory trees.  Being C++ it treats file names as byte arrays so it
doesn’t matter what the file name encoding is.

Note also that the reference scanner only looks for “xyz…-foo”; what
comes before and after doesn’t matter.  So for example if you have
“/gnu/store/xyz…-foo/à”, what’s important is the “xyz…-foo” bit.

This is all happening in libstore/references.cc (which is surprisingly
small) and in (guix build graft) for the grafting part, which Mark wrote
a while back.

HTH,
Ludo’.