all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Chris Marusich <cmmarusich@gmail.com>
To: Hartmut Goebel <h.goebel@crazy-compilers.com>
Cc: guix-devel@gnu.org
Subject: Re: store reference detection (was Re: JARs and reference scanning)
Date: Sun, 07 May 2017 13:23:36 -0700	[thread overview]
Message-ID: <87zieotnzr.fsf@gmail.com> (raw)
In-Reply-To: <590F179B.4060306@crazy-compilers.com> (Hartmut Goebel's message of "Sun, 7 May 2017 14:48:27 +0200")

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

Hartmut Goebel <h.goebel@crazy-compilers.com> writes:

> Am 02.05.2017 um 14:43 schrieb Ludovic Courtès:
>> Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:
>>
>>> Am 27.04.2017 um 15:46 schrieb Ludovic Courtès:
>>>> ‘propagated-inputs’ is one way to manually specify run-time references.
>>>> It works at the package level and not at the store level—that is, the
>>>> store item’s references are unaffected by what ‘propagated-inputs’
>>>> contains.  It’s usually enough for our purposes though.
>>> I'm not sure if 'propagated-inputs' are enough. For example
>>> "python-passlib" as propagated-input python-py-bcrypt, but the later
>>> does not show up as reference, requisite nor referrer:
>> Right, that’s what I meant by “not at the store level” above.
>>
>> Ludo’.
>  So I propose to add a small text file ".guix-dependencies' to all
> language's packages which do not add some kind of references themselves:
> Python, Perl, Java, etc.

What is the goal of doing this?  If the goal is simply to make it so
that the daemon will know what references are live, I'm not sure it's
necessary, since the "propagated inputs" mechanism already accomplishes
that goal.

If the goal is to enable interpreters like Python, Perl, Java, etc. to
discover their program's dependencies (e.g., so Java can import
classes), then simply adding a .guix-dependencies file is not sufficient
by itself.  We would also need "something else" that (using the
.guix-dependencies file) arranges for the relevant interpreter to
discover those specified dependencies.  As far as I know, no design for
that "something else" has been proposed.

Currently, our options are limited because we are relying on the default
import mechanism for our interpreters.  For example, in the case of
Python, I believe we are using "propagated inputs" so that the default
import mechanism finds the modules.  (Please correct me if I'm
mistaken.)  If we were to modify the import mechanism, it might not be
necessary to use propagated inputs at all.

There are probably many ways to accomplish that.  For example, in Java,
perhaps we could implement a custom classloader.  Or maybe we could
patch the built-in class loading mechanism [1].  Similarly, in Python
there are also ways to customize the import mechanism [2].  Perhaps Perl
also has a similar mechanism?

This kind of low-level fiddling might sound drastic, but it isn't
without precedent.  Nix has already demonstrated that customizing the
dynamic linker [3] and the ELF executable files [4] is not a crazy idea.
In fact, Nix and Guix wouldn't work without such customizations.  So,
maybe it's time we thought about "fiddling" with the way these
interpreters (Java, Python, Perl, etc.) find their dependencies, too.

[1] These classes appear to be involved in the default loading process,
so they would be the place to start looking, I think:

  http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/share/classes/sun/misc/Launcher.java#l259
  http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/share/classes/java/net/URLClassLoader.java#l356
  http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/share/classes/sun/misc/URLClassPath.java#l62

[2] https://docs.python.org/3/reference/import.html#importsystem

[3]
https://sandervanderburg.blogspot.co.uk/2015/10/deploying-prebuilt-binary-software-with.html

[4] https://github.com/NixOS/patchelf

>
> Question: How can the builder access the "propagated" inputs only?

Can you clarify what you mean?  I don't understand the question, and I
don't want to assume you meant one thing when you actually meant
something different.

-- 
Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2017-05-07 20:23 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-13 11:29 Need help from Java-developers Hartmut Goebel
2017-04-23  8:41 ` Chris Marusich
2017-04-23 22:57   ` Chris Marusich
2017-04-25 19:28     ` JARs and reference scanning (was: Need help from Java-developers) Hartmut Goebel
2017-04-26  5:34       ` JARs and reference scanning Chris Marusich
2017-04-26 11:53         ` store reference detection (was Re: JARs and reference scanning) Thomas Danckaert
2017-04-26 19:31           ` Maxim Cournoyer
2017-04-27 13:46           ` Ludovic Courtès
2017-04-27 14:14             ` store reference detection Thomas Danckaert
2017-04-27 17:46             ` store reference detection (was Re: JARs and reference scanning) Hartmut Goebel
2017-05-02 12:43               ` Ludovic Courtès
2017-05-07 12:48                 ` Hartmut Goebel
2017-05-07 20:23                   ` Chris Marusich [this message]
2017-05-08  7:06                     ` Ricardo Wurmus
2017-05-08 14:11                       ` Ludovic Courtès
2017-05-11  8:41                       ` Chris Marusich
2017-05-11 11:27                         ` Ricardo Wurmus
2017-05-12  6:54                           ` Chris Marusich
2017-05-12  8:21                             ` Ricardo Wurmus
2017-05-12  9:35                         ` Hartmut Goebel
2017-05-12 18:22                           ` Mark H Weaver
2017-05-12 20:05                             ` Hartmut Goebel
2017-05-12 21:24                               ` Mark H Weaver
2017-05-12  6:18                   ` Mark H Weaver
2017-05-12  8:19                     ` Chris Marusich
2017-05-12  9:46                       ` store reference detection Hartmut Goebel
2017-05-12 17:39                       ` store reference detection (was Re: JARs and reference scanning) Mark H Weaver
2017-05-12 18:27                         ` Leo Famulari
2017-05-12 19:54                         ` Hartmut Goebel
2017-05-12 21:51                           ` Mark H Weaver
2017-05-13  7:15                             ` Hartmut Goebel
2017-05-23  7:29                               ` Chris Marusich
2017-04-25  8:44   ` Need help from Java-developers Ricardo Wurmus

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=87zieotnzr.fsf@gmail.com \
    --to=cmmarusich@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=h.goebel@crazy-compilers.com \
    /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.