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

luajit: Expose build options, enable JIT debug module #79194

Merged
merged 1 commit into from Feb 15, 2020

Conversation

@Shados
Copy link
Contributor

Shados commented Feb 4, 2020

Motivation for this change

This change exposes various build options from luajit's makefile, many of which are useful when debugging Lua scripts. I've also enabled installing the JIT debug module files by default (used for -jbc, -jv, and -jdump CLI options).

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 nixpkgs-review --run "nixpkgs-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.

@teto

@lblasc
lblasc approved these changes Feb 12, 2020
@teto

This comment has been minimized.

Copy link
Contributor

teto commented Feb 12, 2020

sorry for delay, I don't think we have to map every option in nix. Like not sure enableJIT would be common enough to warrant its own flag ?
Valgrind and Gdb could go under the same flag Debug. One cqn override XCFLAGS.

@Shados

This comment has been minimized.

Copy link
Contributor Author

Shados commented Feb 13, 2020

sorry for delay, I don't think we have to map every option in nix. Like not sure enableJIT would be common enough to warrant its own flag ?

There's no real reason not to expose all the options, though. They're not likely to change. As for enableJIT: running without the JIT compiler makes some debugging scenarios easier.

Valgrind and Gdb could go under the same flag Debug.

Come to think of it, pretty sure the valgrind option won't work as-is, IIRC it needs the valgrind header files to build. I'll have a poke at that later, but it should definitely be separate: the GDB JIT option causes a performance impact (even without GDB hooked up), and is mainly useful for debugging LuaJIT itself (whereas the valgrind option is potentially useful for debugging leaks in Lua scripts in general, at least insofar as ones that use C libraries).

'';

configurePhase = false;

buildFlags = [
"amalg" # Build highly optimized version

This comment has been minimized.

Copy link
@teto

teto Feb 13, 2020

Contributor

is there a downside to this ?

This comment has been minimized.

Copy link
@Shados

Shados Feb 14, 2020

Author Contributor

To my knowledge, the only downside is that the build process with amalg enabled consumes more memory. amalg is the recommended target for binary distribution.

@teto

This comment has been minimized.

Copy link
Contributor

teto commented Feb 13, 2020

There's no real reason not to expose all the options, though. They're not likely to change.

It makes the nix derivation harder to read for a usecase that may benefit 1% of the use cases. But you convinced me anyway and as you've been pretty helpful in the past, I know you'll make good use of these options. Let's fix the valgrind option and merge.

@Shados Shados force-pushed the Shados:luajit-options branch from e850a9b to 2eeb103 Feb 14, 2020
@Shados

This comment has been minimized.

Copy link
Contributor Author

Shados commented Feb 14, 2020

OK, fixed up the valgrind option.

@teto teto merged commit e34db5a into NixOS:master Feb 15, 2020
15 checks passed
15 checks passed
Evaluation Performance Report Evaluator Performance Report
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A darwin-tested
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release-combined.nix -A tested
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A manual
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A options
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A manual
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A tarball
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A unstable
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
luajit on aarch64-linux Success
Details
luajit on x86_64-linux Success
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.