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

lua: merge lua5.X interpreters #59919

Merged
merged 6 commits into from Apr 27, 2019
Merged

lua: merge lua5.X interpreters #59919

merged 6 commits into from Apr 27, 2019

Conversation

teto
Copy link
Member

@teto teto commented Apr 20, 2019

similar to what was done for python.
Makes it easier to change the passthru settings and the lua infrastructure.

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@teto
Copy link
Member Author

teto commented Apr 21, 2019

the expansion of makeFlagsArray is awkward. Seems to work locally :/

similar to what was done for python.
Makes it easier to change the passthru settings and the lua infrastructure.
@teto
Copy link
Member Author

teto commented Apr 26, 2019

@7c6f434c what do you think ? it's not more elegant than the previous implementation but it makes it easier to keep lua interpreters in sync (especially the passthru part with all the buildEnv logic).

"INSTALL_TOP=${placeholder "out"}"
"INSTALL_MAN=${placeholder "out"}/share/man/man1"
"R=${version}"
''LDFLAGS="-fPIC"''
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add comment why these quotes are needed (and why CFLAGS cannot be handled like that)?

@7c6f434c
Copy link
Member

Seems fine to me. a grep a is a FIXME marker? Does that part work now?

@@ -29,44 +25,36 @@ in rec {
sed -e 's/ALL_T *= */& $(LUA_SO)/' -i src/Makefile
'';

# a grep a
postBuild = stdenv.lib.optionalString (!stdenv.isDarwin) ''
set -x
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason to keep verbosity here?

Copy link
Member Author

Choose a reason for hiding this comment

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

absolutely none sorry :/

Copy link
Member

Choose a reason for hiding this comment

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

Mwahaha that's what happens when you remove FIXME without looking around why it was there! (Not that it matters)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, I usually leave a TODO but the a grep a looked like a mispaste. It also happens when I work on a PR over longer than expected.
I believe it's ready to squash & merge. Not sure if it should go to staging or master though.

Copy link
Member Author

Choose a reason for hiding this comment

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

arf it wasn't. Damn shell expansion rules ! reverted my cosmetic-induced bug.

@teto teto marked this pull request as ready for review April 27, 2019 08:02
@teto
Copy link
Member Author

teto commented Apr 27, 2019

@GrahamcOfBorg build lua5_2 lua5_2_compat lua5_3 lua5_3_compat lua5_1 luaPackages.lpeg

@7c6f434c
Copy link
Member

@GrahamcOfBorg build lua5_2 lua5_2_compat lua5_3 lua5_3_compat lua5_1 luaPackages.lpeg

@7c6f434c
Copy link
Member

Wait, so quoting works for CC? Would it also work for CFLAGS then?

@teto
Copy link
Member Author

teto commented Apr 27, 2019

In current nixpkgs, lua5.1 has an extra hydraPlatforms = stdenv.lib.platforms.linux; compared to this PR. Should I keep it ? what is that and why only 5.1 has it; not 5.2 or 5.3 ?

@7c6f434c
Copy link
Member

I would guess that in old days Darwin was even lower tier of support, so somebody wanted to remove the platforms restriction without needing to consider Hydra impact. Feel free to git blame to find out, of course.

@teto
Copy link
Member Author

teto commented Apr 27, 2019

@GrahamcOfBorg build lua5_2 lua5_2_compat lua5_3 lua5_3_compat lua5_1 luaPackages.lpeg

@teto
Copy link
Member Author

teto commented Apr 27, 2019

@GrahamcOfBorg build lua5_2 lua5_2_compat lua5_3 lua5_3_compat lua5_1 luaPackages.lpeg

@teto teto merged commit 672c3c1 into NixOS:master Apr 27, 2019
@teto teto deleted the lua_interpreters branch April 27, 2019 13:00
@flokli
Copy link
Contributor

flokli commented May 20, 2019

This seems to have broken the ultrastardx build, at least according to a git bisect:

Linking ../game/ultrastardx
Warning: "crti.o" not found, this will probably cause a linking failure
Warning: "crtn.o" not found, this will probably cause a linking failure
/nix/store/2dfjlvp38xzkyylwpavnh61azi0d168b-binutils-2.31.1/bin/ld: warning: ../game/link.res contains output sections; did you forget -T?
/nix/store/2dfjlvp38xzkyylwpavnh61azi0d168b-binutils-2.31.1/bin/ld: cannot find -llua5.2
Error: Error while linking
Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: /nix/store/6y49zi0s1s7fwirv4yd3835khnmh0wl0-fpc-3.0.0/bin/ppcx64 returned an error exitcode
make[1]: *** [Makefile:233: ../game/ultrastardx] Error 1
make[1]: Leaving directory '/build/source/src'
make: *** [Makefile:136: all] Error 2
builder for '/nix/store/kp3i70044s81b746c733201wsjl4x8s8-ultrastardx-2017.8.0.drv' failed with exit code 2

(nix log /nix/store/kp3i70044s81b746c733201wsjl4x8s8-ultrastardx-2017.8.0.drv)
https://hydra.nixos.org/build/93748657/nixlog/1

bad commit: 672c3c1

@teto
Copy link
Member Author

teto commented May 21, 2019

I can reproduce, I'll look into it.

@teto
Copy link
Member Author

teto commented May 21, 2019

I think the flags are wrong, looking at lua5.2 pkgconfig, it advises to link with -llua, not -llua5.2:
Libs: -L/nix/store/l00fyl6fqhgbw2rg3nkw0qwd3jh32ibp-lua-5.2.4/lib -llua -lm Maybe the maintainer could bump the package to today's version as there seems to be activity but no release on the github https://github.com/UltraStar-Deluxe/USDX

@flokli
Copy link
Contributor

flokli commented May 22, 2019

@teto I'm not sure if I understand the problem. lua 5.2 pkgconfig did say -llua before and after 672c3c1, so this can't be the reason for the build to fail.

The ultrastardx package is already at the latest release, and there seem to be no lua-related changes in the diff.

@teto
Copy link
Member Author

teto commented May 25, 2019

Shouldn't they use pkg-config --libs lua to get the flags instead ?

@flokli
Copy link
Contributor

flokli commented May 25, 2019

@teto
Copy link
Member Author

teto commented May 25, 2019

I've opened an issue here UltraStar-Deluxe/USDX#462

@flokli
Copy link
Contributor

flokli commented Jun 2, 2019

@teto I'm not sure I understand how this PR could have broken it, and why it did work before.

@chkno chkno mentioned this pull request Feb 1, 2020
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants