Subject: [bug#41189] [PATCH 0/3] Add Fakechroot engine for 'guix pack -RR'

From: Carlos O'Donell <[email-masked]>
Date: Mon, 11 May 2020 17:18:04 -0400

"For example, some of the ‘open’ calls made in libc are notintercepted; 
on such call is in ‘__gconv_load_cache’, which makesit fail, and in 
turn makes Guile fail to start in its first‘scm_to_locale_string’ call."
-- Ludovic Courtès wrote on Mon May 11 19:05:54+0200 2020

There are two issues at hand:
* Standard namespace issues (conformance)
* PLT avoidance issues (performance)

See:
https://sourceware.org/glibc/wiki/Style_and_Conventions#Double-underscore_names_for_public_API_functions

It is an internal implementation detail that open(2) is being called by
the library, and as such glibc bypasses the ELF interposable symbol
open, and instead calls open directly without this being visible to the
application.

There are many such cases where we bypass the ELF interposable symbol to
provide standard namespace cleanliness, performance, and so provide consistent
behaviour.

Yes, in your case this means you cannot override the behaviour of the
interface without using some kind of bind mount, or mount namespace
(to provide an alternate view of the filesystem).

We would have to argue upstream that some minimal subset of the filesystem
access should be interposable via open/close/read/write, but that's going
to get difficult quickly and have significant performance problems.

It would be simpler, IMO, to set LOCPATH and GCONV_PATH appropriately and
alter the runtime behaviour that way. If that doesn't work, perhaps because
of setuid, then we can discuss further.

-- 
Cheers,
Carlos.