unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: Sam Halliday <sam.halliday@gmail.com>
Cc: help-guix@gnu.org
Subject: Re: some questions about GUIX
Date: Thu, 31 Dec 2015 10:30:12 +0100	[thread overview]
Message-ID: <871ta3artn.fsf@elephly.net> (raw)
In-Reply-To: <87lh8cvz1v.fsf@gmail.com>


Sam Halliday <sam.halliday@gmail.com> writes:

> Does this mean that you have a GUIX package for every jar?

Some packages may provide more than one jar archive.  This depends on
what the build system prescribes.  For every *project* there will be at
least one jar, though.

> If so, can
> you have multiple versions of the same jar installed at the same time?

Yes!  This is a core feature enabled by functional package management.
We treat packages as if they were pure functions in that the exact same
set of inputs (source tarballs, compilers, libraries, and their own
inputs, and the inputs of those inputs, etc...) produces the exact same
output.  Instead of computing the output from scratch each time we want
to use the value (e.g. as an input to another package or in a profile)
we can cache or memoise it.  We do this by storing the unique output
artifact for a given bag of inputs in /gnu/store; outputs are prefixed
with a unique hash that is computed from all inputs.

Installing a package then is little more than the act of linking
individual items from the store into a profile.  We can store any
package output in /gnu/store because they all have their very own
directory; they don’t overlap.  Thus we can install/link different
versions into different profiles.
 
> Support for multiple versions of a library will be necessary as it is
> not always a simple case of bumping the version to use a library: many
> libraries introduce breaking changes at both source and binary level.

Correct.  We don’t have a problem with this as we never install anything
into a “global” namespace (such as /usr, /lib, or whatever).

> Will you be using the same version names as the official upstream
> binaries? I strongly recommend against doing this. The convention in
> corporate environments is that rebuilds of jars incur a postfix to their
> version. E.g. a rebuild of guava 18.0 (even with no changes to the
> sources) would be 18.0-guix1. Of course, there is no way for you to know
> that jars are not being loaded by name at runtime through the
> classloader, so you introduce further opportunity for bugs here.

FWIW Debian builds Java libraries from sources, too, and they do not
rename the resulting jars.

There is really no need to do that in Guix anyway, because installing
these jars is not going to affect global state — they are not installed
in well-known global directories, so they cannot be “picked up” by
accident.

There is, of course, one potential issue with building Java stuff on
Guix that I haven’t assessed yet.  I don’t yet know if there’s something
in the Java world that’s similar to the RUNPATH feature in native
applications, or if visibility of jars is determined exclusively by the
clunky CLASSPATH environment variable instead.  If there is no way to
“link” jars explicitly by their full path, then dependencies need to be
propagated and applications may need to be wrapped in an appropriate
CLASSPATH, which is somewhat inelegant, but not a real problem.  (This
is done for Python, R, Perl, and Ruby applications in Guix already,
because these languages control module visibility primarily through
environment variables.)

      parent reply	other threads:[~2015-12-31  9:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-26 15:36 some questions about GUIX Sam Halliday
2015-12-29 15:00 ` Ludovic Courtès
2015-12-29 15:40   ` Sam Halliday
2015-12-29 19:11     ` Ricardo Wurmus
2015-12-29 19:46       ` Leo Famulari
2015-12-29 23:10       ` Ludovic Courtès
2015-12-29 23:35       ` Sam Halliday
2015-12-31  9:50         ` Ricardo Wurmus
2015-12-30 13:36       ` Sam Halliday
2015-12-31  2:02         ` Leo Famulari
2015-12-31  2:17           ` Leo Famulari
2015-12-31 12:46           ` Sam Halliday
2016-01-01 14:45             ` Ludovic Courtès
2015-12-31  9:30         ` Ricardo Wurmus [this message]

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=871ta3artn.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=help-guix@gnu.org \
    --cc=sam.halliday@gmail.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.
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).