unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#54304] [PATCH] Don't fix git executable location during Elixir build
@ 2022-03-08 20:52 Cees de Groot
  2022-03-08 22:16 ` Maxime Devos
                   ` (3 more replies)
  0 siblings, 4 replies; 25+ messages in thread
From: Cees de Groot @ 2022-03-08 20:52 UTC (permalink / raw)
  To: 54304

The removed code below affected two locations where Elixir uses Git:

* At build-time, Git is used to see if the build is inside a Git repo and if so, git info
  is added to the build information that Elixir returns with `System.build_info()`. The code
  uses PATH + `git` so the Git version from the inputs is used which is just fine.
* At run-time, Git is used by Mix if, and only if, there are any Git-based dependencies. This
  is not the normal case, and in that sense Git is an optional dependency of Elixir - most
  projects will work just fine without Git being present. Here, too, PATH + `git` is used
  so if there is a need on a user's system to use Git-based dependencies, the user can just
  add the package to the profile and things will just work.

I feel that leaving this alone is cleaner than trying to fix the dependency (if we want to
keep it, it needs to be in propagated-inputs in order to keep Git around; I stumbled upon
this building a project with Git dependencies after doing a `guix gc`. However, given that
using Git dependencies is the exception and I think that minimizing dependencies is nicer
I opted to just remove the substition completely).

---
 gnu/packages/elixir.scm | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/gnu/packages/elixir.scm b/gnu/packages/elixir.scm
index 55e17f2901..f509c59ee3 100644
--- a/gnu/packages/elixir.scm
+++ b/gnu/packages/elixir.scm
@@ -60,11 +60,6 @@ (define-public elixir
               (for-each make-file-writable (find-files "."))))
           (add-after 'make-git-checkout-writable 'replace-paths
             (lambda* (#:key inputs #:allow-other-keys)
-              (substitute* '("lib/elixir/lib/system.ex"
-                             "lib/mix/lib/mix/scm/git.ex")
-                (("(cmd\\(['\"])git" _ prefix)
-                 (string-append prefix
-                                (search-input-file inputs "/bin/git"))))
               (substitute* '("lib/mix/lib/mix/release.ex"
                              "lib/mix/lib/mix/tasks/release.init.ex")
                 (("#!/bin/sh")
--
2.34.0





^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [bug#54304] [PATCH] Don't fix git executable location during Elixir build
  2022-03-08 20:52 [bug#54304] [PATCH] Don't fix git executable location during Elixir build Cees de Groot
@ 2022-03-08 22:16 ` Maxime Devos
  2022-03-09 17:35   ` Cees de Groot
  2022-03-08 22:17 ` Maxime Devos
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 25+ messages in thread
From: Maxime Devos @ 2022-03-08 22:16 UTC (permalink / raw)
  To: Cees de Groot, 54304

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

Cees de Groot schreef op di 08-03-2022 om 20:52 [+0000]:
> I feel that leaving this alone is cleaner than trying to fix the dependency (if we want to
> keep it, it needs to be in propagated-inputs in order to keep Git around;

Instead of propagation, I recommend substitution, like done currently.
Propagation is not necessary to ‘keep git around’ (assuming that the
store reference is not obfuscated by gzipping or the like).

If it's used at build-time instead of run-time, then git should be
moved to native-inputs, for cross-compilation reasons.

Greetings,
Maxime

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#54304] [PATCH] Don't fix git executable location during Elixir build
  2022-03-08 20:52 [bug#54304] [PATCH] Don't fix git executable location during Elixir build Cees de Groot
  2022-03-08 22:16 ` Maxime Devos
@ 2022-03-08 22:17 ` Maxime Devos
       [not found]   ` <OtG7oZgFz6vgVWUbmqcU-n34hv-sQCpJYpJKR7rdQvIDnB1sUh_1LoUl9egvv6vKWH_THdYl9gwPrzwzXx_FnxlPXJHaB3D70jY32T3oMuk=@evrl.com>
  2022-03-08 22:18 ` Maxime Devos
  2022-03-08 22:22 ` Maxime Devos
  3 siblings, 1 reply; 25+ messages in thread
From: Maxime Devos @ 2022-03-08 22:17 UTC (permalink / raw)
  To: Cees de Groot, 54304

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

Cees de Groot schreef op di 08-03-2022 om 20:52 [+0000]:
> * At build-time, Git is used to see if the build is inside a Git repo and if so, git info

That cannot ever have worked in the first place, since Guix does not
save the '.git' directory when downloading elixir's source code.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#54304] [PATCH] Don't fix git executable location during Elixir build
  2022-03-08 20:52 [bug#54304] [PATCH] Don't fix git executable location during Elixir build Cees de Groot
  2022-03-08 22:16 ` Maxime Devos
  2022-03-08 22:17 ` Maxime Devos
@ 2022-03-08 22:18 ` Maxime Devos
  2022-03-08 22:22 ` Maxime Devos
  3 siblings, 0 replies; 25+ messages in thread
From: Maxime Devos @ 2022-03-08 22:18 UTC (permalink / raw)
  To: Cees de Groot, 54304

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

Cees de Groot schreef op di 08-03-2022 om 20:52 [+0000]:
>   uses PATH + `git` so the Git version from the inputs is used which is just fine.

Due to cross-compilation reasons, this is not fine, it should use the
git from native-inputs instead.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#54304] [PATCH] Don't fix git executable location during Elixir build
  2022-03-08 20:52 [bug#54304] [PATCH] Don't fix git executable location during Elixir build Cees de Groot
                   ` (2 preceding siblings ...)
  2022-03-08 22:18 ` Maxime Devos
@ 2022-03-08 22:22 ` Maxime Devos
  2022-03-09 17:31   ` Cees de Groot
  3 siblings, 1 reply; 25+ messages in thread
From: Maxime Devos @ 2022-03-08 22:22 UTC (permalink / raw)
  To: Cees de Groot, 54304

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

Cees de Groot schreef op di 08-03-2022 om 20:52 [+0000]:
> * At run-time, Git is used by Mix if, and only if, there are any Git-based dependencies. This
>   is not the normal case, and in that sense Git is an optional dependency of Elixir - most
>   projects will work just fine without Git being present. Here, too, PATH + `git` is used
>   so if there is a need on a user's system to use Git-based dependencies, the user can just
>   add the package to the profile and things will just work.

If it's optional and not used most of the time, removing
it seems fine to me, though this seems useful information for the
description.  Also, it would be nice if 'elixir' were patched
to emit a nice message when 'git' is not found.  Suggestion:

  This project required 'git', but it is not in $PATH.  It can be
  installed into the user profile with `guix install git`.

You might want to contact whoever added the substitution originally,
to see what the original reasons were.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#54304] [PATCH] Don't fix git executable location during Elixir build
       [not found]   ` <OtG7oZgFz6vgVWUbmqcU-n34hv-sQCpJYpJKR7rdQvIDnB1sUh_1LoUl9egvv6vKWH_THdYl9gwPrzwzXx_FnxlPXJHaB3D70jY32T3oMuk=@evrl.com>
@ 2022-03-09  7:31     ` Maxime Devos
  2022-03-09 17:29       ` Cees de Groot
  0 siblings, 1 reply; 25+ messages in thread
From: Maxime Devos @ 2022-03-09  7:31 UTC (permalink / raw)
  To: Cees de Groot; +Cc: 54304

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

Cees de Groot schreef op wo 09-03-2022 om 02:39 [+0000]:
> > [...]
> > That cannot ever have worked in the first place, since Guix
> > does not save the '.git' directory when downloading elixir's source
> > code.

> That’s correct and fine. The info is informational at most  

How can being completely broken be correct and fine?

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#54304] [PATCH] Don't fix git executable location during Elixir build
  2022-03-09  7:31     ` Maxime Devos
@ 2022-03-09 17:29       ` Cees de Groot
  0 siblings, 0 replies; 25+ messages in thread
From: Cees de Groot @ 2022-03-09 17:29 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 54304

From the docs:

":revision - short Git revision hash. If Git was not available at building time, it is set to """ (https://hexdocs.pm/elixir/System.html#build_info/0)

So if git is not available - either because the executable is not there or because the build checkout is not from Git, the revision hash is set to the empty string, which is in accordance with the docs and what the Guix build has been doing all along (because, as you said, at build time, .git isn't there).

So for build time, cross-compiling or not, we don't need Git.

------- Original Message -------

On Wednesday, March 9th, 2022 at 02:31, Maxime Devos <maximedevos@telenet.be> wrote:

> Cees de Groot schreef op wo 09-03-2022 om 02:39 [+0000]:
>
> > > [...]
> > >
> > > That cannot ever have worked in the first place, since Guix
> > >
> > > does not save the '.git' directory when downloading elixir's source
> > >
> > > code.
>
> > That’s correct and fine. The info is informational at most
>
> How can being completely broken be correct and fine?
>
> Greetings,
>
> Maxime.




^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#54304] [PATCH] Don't fix git executable location during Elixir build
  2022-03-08 22:22 ` Maxime Devos
@ 2022-03-09 17:31   ` Cees de Groot
  2022-03-09 19:45     ` Maxime Devos
  0 siblings, 1 reply; 25+ messages in thread
From: Cees de Groot @ 2022-03-09 17:31 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 54304

I think changing the behaviour of a programming language just to be helpful to developers is something that one may consider for upstream, but certainly not in the context of a packaging system like Guix - that just will breed confusion.

As it is, the error message thrown by Elixir when Git is not there is very easy to interpret for developers (and _only_ at development time can this happen!), no need to go overboard here. Unless, of course, you think it is useful to submit an upstream patch, feel free to do so.

------- Original Message -------

On Tuesday, March 8th, 2022 at 17:22, Maxime Devos <maximedevos@telenet.be> wrote:

> Cees de Groot schreef op di 08-03-2022 om 20:52 [+0000]:
>
> > * At run-time, Git is used by Mix if, and only if, there are any Git-based dependencies. This
> >
> >   is not the normal case, and in that sense Git is an optional dependency of Elixir - most
> >
> >   projects will work just fine without Git being present. Here, too, PATH + `git` is used
> >
> >   so if there is a need on a user's system to use Git-based dependencies, the user can just
> >
> >   add the package to the profile and things will just work.
>
> If it's optional and not used most of the time, removing
>
> it seems fine to me, though this seems useful information for the
>
> description. Also, it would be nice if 'elixir' were patched
>
> to emit a nice message when 'git' is not found. Suggestion:
>
> This project required 'git', but it is not in $PATH. It can be
>
> installed into the user profile with `guix install git`.
>
> You might want to contact whoever added the substitution originally,
>
> to see what the original reasons were.
>
> Greetings,
>
> Maxime.




^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#54304] [PATCH] Don't fix git executable location during Elixir build
  2022-03-08 22:16 ` Maxime Devos
@ 2022-03-09 17:35   ` Cees de Groot
  2022-03-09 17:59     ` Tobias Geerinckx-Rice via Guix-patches via
  0 siblings, 1 reply; 25+ messages in thread
From: Cees de Groot @ 2022-03-09 17:35 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 54304

> Propagation is not necessary to ‘keep git around’ (assuming that the

Well.... the whole reason that I stumbled upon this was that the compile-time substitution referred to a Git version that got GC'd. And I think that that is the different between regular inputs and propagated inputs, whether inputs become eligible for GC at run-time or not. If I'm misunderstanding something there, something else caused that version of Git to get GC'd and I'd be more than happy to be corrected in my assumptions.




^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#54304] [PATCH] Don't fix git executable location during Elixir build
  2022-03-09 17:35   ` Cees de Groot
@ 2022-03-09 17:59     ` Tobias Geerinckx-Rice via Guix-patches via
  2022-03-09 21:01       ` Cees de Groot
  0 siblings, 1 reply; 25+ messages in thread
From: Tobias Geerinckx-Rice via Guix-patches via @ 2022-03-09 17:59 UTC (permalink / raw)
  To: Cees de Groot, Maxime Devos; +Cc: 54304

On 9 March 2022 17:35:25 UTC, Cees de Groot <cg@evrl.com> wrote:
>> Propagation is not necessary to ‘keep git around’ (assuming that the
>
>Well.... the whole reason that I stumbled upon this was that the compile-time substitution referred to a Git version that got GC'd.

This simply Should Not happen.  Guix's GC model (inherited from Nix) is brutally simple: if the raw string /gnu/store/xxx occurs anywhere within a protected /gnu/store/yyy (e.g. in a binary), then xxx is also protected, recursively.

Assuming those assumptions hold here it's a 'mystery' why git got GC'd.  From experience and for our collective peace of mind I'd say it's more likely that they didn't hold somehow, than that there's a serious GC bug :-)

> And I think that that is the different between regular inputs and propagated inputs, whether inputs become eligible for GC at run-time or not.

So, no.  Completely unrelated.  The GC has no concept of time at all.  This isn't Gentoo.

Propagated inputs are 'oh, here's this extra thing I was unable to properly patch, please add it to the profile and treat it as a GC reference anyway'.

This is ugly and regular, non-propagated inputs are always preferred.  Some software just makes them too painful.
Cees,

Kind regards,

T G-R

Sent on the go.  Excuse or enjoy my brevity.




^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#54304] [PATCH] Don't fix git executable location during Elixir build
  2022-03-09 17:31   ` Cees de Groot
@ 2022-03-09 19:45     ` Maxime Devos
  0 siblings, 0 replies; 25+ messages in thread
From: Maxime Devos @ 2022-03-09 19:45 UTC (permalink / raw)
  To: Cees de Groot; +Cc: 54304

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

Cees de Groot schreef op wo 09-03-2022 om 17:31 [+0000]:
> I think changing the behaviour of a programming language just to be helpful to developers

Developers are users too and users can be developers.  Furthermore,
Elixir is an implementation of a programming language, so aren't all
users of Elixir automatically developers?

I'm not sure how exactly Elixir integrates with git but I assume the
integration can be very useful.

Also, this does not change the behaviour of the language, it only
adjusts a detail of the implementation: the error message for
indicating that git is missing is adjusted.

>  is something that one may consider for upstream, but certainly not in the context
>  of a packaging system like Guix - that just will breed confusion.

How could better error messages breed confusion?

Also, this seems a change that would absolutely _not_ be considered
upstream.  Why would upstream have distro-specific error messages?  If
the new error message is Guix-specific, wouldn't Guix be the logical
place to have it?

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#54304] [PATCH] Don't fix git executable location during Elixir build
  2022-03-09 17:59     ` Tobias Geerinckx-Rice via Guix-patches via
@ 2022-03-09 21:01       ` Cees de Groot
  2022-03-09 21:49         ` Tobias Geerinckx-Rice via Guix-patches via
  0 siblings, 1 reply; 25+ messages in thread
From: Cees de Groot @ 2022-03-09 21:01 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: 54304, Maxime Devos

On Wednesday, March 9th, 2022 at 12:59, Tobias Geerinckx-Rice <me@tobias.gr> wrote:

> This simply Should Not happen. Guix's GC model (inherited from Nix) is brutally simple: if the raw string /gnu/store/xxx occurs anywhere within a protected /gnu/store/yyy (e.g. in a binary), then xxx is also protected, recursively.

So how does Guix figure out what to keep and what not? I mean, in this case the patched string will land in a compiled .BEAM file which very well may have the string obfuscated (I need to check how the VM stores strings in binaries).




^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#54304] [PATCH] Don't fix git executable location during Elixir build
  2022-03-09 21:01       ` Cees de Groot
@ 2022-03-09 21:49         ` Tobias Geerinckx-Rice via Guix-patches via
  2022-03-11 21:33           ` Cees de Groot
  0 siblings, 1 reply; 25+ messages in thread
From: Tobias Geerinckx-Rice via Guix-patches via @ 2022-03-09 21:49 UTC (permalink / raw)
  To: Cees de Groot; +Cc: 54304, Maxime Devos

Cees,

Yeah, this happens sometimes and will hide these references from what is a simple and therefore very fast string search.

It's why we install uncompressed .jar files and disable an obscure (and arguably unnoticable) GCC optimisation that hacks strings into incontiguous chunks.  If BEAM somehow obfuscates store references we'll have to find a similar work-around to stop it.  Let us know what you find.

Kind regards,

T G-R

Sent on the go.  Excuse or enjoy my brevity.




^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#54304] [PATCH] Don't fix git executable location during Elixir build
  2022-03-09 21:49         ` Tobias Geerinckx-Rice via Guix-patches via
@ 2022-03-11 21:33           ` Cees de Groot
  2022-03-11 21:51             ` Ludovic Courtès
  0 siblings, 1 reply; 25+ messages in thread
From: Cees de Groot @ 2022-03-11 21:33 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: 54304, Maxime Devos


On Wednesday, March 9th, 2022 at 16:49, Tobias Geerinckx-Rice <me@tobias.gr> wrote:
> If BEAM somehow obfuscates store references we'll have to find a similar work-around to stop it. Let us know what you find.
>
Yup. BEAM files have literals stored in a single Deflated blob (https://beam-wisdoms.clau.se/en/latest/indepth-beam-file.html). So the scanning won't work.

Which means that either my patches should be merged or Git should be propagated. I'm not a super big fan of propagating optional dependencies, which is why I submitted the patch like this.




^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#54304] [PATCH] Don't fix git executable location during Elixir build
  2022-03-11 21:33           ` Cees de Groot
@ 2022-03-11 21:51             ` Ludovic Courtès
  2022-03-11 21:57               ` Maxime Devos
  0 siblings, 1 reply; 25+ messages in thread
From: Ludovic Courtès @ 2022-03-11 21:51 UTC (permalink / raw)
  To: Cees de Groot; +Cc: 54304, Tobias Geerinckx-Rice, Maxime Devos

Hi,

Cees de Groot <cg@evrl.com> skribis:

> On Wednesday, March 9th, 2022 at 16:49, Tobias Geerinckx-Rice <me@tobias.gr> wrote:
>> If BEAM somehow obfuscates store references we'll have to find a similar work-around to stop it. Let us know what you find.
>>
> Yup. BEAM files have literals stored in a single Deflated blob (https://beam-wisdoms.clau.se/en/latest/indepth-beam-file.html). So the scanning won't work.

If we know what set of store references go in those blogs, we could
create a text file or something in #$output whose sole purpose is to
keep a reference to those store items.

For example, if we know those BEAM files contain a reference to Git, we
can add a phase like:

  (lambda* (#:key inputs outputs #:allow-other-keys)
    (symlink (search-input-file inputs "git")
             (string-append (assoc-ref output "out")
                            "/libexec/elixir/.git")))

That way the GC will keep Git around.

Thoughts?

Ludo’.




^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#54304] [PATCH] Don't fix git executable location during Elixir build
  2022-03-11 21:51             ` Ludovic Courtès
@ 2022-03-11 21:57               ` Maxime Devos
  2022-03-11 22:01                 ` Cees de Groot
  2022-03-13 22:14                 ` Ludovic Courtès
  0 siblings, 2 replies; 25+ messages in thread
From: Maxime Devos @ 2022-03-11 21:57 UTC (permalink / raw)
  To: Ludovic Courtès, Cees de Groot; +Cc: 54304, Tobias Geerinckx-Rice

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

Ludovic Courtès schreef op vr 11-03-2022 om 22:51 [+0100]:
> If we know what set of store references go in those blogs, we could
> create a text file or something in #$output whose sole purpose is to
> keep a reference to those store items.
> 
> For example, if we know those BEAM files contain a reference to Git, we
> can add a phase like:
> 
>   (lambda* (#:key inputs outputs #:allow-other-keys)
>     (symlink (search-input-file inputs "git")

Doesn't that need to be "bin/git" instead of "git"?

>              (string-append (assoc-ref output "out")
>                             "/libexec/elixir/.git")))
> 
> That way the GC will keep Git around.
>
> Thoughts?

That is not sufficient if git acquires a graft.

Can elixir be patched to not compress the literals table (*)?
Alternatively, does deflate have some kind of "compression
level=0" setting -- perhaps we could do the same trick as
done for JARs?

(*) Preferably submitted upstream in some form, maybe with a
configuration flag?

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#54304] [PATCH] Don't fix git executable location during Elixir build
  2022-03-11 21:57               ` Maxime Devos
@ 2022-03-11 22:01                 ` Cees de Groot
  2022-03-11 22:11                   ` Maxime Devos
  2022-03-13 22:14                 ` Ludovic Courtès
  1 sibling, 1 reply; 25+ messages in thread
From: Cees de Groot @ 2022-03-11 22:01 UTC (permalink / raw)
  To: Maxime Devos, Ludovic Courtès; +Cc: 54304, Tobias Geerinckx-Rice

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

Can’t we just run the patch? Then everything works just fine. I’m a full time Elixir developer and I can guarantee you that nothing will break :)

Sent from ProtonMail for iOS

On Fri, Mar 11, 2022 at 16:57, Maxime Devos <maximedevos@telenet.be> wrote:

> Ludovic Courtès schreef op vr 11-03-2022 om 22:51 [+0100]:
>> If we know what set of store references go in those blogs, we could
>> create a text file or something in #$output whose sole purpose is to
>> keep a reference to those store items.
>>
>> For example, if we know those BEAM files contain a reference to Git, we
>> can add a phase like:
>>
>> (lambda* (#:key inputs outputs #:allow-other-keys)
>> (symlink (search-input-file inputs "git")
>
> Doesn't that need to be "bin/git" instead of "git"?
>
>> (string-append (assoc-ref output "out")
>> "/libexec/elixir/.git")))
>>
>> That way the GC will keep Git around.
>>
>> Thoughts?
>
> That is not sufficient if git acquires a graft.
>
> Can elixir be patched to not compress the literals table (*)?
> Alternatively, does deflate have some kind of "compression
> level=0" setting -- perhaps we could do the same trick as
> done for JARs?
>
> (*) Preferably submitted upstream in some form, maybe with a
> configuration flag?
>
> Greetings,
> Maxime.

[-- Attachment #2: Type: text/html, Size: 1742 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#54304] [PATCH] Don't fix git executable location during Elixir build
  2022-03-11 22:01                 ` Cees de Groot
@ 2022-03-11 22:11                   ` Maxime Devos
  2022-03-11 22:36                     ` Cees de Groot
  0 siblings, 1 reply; 25+ messages in thread
From: Maxime Devos @ 2022-03-11 22:11 UTC (permalink / raw)
  To: Cees de Groot, Ludovic Courtès; +Cc: 54304, Tobias Geerinckx-Rice

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

Cees de Groot schreef op vr 11-03-2022 om 22:01 [+0000]:
> Can’t we just run the patch? Then everything works just fine. I’m a
> full time Elixir developer and I can guarantee you that nothing will
> break :)

FWIW, I'm not convinced of the value of removing 'git', as I don't
expect a significant decrease in closure size and it makes Elixir a
little less usable (only a tiny bit because git can be installed
manually, but still a bit).

The only remaining reasons for removing it, appear to be avoiding
having to tackle the reference obfuscating issue -- sooner or later
(*), I expect there will eventually be an elixir-build-system and a few
elixir packages.  These elixir packages might need a few 'substitute*'-
style hardcoding.  So eventually, I expect the issue will reappear
again and frequently at that, so we might as well try to fix it now.

(*) Especially since there's an Elixir developer in Guix!

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#54304] [PATCH] Don't fix git executable location during Elixir build
  2022-03-11 22:11                   ` Maxime Devos
@ 2022-03-11 22:36                     ` Cees de Groot
  2022-03-11 22:45                       ` Maxime Devos
  2022-03-11 23:16                       ` Maxime Devos
  0 siblings, 2 replies; 25+ messages in thread
From: Cees de Groot @ 2022-03-11 22:36 UTC (permalink / raw)
  To: Maxime Devos, Ludovic Courtès; +Cc: 54304, Tobias Geerinckx-Rice

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

Well, feel free to do the patching work. Realize that you are going to do work for a) a very small group of developers (Elixir is a small language and Guix isn’t hardly a widely spread system to begin with), b) a subset of those that need git dependencies, and c) a subset of _those_ that need these dependencies on a project source tree that itself was not checked out with git (otherwise the git executable will already be in the environment and everything will work).

Please let me know when you found that unicorn developer :)

Sent from ProtonMail for iOS

On Fri, Mar 11, 2022 at 17:11, Maxime Devos <maximedevos@telenet.be> wrote:

> Cees de Groot schreef op vr 11-03-2022 om 22:01 [+0000]:
>> Can’t we just run the patch? Then everything works just fine. I’m a
>> full time Elixir developer and I can guarantee you that nothing will
>> break :)
>
> FWIW, I'm not convinced of the value of removing 'git', as I don't
> expect a significant decrease in closure size and it makes Elixir a
> little less usable (only a tiny bit because git can be installed
> manually, but still a bit).
>
> The only remaining reasons for removing it, appear to be avoiding
> having to tackle the reference obfuscating issue -- sooner or later
> (*), I expect there will eventually be an elixir-build-system and a few
> elixir packages. These elixir packages might need a few 'substitute*'-
> style hardcoding. So eventually, I expect the issue will reappear
> again and frequently at that, so we might as well try to fix it now.
>
> (*) Especially since there's an Elixir developer in Guix!
>
> Greetings,
> Maxime.

[-- Attachment #2: Type: text/html, Size: 2021 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#54304] [PATCH] Don't fix git executable location during Elixir build
  2022-03-11 22:36                     ` Cees de Groot
@ 2022-03-11 22:45                       ` Maxime Devos
  2022-03-11 22:55                         ` Cees de Groot
  2022-03-11 23:16                       ` Maxime Devos
  1 sibling, 1 reply; 25+ messages in thread
From: Maxime Devos @ 2022-03-11 22:45 UTC (permalink / raw)
  To: Cees de Groot, Ludovic Courtès; +Cc: 54304, Tobias Geerinckx-Rice

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

Cees de Groot schreef op vr 11-03-2022 om 22:36 [+0000]:
> Well, feel free to do the patching work. Realize that you are going
> to do work for a) a very small group of developers (Elixir is a small
> language and Guix isn’t hardly a widely spread system to begin with),
> b) a subset of those that need git dependencies, and c) a subset of
> _those_ that need these dependencies on a project source tree that
> itself was not checked out with git (otherwise the git executable
> will already be in the environment and everything will work). 

This is not only for the subset that uses git dependencies.  It is for
anyone writing and using Elixir packages, see my paragraph about
reference baking (in general, not git-specific):

> The only remaining reasons for removing it, appear to be avoiding
> having to tackle the reference obfuscating issue -- sooner or later
> (*), I expect there will eventually be an elixir-build-system and a
> few elixir packages. These elixir packages might need a few
> 'substitute*'- style hardcoding. So eventually, I expect the issue
> will reappear again and frequently at that, so we might as well try
> to fix it now.

More specifically, you could look at how, say, 'info-reader' uses
'substitute*', 'search-input-file', 'gunzip' and 'gzip'

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#54304] [PATCH] Don't fix git executable location during Elixir build
  2022-03-11 22:45                       ` Maxime Devos
@ 2022-03-11 22:55                         ` Cees de Groot
  0 siblings, 0 replies; 25+ messages in thread
From: Cees de Groot @ 2022-03-11 22:55 UTC (permalink / raw)
  To: Maxime Devos, Ludovic Courtès; +Cc: 54304, Tobias Geerinckx-Rice

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

If Guix ever gets elixir packages, that can be tackled.

I’m bowing out of this discussion. If my patch gets accepted then all good, if not, I’ll move it to my private channel and keep being happy there.

Sent from ProtonMail for iOS

On Fri, Mar 11, 2022 at 17:45, Maxime Devos <maximedevos@telenet.be> wrote:

> Cees de Groot schreef op vr 11-03-2022 om 22:36 [+0000]:
>> Well, feel free to do the patching work. Realize that you are going
>> to do work for a) a very small group of developers (Elixir is a small
>> language and Guix isn’t hardly a widely spread system to begin with),
>> b) a subset of those that need git dependencies, and c) a subset of
>> _those_ that need these dependencies on a project source tree that
>> itself was not checked out with git (otherwise the git executable
>> will already be in the environment and everything will work).
>
> This is not only for the subset that uses git dependencies. It is for
> anyone writing and using Elixir packages, see my paragraph about
> reference baking (in general, not git-specific):
>
>> The only remaining reasons for removing it, appear to be avoiding
>> having to tackle the reference obfuscating issue -- sooner or later
>> (*), I expect there will eventually be an elixir-build-system and a
>> few elixir packages. These elixir packages might need a few
>> 'substitute*'- style hardcoding. So eventually, I expect the issue
>> will reappear again and frequently at that, so we might as well try
>> to fix it now.
>
> More specifically, you could look at how, say, 'info-reader' uses
> 'substitute*', 'search-input-file', 'gunzip' and 'gzip'
>
> Greetings,
> Maxime.

[-- Attachment #2: Type: text/html, Size: 2099 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#54304] [PATCH] Don't fix git executable location during Elixir build
  2022-03-11 22:36                     ` Cees de Groot
  2022-03-11 22:45                       ` Maxime Devos
@ 2022-03-11 23:16                       ` Maxime Devos
  2022-03-11 23:23                         ` Cees de Groot
  1 sibling, 1 reply; 25+ messages in thread
From: Maxime Devos @ 2022-03-11 23:16 UTC (permalink / raw)
  To: Cees de Groot, Ludovic Courtès; +Cc: 54304, Tobias Geerinckx-Rice

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

Cees de Groot schreef op vr 11-03-2022 om 22:36 [+0000]:
> Well, feel free to do the patching work.

I'm just here reviewing things, looking for possible better
alternatives, etc.

>  Realize that you are going to do work for a) a very small group of
> developers (Elixir is a small language and Guix isn’t hardly a widely
> spread system to begin with), b) a subset of those that need git
> dependencies, and c) a subset of _those_ that need these dependencies
> on a project source tree that itself was not checked out with git
> (otherwise the git executable will already be in the environment and
> everything will work). 
> 
> Please let me know when you found that unicorn developer :)

a) You're an Elixir developer, using Guix, and doing packaging work for
   Elixir in Guix.  Also, how is the popularity of Guix relevant on
   guix-patches@, and how is the popularity of Elixir relevant when
   this whole patch is about improving the Elixir package?
b) does not seem relevant to me, see other e-mails (about removing a
   feature not worth the decrease in closure size IMO, and about
   non-git references)
c) It's a bit niche; it would be a very nice thing of Guix to support
   that niche.

   Also, being checked out with git does not imply that git is
   in the environment, it's possible to first set up a git repository
   and later enter a pure environment for development (guix shell --
   pure elixir elixir-foo elixir-bar).  I often do this (not with
   elixir, but with some other packages).

TBC, what do you mean with ‘unicorn developer’ here?

a) someone implementing this
b) someone in the subset

If (a), I was kind of hinting that you seem to be in a perfect position
to do so (you're an Elixir developer (*) in Guix and you seem to have
some knowledge of the serialisation formats).

(*) I'm assuming "Elixir developer" = "a developer of the Elixir
implementation" here.

> If Guix ever gets elixir packages, that can be tackled. 
> 
> I’m bowing out of this discussion. If my patch gets accepted then all
> good, if not, I’ll move it to my private channel and keep being happy
> there. 

Ok, but I'm a bit confused on why you don't seem interested in fixing
the reference issue and why you write ‘ever’ instead of ‘when’ because
you're both an Elixir and Guix developer.  (You don't have to answer,
not answering is fine.)

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#54304] [PATCH] Don't fix git executable location during Elixir build
  2022-03-11 23:16                       ` Maxime Devos
@ 2022-03-11 23:23                         ` Cees de Groot
  0 siblings, 0 replies; 25+ messages in thread
From: Cees de Groot @ 2022-03-11 23:23 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 54304, Ludovic Courtès, Tobias Geerinckx-Rice

On Friday, March 11th, 2022 at 18:16, Maxime Devos <maximedevos@telenet.be> wrote:

> Ok, but I'm a bit confused on why you don't seem interested in fixing  the reference issue [...]

I am interested in fixing the bug in the current package. And, I'm quite honest there, I'm in itch-scratching mode so I'm not interested in fixing potential, future, maybe issues :). My patch works, and yes, I'm more than happy to improve and iterate on it _if_ - and to me, that's a very big if - more issues appear.







^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#54304] [PATCH] Don't fix git executable location during Elixir build
  2022-03-11 21:57               ` Maxime Devos
  2022-03-11 22:01                 ` Cees de Groot
@ 2022-03-13 22:14                 ` Ludovic Courtès
  2022-03-13 22:16                   ` Cees de Groot
  1 sibling, 1 reply; 25+ messages in thread
From: Ludovic Courtès @ 2022-03-13 22:14 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 54304, Tobias Geerinckx-Rice, Cees de Groot

Hi,

Maxime Devos <maximedevos@telenet.be> skribis:

> Ludovic Courtès schreef op vr 11-03-2022 om 22:51 [+0100]:
>> If we know what set of store references go in those blogs, we could
>> create a text file or something in #$output whose sole purpose is to
>> keep a reference to those store items.
>> 
>> For example, if we know those BEAM files contain a reference to Git, we
>> can add a phase like:
>> 
>>   (lambda* (#:key inputs outputs #:allow-other-keys)
>>     (symlink (search-input-file inputs "git")
>
> Doesn't that need to be "bin/git" instead of "git"?
>
>>              (string-append (assoc-ref output "out")
>>                             "/libexec/elixir/.git")))
>> 
>> That way the GC will keep Git around.
>>
>> Thoughts?
>
> That is not sufficient if git acquires a graft.

Argh, good point.

Now, I agree with Cees that we need to be pragmatic here and opt for a
“good enough” solution.

So I went ahead and applied the initial patch that Cees posted.

However, that ‘replace-paths’ phase also touches references to /bin/sh;
are they also a problem after GC?

Thanks,
Ludo’.




^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#54304] [PATCH] Don't fix git executable location during Elixir build
  2022-03-13 22:14                 ` Ludovic Courtès
@ 2022-03-13 22:16                   ` Cees de Groot
  0 siblings, 0 replies; 25+ messages in thread
From: Cees de Groot @ 2022-03-13 22:16 UTC (permalink / raw)
  To: Ludovic Courtès, Maxime Devos; +Cc: 54304, Tobias Geerinckx-Rice

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

These references only touch shell scripts so I think they should be just fine. I’ll give it a look when I’m back at work after the weekend to be sure though.

Sent from ProtonMail for iOS

On Sun, Mar 13, 2022 at 18:14, Ludovic Courtès <ludo@gnu.org> wrote:

> However, that ‘replace-paths’ phase also touches references to /bin/sh;
> are they also a problem after GC?
>
> Thanks,
> Ludo’.

[-- Attachment #2: Type: text/html, Size: 731 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2022-03-13 22:18 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-08 20:52 [bug#54304] [PATCH] Don't fix git executable location during Elixir build Cees de Groot
2022-03-08 22:16 ` Maxime Devos
2022-03-09 17:35   ` Cees de Groot
2022-03-09 17:59     ` Tobias Geerinckx-Rice via Guix-patches via
2022-03-09 21:01       ` Cees de Groot
2022-03-09 21:49         ` Tobias Geerinckx-Rice via Guix-patches via
2022-03-11 21:33           ` Cees de Groot
2022-03-11 21:51             ` Ludovic Courtès
2022-03-11 21:57               ` Maxime Devos
2022-03-11 22:01                 ` Cees de Groot
2022-03-11 22:11                   ` Maxime Devos
2022-03-11 22:36                     ` Cees de Groot
2022-03-11 22:45                       ` Maxime Devos
2022-03-11 22:55                         ` Cees de Groot
2022-03-11 23:16                       ` Maxime Devos
2022-03-11 23:23                         ` Cees de Groot
2022-03-13 22:14                 ` Ludovic Courtès
2022-03-13 22:16                   ` Cees de Groot
2022-03-08 22:17 ` Maxime Devos
     [not found]   ` <OtG7oZgFz6vgVWUbmqcU-n34hv-sQCpJYpJKR7rdQvIDnB1sUh_1LoUl9egvv6vKWH_THdYl9gwPrzwzXx_FnxlPXJHaB3D70jY32T3oMuk=@evrl.com>
2022-03-09  7:31     ` Maxime Devos
2022-03-09 17:29       ` Cees de Groot
2022-03-08 22:18 ` Maxime Devos
2022-03-08 22:22 ` Maxime Devos
2022-03-09 17:31   ` Cees de Groot
2022-03-09 19:45     ` Maxime Devos

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).