Skip to content

Conversation

justinmk
Copy link

@justinmk justinmk commented Mar 8, 2018

On travis CI the Neovim project sometimes sees errors like this:

Using previously configured rocks dir: /home/travis/nvim-deps/usr/lib/luarocks/rocks
Writing configuration...

Installation prefix: /home/travis/nvim-deps/usr
LuaRocks configuration directory: /home/travis/nvim-deps/usr/etc/luarocks
Using Lua from: /home/travis/nvim-deps/usr

Done configuring.
- Type 'make build' and 'make install':
  to install to /home/travis/nvim-deps/usr as usual.
- Type 'make bootstrap':
  to install LuaRocks in /home/travis/nvim-deps/usr as a rock.

No build step for 'luarocks'
Performing install step for 'luarocks'
/home/travis/nvim-deps/usr/bin/luajit: ...travis/nvim-deps/build/src/luarocks/src/luarocks/cfg.lua:78: attempt to index local 'site_config' (a boolean value)
stack traceback:
	...travis/nvim-deps/build/src/luarocks/src/luarocks/cfg.lua:78: in main chunk
	[C]: in function 'require'
	src/bin/luarocks:4: in main chunk
	[C]: at 0x0804c1b0
make[3]: *** [run_luarocks] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [build/src/luarocks-stamp/luarocks-install] Error 2
make[1]: *** [CMakeFiles/luarocks.dir/all] Error 2
make: *** [all] Error 2

That "attempt to index local 'site_config' (a boolean value)" error is annoying and requires digging around to find why it might happen.

require() returns true if the module doesn't return anything, so that's why site_config is "a boolean value".

Of course, the deeper problem[1] is that the require() is being weird. But showing a hint is better than nothing.

[1] My guess is that make bootstrap is doing things in parallel, maybe the site_config file is not fully written when the require() is invoked. Or travis (or the CI cache) is being weird.

if not ok then
if type(site_config) ~= "table" then
io.stderr:write("Result of require('luarocks.core.site_config_"..version_suffix.."') was invalid.\n")
site_config = {}
Copy link
Author

Choose a reason for hiding this comment

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

Maybe it should fail instead of trying to recover here. I'll leave that up to the luarocks maintainers.

justinmk added a commit to justinmk/neovim that referenced this pull request Mar 8, 2018
justinmk added a commit to justinmk/neovim that referenced this pull request Mar 9, 2018
@hishamhm
Copy link
Member

hishamhm commented Mar 9, 2018

Are you guys running make bootstrap with -j?

@justinmk
Copy link
Author

justinmk commented Mar 9, 2018

@hishamhm Yes, until yesterday: neovim/neovim@3029bae

Even so, it's worth having some sort of warning about this situation, no?

justinmk added a commit to justinmk/neovim that referenced this pull request Mar 9, 2018
justinmk added a commit to justinmk/neovim that referenced this pull request Mar 9, 2018
Is there a race between the luarocks `make bootstrap` dependencies?

reverts f73b4911312b35bfe38ed068672a2f8ba8875ba7
ref luarocks/luarocks#774
justinmk added a commit to justinmk/neovim that referenced this pull request Mar 11, 2018
justinmk added a commit to justinmk/neovim that referenced this pull request Mar 11, 2018
Is there a race between the luarocks `make bootstrap` dependencies?

reverts f73b4911312b35bfe38ed068672a2f8ba8875ba7
ref luarocks/luarocks#774
@daurnimator
Copy link
Member

The fix should be to have the write_sysconfig make rule write to a temporary file, and then move it into the final location.

@justinmk
Copy link
Author

IMO nil reference errors should be handled informatively where possible. Closing this in the meantime.

@justinmk justinmk closed this Mar 16, 2018
@daurnimator
Copy link
Member

@justinmk FYI, with the release of luarocks 3.0, site_config.lua no longer exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants