unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Dominic Martinez <dom@dominicm.dev>
To: Daniel Sockwell <daniel@codesections.com>
Cc: "Thompson, David" <dthompson2@worcester.edu>, help-guix@gnu.org
Subject: Re: Understanding the Guix approach when language package managers are around
Date: Sat, 17 Sep 2022 12:10:47 -0400	[thread overview]
Message-ID: <87pmfu0wvs.fsf@dominicm.dev> (raw)
In-Reply-To: <c8d219a7480e0adb3a37601b48a4abc8@codesections.com>

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


"Daniel Sockwell" <daniel@codesections.com> writes:

> But isn't that something that Guix is really *good* at handling?
> My understanding is that one of Guix's selling points is that it
> allows package A to depend on both B and C even if B and C depend
> on different versions of D (aka, the diamond-dependency problem).
> So maybe Guix would be a better JavaScript package manager than
> NPM is!
>
> (Or am I confused about what you meant or how Guix works?)

Guix is great at solving the diamond dependency problem, but exactly
representing that dependency structure implies an exponential number of
package definitions. Usually packagers will try to find the minimal
number of package versions that satisfy the requirements of their
dependents, but when having multiple major versions of packages in your
dependency tree is practically a given, it's a lot of duplication.

Also consider that by default, module resolution is tied to the folder
structure of 'node_modules', so as Philip said we'd have to re-implement
PNPM's logic:
https://pnpm.io/motivation
https://npm.github.io/how-npm-works-docs/npm3/non-determinism.html
https://npm.github.io/how-npm-works-docs/npm3/duplication.html

>> I have a few fallbacks for when I can't work on a project in Guix:
>> ...
>> 2. Use Docker. A docker container with a volume linked to your code is
>> almost always seamless.
>
> Ah, that's a good option.  I experimented with some of Guix's --container
> options but didn't consider using docker directly.  I take it that's what
> you do?  Do you use docker compose and/or do anything to make your docker
> containers more functional/fit better with Guix?

If I'm just trying to have a more standard Linux environment I usually
don't feel the need to use docker compose. You can just have a script
that builds your environment, and another that launches the container in
a directory:

$ docker build -t <tag> - < <Dockerfile> # Build the image
$ docker run -it --rm -v ${1}:/src <tag> # Run the image, bringing in a directory

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

  reply	other threads:[~2022-09-17 16:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-16 13:15 Understanding the Guix approach when language package managers are around Daniel Sockwell
2022-09-16 15:36 ` Thompson, David
2022-09-16 16:57 ` Dominic Martinez
2022-09-16 22:16 ` Daniel Sockwell
2022-09-17 16:10   ` Dominic Martinez [this message]
2022-09-16 22:51 ` Philip McGrath

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=87pmfu0wvs.fsf@dominicm.dev \
    --to=dom@dominicm.dev \
    --cc=daniel@codesections.com \
    --cc=dthompson2@worcester.edu \
    --cc=help-guix@gnu.org \
    /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).