Skip to content

lua.tests.checkSetupHook: test lua setup hook for http package#300905

Merged
flokli merged 2 commits intoNixOS:stagingfrom
teto:teto/fix-lua-setup-hook
Apr 2, 2024
Merged

lua.tests.checkSetupHook: test lua setup hook for http package#300905
flokli merged 2 commits intoNixOS:stagingfrom
teto:teto/fix-lua-setup-hook

Conversation

@teto
Copy link
Member

@teto teto commented Apr 2, 2024

Fixes #286822 (comment)

the 'http' package is an interesting one to test because all its lua
files are in a 'http' subfolder, ie., there is no share/lua/5.1/.lua,
only share/lua/5.1/http/
.lua files unlike most packages. This tests we
can match those subfolders.

Will retarget against staging before merge

Description of changes

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added the 6.topic: lua Lua is a powerful, efficient, lightweight, embeddable scripting language. label Apr 2, 2024
@teto teto mentioned this pull request Apr 2, 2024
13 tasks
Copy link
Contributor

@GaetanLepage GaetanLepage left a comment

Choose a reason for hiding this comment

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

LGTM

@ofborg ofborg bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 2501-5000 This PR causes many rebuilds on Darwin and should target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Apr 2, 2024
@teto teto marked this pull request as draft April 2, 2024 09:19
@teto teto changed the base branch from master to staging April 2, 2024 09:19
@github-actions github-actions bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Apr 2, 2024
teto added 2 commits April 2, 2024 11:20
the 'http' package is an interesting one to test because all its lua
files are in a 'http' subfolder, ie., there is no share/lua/5.1/*.lua,
only share/lua/5.1/http/*.lua files unlike most packages. This tests we
can match those subfolders.
the setup-hook checks if a derivation contains lua files matching
lua_path patterns. We use bash's globstar extension for that but
`**.lua` doesn't return files in subfolders, it has to be `**/*.lua`.
Adjust the pattern accordingly.
@teto teto force-pushed the teto/fix-lua-setup-hook branch from 37f5aca to c55b4db Compare April 2, 2024 09:20
@github-actions github-actions bot removed the 6.topic: python Python is a high-level, general-purpose programming language. label Apr 2, 2024
@teto teto requested review from lolbinarycat and vcunat April 2, 2024 09:34
@teto teto marked this pull request as ready for review April 2, 2024 09:35
@flokli
Copy link
Member

flokli commented Apr 2, 2024

LGTM too. Also successfully built knot-resolver too.

Let's land this. I'll leave it up to @vcunat to possibly cherrypick this into staging-next in case channels are blocked without this fix.

@flokli flokli merged commit f7ae598 into NixOS:staging Apr 2, 2024
@vcunat
Copy link
Member

vcunat commented Apr 2, 2024

That iteration of staging-next is in master already, and knot-resolver got a workaround that at least lets you use it without luajitPackages.http (as most people don't use it, I think).

@flokli
Copy link
Member

flokli commented Apr 2, 2024

For posterity: 4cad050 and 11fd363.

@vcunat With this now merged, can you open a PR reverting the workaround to staging-next (and link to here)?

@vcunat
Copy link
Member

vcunat commented Apr 2, 2024

I certainly planned that, though maybe a bit later.

@teto teto deleted the teto/fix-lua-setup-hook branch April 2, 2024 12:44
@SuperSandro2000
Copy link
Member

as most people don't use it, I think

I've also run into this. I think the most common usecase for the http module is the prometheus metrics.

@vcunat
Copy link
Member

vcunat commented Apr 4, 2024

Ah, right. Perhaps I forgot because mentally I'm in 6.x where it's not needed for prometheus. I should soon think about (NixOS) strategy for migration to 6.x, too.

@flokli flokli mentioned this pull request Apr 5, 2024
13 tasks
@flokli
Copy link
Member

flokli commented Apr 5, 2024

I opened #301747, which re-enables the http module for knot-resolver (targeting staging, as the fix is only on staging too). PTAL.

@vcunat
Copy link
Member

vcunat commented Apr 14, 2024

lua*.tests.checkSetupHook got broken very fast again – it doesn't work on current staging-next branch already, and consequently knot-resolver also fails again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: lua Lua is a powerful, efficient, lightweight, embeddable scripting language. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 2501-5000 This PR causes many rebuilds on Darwin and should target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants