Skip to content

lua wrapper: Fix bash error#73946

Merged
Ericson2314 merged 1 commit intoNixOS:masterfrom
Ericson2314:fix-lua-env
Nov 23, 2019
Merged

lua wrapper: Fix bash error#73946
Ericson2314 merged 1 commit intoNixOS:masterfrom
Ericson2314:fix-lua-env

Conversation

@Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Nov 23, 2019

Motivation for this change

Recently, we made it harder for external code to use some stdenv-only bash
variables by unsetting them in

# Unset setup-specific declared variables
unset allPlatOffsets
unset pkgBuildAccumVars pkgHostAccumVars pkgTargetAccumVars pkgAccumVarVars
unset pkgBuildHookVars pkgHostHookVars pkgTargetHookVars pkgHookVarVars
unset propagatedDepFilesVars
But Lua's withPackages was sourcing some
setup hooks in
. "${makeWrapper}/nix-support/setup-hook"
# get access to lua functions
. ${lua}/nix-support/setup-hook
, which required those bash variables.

I say great! We caught something bad: Lua should use normal dependencies, even
though that is harder with buildEnv. Now it works that way, and everything is
fine.

CC @matthewbauer

Fixes #73887

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @

Recently, we made it harder for external code to use some stdenv-only bash
variables by unsetting them in [1] But Lua's `withPackages` was sourcing some
setup hooks in [2], which required those bash variables.

I say great! We caught something bad: Lua should use normal dependencies, even
though that is harder with `buildEnv`. Now it works that way, and everything is
fine.

[1]: https://github.com/NixOS/nixpkgs/blob/9d3911f806034197bb7ace586cc3696ffce7f447/pkgs/stdenv/generic/setup.sh#L574-L578

[2]: https://github.com/NixOS/nixpkgs/blob/9d3911f806034197bb7ace586cc3696ffce7f447/pkgs/development/interpreters/lua-5/wrapper.nix#L23-L27

CC @matthewbauer
@ofborg ofborg bot added 6.topic: lua Lua is a powerful, efficient, lightweight, embeddable scripting language. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Nov 23, 2019
@Ericson2314 Ericson2314 merged commit 505dcb3 into NixOS:master Nov 23, 2019
@Ericson2314 Ericson2314 mentioned this pull request Nov 23, 2019
10 tasks
@Ericson2314 Ericson2314 deleted the fix-lua-env branch November 23, 2019 17:48
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: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

neovim broken by recent (stdenv?) refactoring in master

2 participants