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 5.4.1 #65993

Closed
wants to merge 28 commits into from
Closed

Lua 5.4.1 #65993

wants to merge 28 commits into from

Conversation

carlocab
Copy link
Member

@carlocab carlocab commented Dec 1, 2020

This is another attempt at #65976. See also #57133.

Apologies for starting from scratch at this one, but I think I messed up
one of my previous commits in the earlier PR and I don't have enough
git-fu to fix it.


Build Failures (10.14, 10.15)

  • aspcud
  • clingo
  • corsixth
  • freeswitch
  • gnuplot
  • highlight
  • imapfilter
  • instead
  • kyua
  • lcm
  • lmod
  • lsyncd
  • luarocks
  • lutok
  • macvim
  • matplotplusplus
  • neomutt
  • onscripter
  • osrm-backend
  • pdns
  • pdnsrec
  • rpm
  • sile
  • tracebox
  • vim
  • vis
  • weechat

Build Failures (Big Sur)

hyperkit fails only on Big Sur. See #65000

To revisit?

These formulae still depend on [email protected]. Possible patches that will allow upgrading to [email protected] or alternatives to this in parentheses.

[email protected] is currently keg_only, unlike [email protected]. If this is undesirable, its executables will need to be renamed to avoid conflict with lua.

On luarocks:

  • It still has hardcoded version information in the tests. (this probably won't cause problems for a while though, if at all.)
  • It lacks a test for [email protected], but has one for [email protected]. I tried copying the old test, but couldn't get it to work.

lua patches:
They've been around for ages. Would be good to know if they're still needed and, if they are, to migrate them to Homebrew/formula-patches.

I'll pursue these in separate PRs once this current one is merged.

@BrewTestBot BrewTestBot added the automerge-skip `brew pr-automerge` will skip this pull request label Dec 1, 2020
@fxcoudert
Copy link
Member

OK got it. In formula_renames.json, remove this line:

  "[email protected]": "lua",

Formula/lua.rb Outdated Show resolved Hide resolved
@@ -93,68 +92,68 @@ def caveats
end

test do
system "#{bin}/lua", "-e", "print ('Ducks are cool')"
assert_match "Homebrew is awesome!", shell_output("#{bin}/lua -e \"print ('Homebrew is awesome!')\"")
end
end

__END__
Copy link
Member

Choose a reason for hiding this comment

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

It seems like this patch will be around for a while, is it submitted upstream already? And/or can we migrate it to Homebrew/formula-patches?

Copy link
Member Author

Choose a reason for hiding this comment

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

This patch has been around for quite a while: Homebrew/legacy-homebrew#5043

I think it's somewhat unique to the way Homebrew packages things? Though I don't see how it could hurt upstream, and probably only helps.

I don't mind migrating it to Homebrew/formula-patches. Do you mind if I pursue that in a separate PR, if (fingers crossed) this one gets merged?

Copy link
Member Author

Choose a reason for hiding this comment

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

I only just realised exactly how old this patch is. It's really alarming.

I'm going to try to see if I can track down someone familiar with lua internals who can have a look at the patch.

@fxcoudert
Copy link
Member

fxcoudert commented Dec 1, 2020

So, weirdly enough, out of the 32 formulas that depend on lua, only 23 have broken linkage:

brew linkage --test clingo
brew linkage --test corsixth
brew linkage --test freeswitch
brew linkage --test gnuplot
brew linkage --test highlight
brew linkage --test imapfilter
brew linkage --test instead
brew linkage --test kyua
brew linkage --test lcm
brew linkage --test lsyncd
brew linkage --test lutok
brew linkage --test macvim
brew linkage --test neomutt
brew linkage --test onscripter
brew linkage --test osrm-backend
brew linkage --test pdns
brew linkage --test pdnsrec
brew linkage --test rpm
brew linkage --test sile
brew linkage --test tracebox
brew linkage --test vim
brew linkage --test vis
brew linkage --test weechat

Does this mean that the others (fennel kyoto-tycoon lmod luarocks ntopng osm2pgsql widelands wordgrinder z.lua) do not actually have a runtime dependency on lua? If not, they should be made build-only dependencies.

Regarding the others, they need to be revision bumped (e.g., brew bump-revision clingo --message "for lua")

@carlocab
Copy link
Member Author

carlocab commented Dec 1, 2020

Ok, I'm going to try a revision bump on all the test failures (only for 10.14 for now, will work on any discrepancies with later versions after).

If that doesn't work, then I'm going to switch their dependency to [email protected]. (Hopefully, my version bump to 5.3.6 didn't break anything.)

Let me know if there's actually a better direction I should go.

@fxcoudert
Copy link
Member

I'm going to try a revision bump on all the test failures

Only the linkage failures, for now, please. Some test failures could be dependents that don't actually need to be revision-bumped.

If that doesn't work, then I'm going to switch their dependency to [email protected]

Yes.

Let me know if there's actually a better direction I should go

While testing proceeds, we need to understand the 9 formulas that don't link to lua: do they really have a runtime dependency, or could it be a build dependency?

@carlocab

This comment has been minimized.

@carlocab

This comment has been minimized.

@gromgit
Copy link
Member

gromgit commented Dec 1, 2020

A quick check of Lua usage in the "unbroken linkage" fomulae:

  • fennel: static linking
  • kyoto-tycoon: static linking
  • lmod: scripts
  • luarocks: scripts
  • ntopng: static linking
  • osm2pgsql: static linking
  • widelands: static linking
  • wordgrinder: static linking
  • z.lua: script

All "static linking" formulae can probably be converted to requiring Lua at build-time only. I can take care of this.

@fxcoudert
Copy link
Member

Thanks @gromgit
The static linking cases need to be made build-only, and revision-bumped. The scripts do not require any change.

@gromgit
Copy link
Member

gromgit commented Dec 1, 2020

All "static linking" formulae can probably be converted to requiring Lua at build-time only. I can take care of this.

@fxcoudert , should my work be folded into this effort, or can it be done in separate PRs? I ask because out of the 6 targeted formulae, only two (fennel and wordgrinder) have meaningful test cases, so this will take a while. (kyoto-tycoon doesn't have a test block at all.)

Formula/lua.rb Outdated Show resolved Hide resolved
@chenrui333 chenrui333 added the lua Lua use is a significant feature of the PR or issue label Dec 1, 2020
@carlocab

This comment has been minimized.

@SMillerDev
Copy link
Member

Error: GitHub API Error: API rate limit exceeded for 207.254.26.156. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)
Try again in 1 minute 28 seconds, or create a personal access token:
https://github.com/settings/tokens/new?scopes=gist,public_repo&description=Homebrew
echo 'export HOMEBREW_GITHUB_API_TOKEN=your_token_here' >> ~/.zshrc

Yeah, that happens sometimes. Probably the next run will be better.

@carlocab
Copy link
Member Author

carlocab commented Dec 1, 2020

Some related open PRs:

#66004 gnuplot (revision bump here)
#61931 rpm (revision bump here)
#65843 tracebox (revision bump + depends on "[email protected]" here)

@carlocab

This comment has been minimized.

@alerque
Copy link
Contributor

alerque commented Dec 1, 2020

@carlocab SILE should be ready to fly with Lua 5.4. We test every release it on a full Lua matrix and I'm running it on Lua 5.4 myself (on Arch Linux). All its respective Rock dependencies are likewise 5.4 compatible.

I don't see the actual failure log so this is a stab in the dark here, but from @fxcoudert's comment above:

Does this mean that the others (fennel kyoto-tycoon lmod luarocks ntopng osm2pgsql widelands wordgrinder z.lua) do not actually have a runtime dependency on lua? If not, they should be made build-only dependencies.

Could it be that the linkage detector doesn't understand what's going on here? There are two main types of Lua modules: plain Lua code ones that are scripts parsed at runtime and C ones that are compiled into binaries. The linkage check might only be funding the latter, but many projects that fall into the former still need to know at build time what version of Lua they are going to be running under because they make language and path adjustments to match. They need Lua at run time, but they also need to know some things about it at build time.

SILE for example has differt dependencies depending on the Lua version. Lua 5.2 for example provides a bit32 module built in, while 5.1, 5.3, and 5.4 need it to be included as an independent module.

LuaRocks also does some path stuff differently depending on what the runtime environment is expected to be.

@carlocab

This comment has been minimized.

@carlocab

This comment has been minimized.

@fxcoudert
Copy link
Member

@carlocab for the two crake-based projects that cannot find [email protected], you need to set the variables LUA_INCLUDE_DIR and LUA_LIBRARIES, I think: https://cmake.org/cmake/help/latest/module/FindLua.html

See how wireshark does this for [email protected]

@carlocab

This comment has been minimized.

@gromgit
Copy link
Member

gromgit commented Dec 3, 2020

I made a mistake with the final formula on my list (fennel). It's actually a gargantuan Lua script, and it passed CI here, so I'm skipping it.

BrewTestBot pushed a commit that referenced this pull request Dec 3, 2020
Also add proper test.

Followup to #65993.

Closes #66152.

Signed-off-by: Sean Molenaar <[email protected]>
Signed-off-by: BrewTestBot <[email protected]>
@carlocab carlocab deleted the lua-5.4.1 branch December 3, 2020 19:06
@carlocab
Copy link
Member Author

carlocab commented Dec 3, 2020

@gromgit at least you don't have mistakes that got merged... #66186

carlocab added a commit to carlocab/homebrew-core that referenced this pull request Dec 6, 2020
BrewTestBot pushed a commit that referenced this pull request Dec 6, 2020
@carlocab carlocab mentioned this pull request Dec 7, 2020
5 tasks
carlocab added a commit to carlocab/homebrew-core that referenced this pull request Dec 7, 2020
Follow up to Homebrew#65993.

See also lsyncd/lsyncd#502.

I've fixed a bunch of configuration and compile errors, but I'm left
with the following linker error:

    [100%] Linking C executable lsyncd
    /usr/local/Cellar/cmake/3.19.1/bin/cmake -E cmake_link_script CMakeFiles/lsyncd.dir/link.txt --verbose=1
    /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/lsyncd.dir/lsyncd.c.o CMakeFiles/lsyncd.dir/runner.c.o CMakeFiles/lsyncd.dir/defaults.c.o CMakeFiles/lsyncd.dir/fsevents.c.o -o lsyncd  /usr/local/opt/lua/lib/liblua.5.4.dylib
    Undefined symbols for architecture x86_64:
      "_lua_objlen", referenced from:
          _l_exec in lsyncd.c.o
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[2]: *** [lsyncd] Error 1
    make[1]: *** [CMakeFiles/lsyncd.dir/all] Error 2
    make: *** [all] Error 2

Does anyone have any ideas?
carlocab added a commit to carlocab/homebrew-core that referenced this pull request Dec 7, 2020
BrewTestBot pushed a commit that referenced this pull request Dec 8, 2020
Follow up to #65993

Closes #66407.

Signed-off-by: FX Coudert <[email protected]>
Signed-off-by: BrewTestBot <[email protected]>
@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Jan 7, 2021
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Jan 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automerge-skip `brew pr-automerge` will skip this pull request lua Lua use is a significant feature of the PR or issue outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants