- Make `lua` gain `luaOnBuildFor{Build,Host,Target}` and alike attributes.
- wrapLua: correctly substitute build & host lua & luarocks_bootstrap
- Disallow build platform references when using `buildLuarocksPackage`
in cross building.
- add bustedCheckHook in the nativeCheckInputs and busted will run when
doCheck is enabled. You can customize its call via "bustedFlags" and
prevent it from running with "dontBustedCheck". If "nlua" is
available, busted will automatically run busted with nlua as
interpreter (already done in lux). Goal is to standardize the writing
of tests so that if feels less like copy & paste.
- removed the default checkPhase from buildLuarocksPackage which was
running "luarocks test". None of the plugins was using as far as I
know because no plugin out there (maybe 2 or 3) uses that ? it could
be considered a breaking change but in practice I dont think it is.
mkDerivation instead of using the raw list
```
… while evaluating attribute 'propagatedBuildInputs' of derivation 'wrap-lua-hook'
at /home/art/nixgits/my-nixpkgs/pkgs/stdenv/generic/make-derivation.nix:600:13:
599| depsHostHostPropagated = elemAt (elemAt propagatedDependencies 1) 0;
600| propagatedBuildInputs = elemAt (elemAt propagatedDependencies 1) 1;
| ^
601| depsTargetTargetPropagated = elemAt (elemAt propagatedDependencies 2) 0;
… while calling the 'getAttr' builtin
at «nix-internal»/derivation-internal.nix:50:17:
49| value = commonAttrs // {
50| outPath = builtins.getAttr outputName strict;
| ^
51| drvPath = strict.drvPath;
… while calling the 'derivationStrict' builtin
at «nix-internal»/derivation-internal.nix:37:12:
36|
37| strict = derivationStrict drvAttrs;
| ^
38|
… while evaluating derivation 'make-shell-wrapper-hook'
whose name attribute is located at /home/art/nixgits/my-nixpkgs/pkgs/stdenv/generic/make-derivation.nix:541:13
… while evaluating attribute 'shell' of derivation 'make-shell-wrapper-hook'
at /home/art/nixgits/my-nixpkgs/pkgs/top-level/all-packages.nix:716:7:
715| # targetPackages.runtimeShell only exists when pkgs == targetPackages (when targetPackages is not __raw)
716| shell =
| ^
717| if targetPackages ? runtimeShell then
… while calling the 'throw' builtin
at /home/art/nixgits/my-nixpkgs/pkgs/top-level/all-packages.nix:720:11:
719| else
720| throw "makeWrapper/makeShellWrapper must be in nativeBuildInputs";
| ^
721| };
error: makeWrapper/makeShellWrapper must be in nativeBuildInputs
```
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.
Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.
A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.
This commit was automatically created and can be verified using
nix-build a08b3a4d19.tar.gz \
--argstr baseRev b32a094368
result/bin/apply-formatting $NIXPKGS_PATH
Goal is to make generateLuarocksConfig appropriate in more scenarios, in my case, to generate rocks.nvim luarocks config
We override the luarocks default for rocks_subdir to avoid conflicts when creating lua environments but it is not appropriate for other scenarios
so let's not default to it in the "lib" function.
I tried using luaLib.generateLuarocksConfig outside nixpkgs, to generate a rocks.nvim config but it adds a `local_cache = ""` configuration line that is painful to remove so let's not add it in the first place, and let the caller set it if needed.
When installing a lua package that depends on luarocks, luarocks was not
capable of recognizing the luarocks module: https://github.com/NixOS/nixpkgs/issues/316009 .
As explained here https://github.com/luarocks/luarocks/issues/1659,
luarocks needs a manifest to recognize the package.
I first attempted to generate a manifest with `luarocks-admin
make-manifest` on our current manual luarocks derivation but this ended
up being too hackish as the `make-manifest` requires a .rockspec or
.rock to work, which we had not.
It seemed simpled to just rename the current manual luarocks derivation to luarocks_bootstrap
in order to break cyclic dependencies in buildLuarocksPackage and add a
generated luarocks derivation. Previously it was impossible to test
luarocks because of the cyclic dependency but we will now be able to
test the generated derivation.
which contains lua shell utilities that can be reused during the
creation of an environment.
Makes sense because the generation of LUA_PATH is a bit different than
other ecosystems.
`paths = requiredLuaModules (extraLibs ++ [ lua ] );` would discard lua
and so in absence of a propagated lua, the lua.withPackages would return
an empty bin/ directory.
I was working on lua tests, enabling nlua and I started overriding
postFixup, which removed the default phase for build-luarocks-package so
instead let's make it a proper phase.
There is an arbitrary mapping being done right now between
nixpkgs lua infrastructre and luarocks config schema.
This is confusing if you use lua so let's make it possible to use the
lua names in the nixpkgs, thanks to the lib.generators.toLua convertor.
The only nixpkgs thing to remember should be to put the config into `luarocksConfig`
`buildLuarocksPackage.extraVariables` should become `buildLuarocksPackage.luarocksConfig.variables`
it was used only once and complexifies the buildLuarocksPackage function uselessly.
because buildLuarocksPackage accepts ... args, it wont trigger eval failures but this may break out of tree packages where the build can't find the rockspec anymore. Specify the path via `knownRockspec` if that's the case.
* buildLuarocksPackage: save luarocks config as derivation
while debugging luarocks packages, it's exhausting to have to build
them, look at what random folder they've been built to finally look for
their config.
With this you can run
nix build lua51Packages.plenary-nvim.configFile -f .
and infer what luarocks will do.
* Update pkgs/development/interpreters/lua-5/build-luarocks-package.nix
Co-authored-by: Marc Jakobi <mrcjkb89@outlook.com>
---------
Co-authored-by: Marc Jakobi <mrcjkb89@outlook.com>