[PATCH] gnu: lua: compile with readline support

  • Open
  • quality assurance status badge
Details
2 participants
  • kimapr
  • Vagrant Cascadian
Owner
unassigned
Submitted by
kimapr
Severity
normal

Debbugs page

kimapr wrote 7 days ago
(address . guix-patches@gnu.org)
c6f7f6d3-6c9b-4862-ae9e-0357218082ab@mail.ru
* gnu/packages/lua.scm (lua)[arguments]: change target to
  "linux-readline".
---
 gnu/packages/lua.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (16 lines)
diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
index 4c65bcbf12..b3d4cbf5d2 100644
--- a/gnu/packages/lua.scm
+++ b/gnu/packages/lua.scm
@@ -109,7 +109,7 @@ (define-public lua
              (string-append "CC=" ,(cc-for-target))
              (string-append "SYSLIBS=-L" (assoc-ref %build-inputs
"readline")
                             "/lib")
-             "linux")
+             "linux-readline")
        #:phases
        (modify-phases %standard-phases
          (delete 'configure)
--
2.47.1
Vagrant Cascadian wrote 37 hours ago
87h64033mv.fsf@wireframe
On 2025-03-05, kimapr wrote:
Toggle quote (23 lines)
> * gnu/packages/lua.scm (lua)[arguments]: change target to
>   "linux-readline".
> ---
>  gnu/packages/lua.scm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
> index 4c65bcbf12..b3d4cbf5d2 100644
> --- a/gnu/packages/lua.scm
> +++ b/gnu/packages/lua.scm
> @@ -109,7 +109,7 @@ (define-public lua
>               (string-append "CC=" ,(cc-for-target))
>               (string-append "SYSLIBS=-L" (assoc-ref %build-inputs
> "readline")
>                              "/lib")
> -             "linux")
> +             "linux-readline")
>         #:phases
>         (modify-phases %standard-phases
>           (delete 'configure)
> --
> 2.47.1

Patch was slightly malformed for some reason, but being a one-liner, was
easy to apply manually!

At first glance, it increases the results from guix size only slightly
from 77.0MB to 84.4MB, and has a smallish number of dependents...

But lua@5.1 lua@5.2 and lua@5.3 inherit from lua, so the impact is much
larger than a quick glance suggests (especially lua@5.3):

$ guix refresh --list-dependent lua@5.1 lua@5.2 lua@5.3 lua@5.4
Building the following 359 packages would ensure 604 dependent
packages are rebuilt: grafx2@2.4 hedgewars@1.0.2 btanks@0.9.8083
crawl-tiles@0.32.1 fillets-ng@1.0.1 ...

I did successfully build lua@5.4 and it's four dependents.


Changes which affect more than 300 dependent packages (see Invoking guix
refresh) should first be pushed to a topic branch other than master

Would it make sense to exclude the older versions from the change? Then
it could go to the git master banch, in my opinion.


live well,
vagrant
-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCZ89r2QAKCRDcUY/If5cW
qmzAAP98dxHzZi0dEfmKfmJfEcrsBUFU+y9pycyRHQtXUf7sqQD7BUNVkc6mtdVj
3wz/XZXPoftubm0sIZb4g2hkqEn5FQY=
=2zBB
-----END PGP SIGNATURE-----

Vagrant Cascadian wrote 37 hours ago
87ecz431ez.fsf@wireframe
On 2025-03-10, Vagrant Cascadian wrote:
Toggle quote (7 lines)
> On 2025-03-05, kimapr wrote:
> At first glance, it increases the results from guix size only slightly
> from 77.0MB to 84.4MB, and has a smallish number of dependents...
>
> But lua@5.1 lua@5.2 and lua@5.3 inherit from lua, so the impact is much
> larger than a quick glance suggests (especially lua@5.3):

Oops, I had this slightly wrong... lua-5.1, lua-5.2 and lua-5.4 inherit
from lua (which is effectively lua@5.3).

Toggle quote (3 lines)
> Would it make sense to exclude the older versions from the change? Then
> it could go to the git master banch, in my opinion.

In fact versions 5.1, 5.2 and 5.3 do not support this option passed to
make at all, and fail to build with the patch applied!

I just checked that lua@5.3, lua@5.2 and lua@5.1 all do support
readline, so it is only lua@5.4 that does not currently have readline
support.

So the patch needs to be re-worked ot only apply to lua-5.4. But then
should be able to be pushed directly as it does not have many
dependents.


live well,
vagrant
-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCZ893FAAKCRDcUY/If5cW
qtxZAQCibjr6rGEqWsLQv7r2WUBZqDP3xPQfzH+UdHjr/kRGXAEAs62jcOaZ7BGt
kmCZr6PY7ukwHV0N4kylpq0QXGHBJAM=
=GzY5
-----END PGP SIGNATURE-----

kimapr wrote 29 hours ago
(address . 76770@debbugs.gnu.org)(name . Vagrant Cascadian)(address . vagrant@debian.org)
4c7e55c4-9457-47c9-a90a-eb6c0fe4e430@mail.ru
On 2025/03/11 04:34, Vagrant Cascadian wrote:
Toggle quote (4 lines)
> So the patch needs to be re-worked ot only apply to lua-5.4. But then
> should be able to be pushed directly as it does not have many
> dependents.

I have done this, however my email client is very evil and keeps messing up my formatting no matter what I try so sending the patch without malforming it proves difficult. (word-wrapping, randomly deleting spaces, i thought i disabled the former but it's still doing it and the latter simply makes no sense in any context)

This is a problem to solve later (by using a different client), for now I will just send the patch in base64 instead to protect it against my evil email client:

RnJvbSA1MjcxOTYwNzZjZWM2MmIxNTk3Zjk2NTA1MmRjMmJhMWNkYTdlYzQyIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBLaW1hcHIgPGtpbWFwckBtYWlsLnJ1PgpEYXRlOiBUdWUsIDEx
IE1hciAyMDI1IDExOjQzOjM0ICswNTAwClN1YmplY3Q6IFtQQVRDSF0gZ251OiBsdWEtNS40OiBj
b21waWxlIHdpdGggcmVhZGxpbmUgc3VwcG9ydAoKKiBnbnUvcGFja2FnZXMvbHVhLnNjbSAobHVh
LTUuNClbYXJndW1lbnRzXTogY2hhbmdlIHRhcmdldCB0bwogICJsaW51eC1yZWFkbGluZSIuCi0t
LQogZ251L3BhY2thZ2VzL2x1YS5zY20gfCA2ICsrKysrKwogMSBmaWxlIGNoYW5nZWQsIDYgaW5z
ZXJ0aW9ucygrKQoKZGlmZiAtLWdpdCBhL2dudS9wYWNrYWdlcy9sdWEuc2NtIGIvZ251L3BhY2th
Z2VzL2x1YS5zY20KaW5kZXggNGM2NWJjYmYxMi4uMGU0NWFmMTJhMiAxMDA2NDQKLS0tIGEvZ251
L3BhY2thZ2VzL2x1YS5zY20KKysrIGIvZ251L3BhY2thZ2VzL2x1YS5zY20KQEAgLTEzNCw2ICsx
MzQsMTIgQEAgKGRlZmluZS1wdWJsaWMgbHVhCiAoZGVmaW5lLXB1YmxpYyBsdWEtNS40CiAgIChw
YWNrYWdlIChpbmhlcml0IGx1YSkKICAgICAgICAgICAgKHZlcnNpb24gIjUuNC42IikKKyAgICAg
ICAgICAgKGFyZ3VtZW50cworICAgICAgICAgICAgKHN1YnN0aXR1dGUta2V5d29yZC1hcmd1bWVu
dHMgKHBhY2thZ2UtYXJndW1lbnRzIGx1YSkKKyAgICAgICAgICAgICAgKCgjOm1ha2UtZmxhZ3Mg
ZmxhZ3MpCisgICAgICAgICAgICAgICAoYXBwZW5kIChsaXN0LWhlYWQgZmxhZ3MKKyAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAoLSAobGVuZ3RoIGZsYWdzKSAxKSkKKyAgICAgICAg
ICAgICAgICAgICAgICAgJygibGludXgtcmVhZGxpbmUiKSkpKSkKICAgICAgICAgICAgKHNvdXJj
ZSAob3JpZ2luCiAgICAgICAgICAgICAgICAgICAgICAobWV0aG9kIHVybC1mZXRjaCkKICAgICAg
ICAgICAgICAgICAgICAgICh1cmkgKHN0cmluZy1hcHBlbmQgImh0dHBzOi8vd3d3Lmx1YS5vcmcv
ZnRwL2x1YS0iCi0tIAoyLjQ4LjEKCg==
Vagrant Cascadian wrote 13 hours ago
87bju717th.fsf@wireframe
On 2025-03-11, kimapr wrote:
Toggle quote (11 lines)
> On 2025/03/11 04:34, Vagrant Cascadian wrote:
>> So the patch needs to be re-worked ot only apply to lua-5.4. But then
>> should be able to be pushed directly as it does not have many
>> dependents.
>
> I have done this, however my email client is very evil and keeps
> messing up my formatting no matter what I try so sending the patch
> without malforming it proves difficult. (word-wrapping, randomly
> deleting spaces, i thought i disabled the former but it's still doing
> it and the latter simply makes no sense in any context)

In the future you could also submit the patch as an attachment generated
with "git format-patch"? I should hope your client doesn't mangle
attachements!


Toggle quote (4 lines)
> This is a problem to solve later (by using a different client), for
> now I will just send the patch in base64 instead to protect it against
> my evil email client:

Nice workaround! :)

For completeness, I have attached the version decoded from base64...

And Also tested that it builds it's dependents:

$ ./pre-inst-env guix build --keep-going --max-jobs=2 --dependents lua
guix build: computing dependents of package lua@5.4.6...
/gnu/store/sv4q1qms1mahs7vsxpk83n62sgilvsnd-lua-5.4.6
/gnu/store/95iazlx13k0mvr63qyxn0y87fiyg7s0x-wesnoth-server-1.18.3
/gnu/store/jifrzb3pd084sd4zjlpypiyznykxpx89-wesnoth-1.18.3
/gnu/store/a91sbgmhr4gfw843rckzcpzxi7ahz3kn-darktable-5.0.1
/gnu/store/qpf4nryf3pjwq31x5kp2n70s0j4kzi47-lite-xl-2.1.3

I tested that it does not trigger rebuilds of other lua versions, and
does enable readline support on lua@5.4 ... so it works!

I am not sure I fully wrap my head around the guile code used to
accomplish this, but that is likely just me... so someone a little more
savvy should still review that bit...


live well,
vagrant
From 02d15b2a9d59354c2f53605278bf5eea074b9a4e Mon Sep 17 00:00:00 2001
From: Kimapr <kimapr@mail.ru>
Date: Tue, 11 Mar 2025 11:43:34 +0500
Subject: [PATCH] gnu: lua-5.4: compile with readline support

* gnu/packages/lua.scm (lua-5.4)[arguments]: change target to
"linux-readline".
---
gnu/packages/lua.scm | 6 ++++++
1 file changed, 6 insertions(+)

Toggle diff (21 lines)
diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
index 4c65bcbf12..0e45af12a2 100644
--- a/gnu/packages/lua.scm
+++ b/gnu/packages/lua.scm
@@ -134,6 +134,12 @@ (define-public lua
(define-public lua-5.4
(package (inherit lua)
(version "5.4.6")
+ (arguments
+ (substitute-keyword-arguments (package-arguments lua)
+ ((#:make-flags flags)
+ (append (list-head flags
+ (- (length flags) 1))
+ '("linux-readline")))))
(source (origin
(method url-fetch)
(uri (string-append "https://www.lua.org/ftp/lua-"

base-commit: 1b7fb5e3f97271ed4264dc9eed7bbc286e9635a3
--
2.39.5
-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCZ9DDKwAKCRDcUY/If5cW
qij+AQDd+5QVydF0EboIRUPVA2ya5Xl7vQ1aXko9d6ggj2mNsgEA29E+uOu3Qd7I
7ooncNWXqFwbVQF/BG31c84ffYnG+QE=
=BNt3
-----END PGP SIGNATURE-----

Vagrant Cascadian wrote 12 hours ago
878qpb152f.fsf@wireframe
On 2025-03-11, Vagrant Cascadian wrote:
Toggle quote (5 lines)
> On 2025-03-11, kimapr wrote:
>> On 2025/03/11 04:34, Vagrant Cascadian wrote:
>>> So the patch needs to be re-worked ot only apply to lua-5.4. But then
>>> should be able to be pushed directly as it does not have many
>>> dependents.
...
Toggle quote (26 lines)
> From 02d15b2a9d59354c2f53605278bf5eea074b9a4e Mon Sep 17 00:00:00 2001
> From: Kimapr <kimapr@mail.ru>
> Date: Tue, 11 Mar 2025 11:43:34 +0500
> Subject: [PATCH] gnu: lua-5.4: compile with readline support
>
> * gnu/packages/lua.scm (lua-5.4)[arguments]: change target to
> "linux-readline".
> ---
> gnu/packages/lua.scm | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
> index 4c65bcbf12..0e45af12a2 100644
> --- a/gnu/packages/lua.scm
> +++ b/gnu/packages/lua.scm
> @@ -134,6 +134,12 @@ (define-public lua
> (define-public lua-5.4
> (package (inherit lua)
> (version "5.4.6")
> + (arguments
> + (substitute-keyword-arguments (package-arguments lua)
> + ((#:make-flags flags)
> + (append (list-head flags
> + (- (length flags) 1))
> + '("linux-readline")))))

I guess this could stand to use a comment in the code explaining what it
is doing and why. I *think* I understand what it is doing... but that is
largely guessing on my part. :)

This does make it a little fragile if the ordering of the #:make-flags
on the inherited package change or have new values appended.


live well,
vagrant
-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCZ9DRGAAKCRDcUY/If5cW
qnK2AQCgWHb8PUQ2lM4ysc1C6Q6d1sXhE8ETvuZcJizm7810NgEAiErs9EkHnGxR
9CN0EovOqQoALk1yJ3zpy2karg2UgwU=
=nO6D
-----END PGP SIGNATURE-----

?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 76770@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 76770
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help