Page 3 of 4

Re: [TOOL] LÖVERocks - A package manager manager

Posted: Tue Jun 09, 2015 4:54 pm
by bartbes
Prints one and exactly one result for datafile and nothing else the second try, and finds nothing before adding the path.
Is the location of my template file correct, because it seems to be in a weird location, or should datafile have dealt with that?

Re: [TOOL] LÖVERocks - A package manager manager

Posted: Tue Jun 09, 2015 7:59 pm
by alloyed
bartbes wrote:Prints one and exactly one result for datafile and nothing else the second try, and finds nothing before adding the path.
Is the location of my template file correct, because it seems to be in a weird location, or should datafile have dealt with that?
The path is a little odd but luarocks/datafile should understand it because it's the default for misc files, which why it's really weird that it's skipping it entirely.
Anyways, 0.0.4 adds a config option so you can just manually override datafile:

Code: Select all

$ echo "loverocks_templates = '$(find ~/.luarocks -path "*loverocks*" -name templates)'" >> ~/.config/loverocks/conf.lua
It's a crappy workaround because the path will change depending on the version of loverocks but ¯\_(ツ)_/¯

Re: [TOOL] LÖVERocks - A package manager manager

Posted: Tue Jun 09, 2015 8:12 pm
by bartbes
You say that...

Code: Select all

[bartbes@archery /tmp]$ loverocks new test
Found LOVE version 0.9.2
/usr/bin/lua5.1: ...s/.luarocks/share/lua/5.1/loverocks/commands/new.lua:63: attempt to call global 'config' (a nil value)
stack traceback:
	...s/.luarocks/share/lua/5.1/loverocks/commands/new.lua:63: in function 'template_path'
	...s/.luarocks/share/lua/5.1/loverocks/commands/new.lua:81: in function <...s/.luarocks/share/lua/5.1/loverocks/commands/new.lua:75>
	(tail call): ?
	...b/luarocks/rocks-5.1/loverocks/0.0.4-1/bin/loverocks:3: in main chunk
	[C]: ?
I kind of feel bad for "hijacking" the thread at this point...

Re: [TOOL] LÖVERocks - A package manager manager

Posted: Tue Jun 09, 2015 8:33 pm
by alloyed
bartbes wrote:You say that...

Code: Select all

[bartbes@archery /tmp]$ loverocks new test
Found LOVE version 0.9.2
/usr/bin/lua5.1: ...s/.luarocks/share/lua/5.1/loverocks/commands/new.lua:63: attempt to call global 'config' (a nil value)
stack traceback:
	...s/.luarocks/share/lua/5.1/loverocks/commands/new.lua:63: in function 'template_path'
	...s/.luarocks/share/lua/5.1/loverocks/commands/new.lua:81: in function <...s/.luarocks/share/lua/5.1/loverocks/commands/new.lua:75>
	(tail call): ?
	...b/luarocks/rocks-5.1/loverocks/0.0.4-1/bin/loverocks:3: in main chunk
	[C]: ?
I kind of feel bad for "hijacking" the thread at this point...
0.0.4-2! 0.0.4-2 is the version that will work!
Don't worry about it, I'd rather know what can go wrong early before the codebase becomes hard to change

Re: [TOOL] LÖVERocks - A package manager manager

Posted: Tue Jun 09, 2015 8:42 pm
by bakpakin
Now when I run

Code: Select all

loverocks new foo
in 0.0.4-2, it creates a project but all the default files are blank.

Re: [TOOL] LÖVERocks - A package manager manager

Posted: Tue Jun 09, 2015 8:58 pm
by bartbes
Same, but I did find a reason why datafile might be failing.

It's querying "~/.luarocks/lib/luarocks/manifest" first, and if it doesn't exist it tries the rocks-5.1 dir. This is the wrong order, however, since I also have luarocks for 5.2 and 5.3, so the first path does exist, but refers to the lua 5.2 rocks instead of the lua 5.1 rocks. Reversing this order in my local copy fixed the problem. You seem to have talked to the author of datafile, so maybe you can pass it on?

Re: [TOOL] LÖVERocks - A package manager manager

Posted: Tue Jun 09, 2015 11:35 pm
by bakpakin
Ah! I found the problem and solution in 0.0.4 for empty new projects. I see in the 0.0.4 release, the spit_file function in util.lua is incorrect; nothing is written to the file!

0.0.4

Code: Select all

local function spit_file(str, dest)
	log:fs("spit  %s", dest)
	local file, err = io.open(dest, "w")
	if not file then return nil, err end

	local ok, err = file:write() -- should be file:write(str)
	if not ok then return nil, err end

	local ok, err = file:close()
	if not ok then return nil, err end

	return true
end
btw, I would like to contribute to this project :awesome:

Re: [TOOL] LÖVERocks - A package manager manager

Posted: Fri Jun 19, 2015 7:59 pm
by alloyed
bakpakin wrote:Ah! I found the problem and solution in 0.0.4 for empty new projects. I see in the 0.0.4 release, the spit_file function in util.lua is incorrect; nothing is written to the file!

0.0.4

Code: Select all

local function spit_file(str, dest)
	log:fs("spit  %s", dest)
	local file, err = io.open(dest, "w")
	if not file then return nil, err end

	local ok, err = file:write() -- should be file:write(str)
	if not ok then return nil, err end

	local ok, err = file:close()
	if not ok then return nil, err end

	return true
end
btw, I would like to contribute to this project :awesome:
Alright, fixed in 0.0.5~
If you find anything else/want to implement anything, I like pull requests. I'll see if I can crib a contributing.md from somewhere else, but tbh I'm not that picky.

Re: [TOOL] LÖVERocks - A package manager manager

Posted: Fri Jun 19, 2015 11:50 pm
by Positive07
I think the CI in the repo is not doing what it should do:

Code: Select all

busted -o junit > $CIRCLE_TEST_REPORTS/junit/tests.xml
sh: 1: /home/ubuntu/.luarocks/bin/luarocks: not found
Found a suitable copy of luarocks at /usr/local/bin/luarocks
Using template "./templates/love9"
New LOVERocks project installed at "my-project/"

inspect added to rockspec, now installing.

Missing dependencies for my-project:
inspect 

No existing manifest. Attempting to rebuild...
And in the Test Results it says:
Your build ran 1 test in with 1 failure.
failures:
failed to parse junit.xml - in ParseError
Just pointing it out...

In another note: Are you planning support for Windows? I can help if needed

Re: [TOOL] LÖVERocks - A package manager manager

Posted: Wed Jul 08, 2015 5:15 pm
by bakpakin
Just got the homebrew maintainers to make homebrew's luarocks have user configuration enabled. Since most mac users probably have luarocks installed via homebrew, this makes loverocks on mac a lot easier.