Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lua5.3, lua5.4 - package cleanups and rebuild #34985

Merged
merged 6 commits into from
Nov 25, 2024

Conversation

smoser
Copy link
Member

@smoser smoser commented Nov 22, 2024

  • lua5.4 - updates to package and a rebuild.

    A build of lua5.4 right now will not 'provide: so:liblua5.4.so' due
    to /usr/lib/liblua* being symlinks.
    We need a build Consider symlinks as potential provides for so: chainguard-dev/melange#1662
    to fix that.

    Other things here are:

    • build 5.4 with V=5.4 (not V=5.3)
    • build 5.4 with compath for 5.3 not the non-existant 5.2
      https://gitlab.alpinelinux.org/alpine/aports/-/issues/13257
    • split libs out from the main package
      (main package will get a dep on the libs so that will be fine)
    • rename patches in lua5.4/ to not be redundantly lua-5.4-thing
    • define and use a var 'luaMM' for the major.minor everywhere.
    • use one patch section with 3 patches rather than 3 patch sections
    • do not install liblua.la
    • improve tests a bit to check for version in '-v' output
    • add a test to make sure lua5.4-libs provides the desired so:
    • fix typo in configure.ac (top_builddir, not 'top_buildir').
  • lua5.3 - apply the same changes, but leave it building with linenoise
    instead of readline.

A build of lua5.4 right now will not 'provide: so:liblua5.4.so' due
to /usr/lib/liblua* being symlinks.
We need a build chainguard-dev/melange#1662
to fix that.

Other things here are:
 * build 5.4 with V=5.4 (not V=5.3)
 * build 5.4 with compath for 5.3 not the non-existant 5.2
   https://gitlab.alpinelinux.org/alpine/aports/-/issues/13257
 * split libs out from the main package
   (main package will get a dep on the libs so that will be fine)
 * rename patches in lua5.4/ to not be redundantly lua-5.4-thing
 * define and use a var 'luaMM' for the major.minor everywhere.
 * use one patch section with 3 patches rather than 3 patch sections
 * do not install liblua.la
 * improve tests a bit to check for version in '-v' output
 * add a test to make sure lua5.4-libs provides the desired so:
 * fix typo in configure.ac (top_builddir, not 'top_buildir').
@octo-sts octo-sts bot added the bincapz/pass bincapz/pass Bincapz (aka. malcontent) scan didn't detect any CRITICALs on the scanned packages. label Nov 22, 2024
@smoser
Copy link
Member Author

smoser commented Nov 22, 2024

OK, I'm going to write a summary of the lua5.4/rrdtool madness here.

  1. recent builds of lua5.4 do no not provide so:liblua-5.4.so.0=0 as they should. That is the install layout where they install their libraries in /usr/lib/lua5.4/ and provide symlinks to those in /usr/lib. melange SCA ignored the symlinks and ignored the actual libraries for provides consideration because those libraries are not in /usr/lib. That is fixed Consider symlinks as potential provides for so: chainguard-dev/melange#1662 . The melange change is making its way into builds (currently used in GHA but not elastic builds).

A rebuild, and a test to ensure the so is provided is included in this PR.

  1. rrdtool build is currently badly broken. It contains a package 'lua-rrd' which contains nothing other than the libraries from the liblua5.4 that it used in it's build environment. The old versions of lua-rrd (1.8.0-r0) were identified as providing so:liblua-5.4.so.0=0 because they were built with a melange that did not limit libraries for provides to /usr/lib.

The fix for rrdtool is #34944 . They depend on the lua5.4 rebuild so they can install.

  1. As a result of 1 and 2 above, anything that has a runtime dependency on liblua5.4 gets some random behavior on installation, etiher picking an old version of lua5.4 or an old version of rrdtool. One such example is apache2: Move conf to /etc/apache2/ instead of /etc #34554 .

To get this resolved we will

  1. wait until elastic builds has melange code at v0.15.13 or later
  2. update / sync this PR to rebuild
  3. land this PR (lua5.3, lua5.4 - package cleanups and rebuild #34985)
  4. update / sync rrdtool - do include lua5.4 libs, withdraw rrdtool-1.8.0-r0, other cleanups #34944
  5. update / sync apache2: Move conf to /etc/apache2/ instead of /etc #34554

@smoser smoser added the staging-build If this label is set on a PR, it will be built by elastic-build in staging label Nov 22, 2024
Copy link
Member

@xnox xnox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit too verbose and too generic, but it is fine.

@smoser smoser merged commit 13e95f5 into wolfi-dev:main Nov 25, 2024
22 checks passed
@smoser
Copy link
Member Author

smoser commented Nov 25, 2024

A bit too verbose and too generic, but it is fine.

I'm interested in some more info on that.
General changes, line numbers for lua5.4

  1. [56-72] Pass -DLUA_COMPAT_<LAST_VERSION> and validate that maybe it will do something.
  2. [153-177] Validate that the lua provides the correct so:. I added this to make sure it wouldn't land until melange was fixed. I can see it viewed as knee-jerk response to specific bug.
  3. [182-192] verify 'lua -v' outputs contains expected version. This is as short as you can do this in shell without false positives or false negatives.
  4. use ${{vars.luaMM}} everywhere.

I agree that testing in shell is long, error-prone, hard to read and hard to write. I want to fix that with sane re-usable testing tools written in a sane language.

@smoser
Copy link
Member Author

smoser commented Nov 25, 2024

✅ 1. wait until elastic builds has melange code at v0.15.13 or later
✅ 2. update / sync this PR to rebuild
✅ 3. land this PR (lua5.3, lua5.4 - package cleanups and rebuild #34985)
✅ 4. update / sync rrdtool - do include lua5.4 libs, withdraw rrdtool-1.8.0-r0, other cleanups #34944
✅ 5. update / sync apache2: Move conf to /etc/apache2/ instead of /etc #34554

After #34944 landed, i ran withdraw workflow here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bincapz/pass bincapz/pass Bincapz (aka. malcontent) scan didn't detect any CRITICALs on the scanned packages. staging-build If this label is set on a PR, it will be built by elastic-build in staging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants