From: Maxime Devos <maximedevos@telenet.be>
To: Olivier Dion <olivier.dion@polymtl.ca>, 54780@debbugs.gnu.org
Subject: [bug#54780] [PATCH] gnu: lttng-ust: Fix dependencies.
Date: Sat, 09 Apr 2022 18:01:42 +0200 [thread overview]
Message-ID: <e89528f27447ac16f3add164417ba9280ad58ebf.camel@telenet.be> (raw)
In-Reply-To: <87fsmmuxq5.fsf@laura>
[-- Attachment #1: Type: text/plain, Size: 2985 bytes --]
Olivier Dion schreef op za 09-04-2022 om 10:40 [-0400]:
> On Sat, 09 Apr 2022, Maxime Devos <maximedevos@telenet.be> wrote:
> > Maxime Devos schreef op za 09-04-2022 om 11:11 [+0200]:
> > (define (excluded-input? input)
> > (directory-exists? (string-append store-item
> > "/include/linux"))))))
> [...]
> I assume that for glibc that's okay because the toolchain was built with
> '--with-native-system-header-dir=DIRNAME' or something like that.
Some remarks:
* Let 'foo' be a program depending on the C library 'bar' whose
headers include some headers from 'linux-libre-headers' and
'glibc'.
* Almost every C program includes some headers of glibc anyway,
so to compile the C program 'foo', you would need to have a glibc
in the environment anyway, so absoluting the references to glibc
headers doesn't bring much here.
* Even then, as you say, the toolchain is compiled with something
like that.
> I'm not sure if that's okay. What if the package require kernel's
> headers? Would this works if testing a custom kernel?
* Looking at the existence of $GUIX_ENVIRONMENT/include/linux when
doing "guix shell -D hello --pure", it looks like (a slightly
old version of) linux-libre-headers is included by default in the
build environment, so the package will have some kernel headers
automatically.
* Suppose that 'linux-libre-headers' was not excluded.
Suppose that 'bar' depends on 'linux-libre-headers', and hence some
inclusions were absolutised. Now suppose that 'foo' requires a
_newer_ linux-libre-headers, say linux-libre-headers@5.15 to
utilise some fancy new thing in Linux.
Suppose the source code is something like:
foo.c:
#include <bar.h>
#include <linux/stuff.h> --> absolutised to </...new-linux.../linux/stuff.h>
bar.h:
[standard include guard]
#include <linux/stuff.h> ---> absolutised to </...old-linux.../linux/stuff.h>
[standard include guard]
linux/stuff.h
[standard include guard]
[stuff depending on the linux-libre-headers version]
[standard include guard]
Then, what would happen when 'foo.c', is that at first,
the C compiler loads <bar.h>. It sees that old-linux/stuff.h
and loads it, including the include guard. The next thing it
sees is #include <linux/stuff.h>. But then the compiler
(mis)remembers, due to the include guard, that it included this
header already, so it will not include the _new_ <linux/stuff.h>
As such, foo.c would end up with the _old_ <linux/stuff.h>, even though
it needed the new stuff (new structs or such). By not absolutising the
<linux/...>, the compiler will just look for <linux/...> in C_INCLUDE_PATH,
and find the linux-libre-headers from lttng-ust's inputs.
So I'm a bit hesitant to including linux-libre-headers.
Greetings,
Maxime.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
next prev parent reply other threads:[~2022-04-09 16:02 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-08 0:18 [bug#54780] [PATCH] gnu: lttng-ust: Fix dependencies Olivier Dion via Guix-patches via
2022-04-08 14:04 ` Maxime Devos
2022-04-08 14:23 ` Olivier Dion via Guix-patches via
2022-04-08 14:28 ` Olivier Dion via Guix-patches via
2022-04-08 15:32 ` [bug#54780] (C include header depropagation) " Maxime Devos
2022-04-08 15:39 ` Maxime Devos
2022-04-08 15:59 ` Olivier Dion via Guix-patches via
2022-04-08 17:17 ` Olivier Dion via Guix-patches via
2022-04-08 19:41 ` Maxime Devos
2022-04-08 22:56 ` Olivier Dion via Guix-patches via
2022-04-08 23:15 ` [bug#54780] [PATCH v2 1/2] guix: build: Add absolute-inclusions.scm Olivier Dion via Guix-patches via
2022-04-21 16:46 ` [bug#54780] [PATCH v3 " Olivier Dion via Guix-patches via
2022-04-21 16:46 ` [bug#54780] [PATCH v3 2/2] gnu: packages: Use absolute headers inclusion Olivier Dion via Guix-patches via
2022-04-08 23:15 ` [bug#54780] [PATCH v2 " Olivier Dion via Guix-patches via
2022-04-09 9:11 ` [bug#54780] [PATCH] gnu: lttng-ust: Fix dependencies Maxime Devos
2022-04-09 9:13 ` Maxime Devos
2022-04-09 14:40 ` Olivier Dion via Guix-patches via
2022-04-09 16:01 ` Maxime Devos [this message]
2022-04-09 16:34 ` Olivier Dion via Guix-patches via
2022-04-08 15:23 ` Maxime Devos
2022-05-17 20:38 ` Olivier Dion via Guix-patches via
2022-06-14 21:26 ` bug#54780: " Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e89528f27447ac16f3add164417ba9280ad58ebf.camel@telenet.be \
--to=maximedevos@telenet.be \
--cc=54780@debbugs.gnu.org \
--cc=olivier.dion@polymtl.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.