unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: Pierre Neidhardt <mail@ambrevar.xyz>, guix-devel@gnu.org
Subject: GNOME in Guix
Date: Mon, 2 Nov 2020 11:17:31 +0100	[thread overview]
Message-ID: <20201102111731.772e4f7a@scratchpost.org> (raw)
In-Reply-To: <875z6o19uq.fsf@ambrevar.xyz>

[-- Attachment #1: Type: text/plain, Size: 3162 bytes --]

Hi,

On Mon, 02 Nov 2020 08:44:29 +0100
Pierre Neidhardt <mail@ambrevar.xyz> wrote:

> Danny Milosavljevic <dannym@scratchpost.org> writes:
> > Not much more works yet because I've hit this (design) bug in Guix and/or GNOME:
> >
> > * https://github.com/spk121/guile-gi/issues/96  
> 
> Have you tried g-golf?  The Nomad browser uses it, it may not suffer
> from the aforementioned issue.
> Thoughts on that?

It really depends on what you mean.  If it also uses gobject-introspection, it
will have the same problem.

Even gobject-introspection links to glib internally, then registers a class in
that, THEN opens (potentially another) glib at runtime using dlopen in the same
address same.
I'm pretty sure that GNOME is not designed for that.  If you then use the
dlopened glib to use the first-mentioned class, good luck with that.

The only reason it didn't fall onto the head of users of other distributions
is because those don't support internal dependencies of packages at all--so
you always have to update all in lockstep.  So the following can only happen
in Guix:

If a library A has an input Q, and library B has the same input Q, and you
use A and B in your program, and then you (guix-) update just B to use Q'
(for example a newer version of Q) and recompile your program, then you have
both Q and Q' in your process address space!

Q is an internal dependency of A, and by coincidence it's an internal
dependency of B, too. Just because the internal dependency of B changed
shouldn't change the internal depenency of A--that's what "internal"
means.

Otherwise the modules aren't really modular (because they then don't isolate
from each other).

I think that the gobject type registry does not consider that it can happen
to have to classes with the same class name, registered in respective
internal dependencies.  The objects of the internal dependency shouldn't
be available to the outside program in the first place.

That means actually we should propagate a lot of GNOME inputs, which means
in practice what a regular user has in his profile will be very much like
in other distributions, and internal dependencies will become a weird corner
feature nobody uses.

Does anyone know how to make dlopen fail on duplicate global variables?

I tried to make it fail but I can't get it to work:

I tried:

File d1.c contains:
int x;

File d2.c contains:
int x;

File a.c contains:

#include <stdio.h>
#include <dlfcn.h>

// https://stackoverflow.com/questions/43582165/handling-global-variables-in-shared-object

int main() {
        if (!dlopen("./d1.so", RTLD_NOW | RTLD_GLOBAL /*| RTLD_DEEPBIND*/)) {
                fprintf(stderr, "dlerror: %s\n", dlerror());
                return 1;
        }
        if (!dlopen("./d2.so", RTLD_NOW | RTLD_GLOBAL /*| RTLD_DEEPBIND*/)) {
                fprintf(stderr, "dlerror: %s\n", dlerror());
                return 2;
        }
        return 0;
}

Then I do:

$ gcc -fPIC -shared -Wl,--export-dynamic -o d1.so d1.c
$ gcc -fPIC -shared -Wl,--export-dynamic -o d2.so d2.c
$ gcc a.c -ldl
$ ./a.out
$ echo $?
0

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-11-02 10:18 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-29 16:25 Guix Front End (GUI) and making it more mainstream, popular in scientific community Aniket Patil
2020-10-29 18:22 ` jbranso
2020-10-29 18:38   ` Pierre Neidhardt
2020-11-01 21:46     ` Ludovic Courtès
2020-11-02  7:40       ` Pierre Neidhardt
2020-11-02  8:27         ` Jan Nieuwenhuizen
2020-10-29 18:45   ` jbranso
2020-11-02  7:41     ` Pierre Neidhardt
2020-10-29 19:15 ` zimoun
2020-10-30  8:49   ` Lars-Dominik Braun
2020-11-01 21:53     ` Ludovic Courtès
2020-11-02 10:03       ` Taylan Kammer
2020-11-02 10:24       ` Gtk via the web Danny Milosavljevic
2020-11-03  9:54         ` aviva
2020-11-03 13:31         ` Ludovic Courtès
2020-10-29 19:34 ` Guix Front End (GUI) and making it more mainstream, popular in scientific community Danny Milosavljevic
2020-11-01 22:09   ` Ludovic Courtès
2020-11-02  7:44   ` Pierre Neidhardt
2020-11-02 10:17     ` Danny Milosavljevic [this message]
2020-11-06  9:41       ` GNOME in Guix Pierre Neidhardt
  -- strict thread matches above, loose matches on Subject: below --
2020-11-02 13:51 Leo Prikler
2020-11-03  9:14 ` Danny Milosavljevic
2020-11-03 13:41   ` Leo Prikler
2020-11-03 19:26     ` Danny Milosavljevic
2020-11-03 23:20       ` Leo Prikler
2020-11-04  8:08         ` Danny Milosavljevic
2020-11-04  9:45           ` Leo Prikler
2020-11-04 13:43             ` Danny Milosavljevic
2020-11-04 14:02               ` Leo Prikler
2020-11-06  9:55   ` Pierre Neidhardt

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201102111731.772e4f7a@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=guix-devel@gnu.org \
    --cc=mail@ambrevar.xyz \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).