[TOOL] LÖVERocks - A package manager manager

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post 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?
alloyed
Citizen
Posts: 80
Joined: Thu May 28, 2015 8:45 pm
Contact:

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

Post 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 ¯\_(ツ)_/¯
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post 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...
alloyed
Citizen
Posts: 80
Joined: Thu May 28, 2015 8:45 pm
Contact:

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

Post 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
User avatar
bakpakin
Party member
Posts: 114
Joined: Sun Mar 15, 2015 9:29 am
Location: Boston

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

Post 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.
((_((_CRAYOLA_((_((_> GitHub <_((_((_CRAYOLA_((_(()
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post 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?
User avatar
bakpakin
Party member
Posts: 114
Joined: Sun Mar 15, 2015 9:29 am
Location: Boston

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

Post 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:
((_((_CRAYOLA_((_((_> GitHub <_((_((_CRAYOLA_((_(()
alloyed
Citizen
Posts: 80
Joined: Thu May 28, 2015 8:45 pm
Contact:

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

Post 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.
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

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

Post 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
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
User avatar
bakpakin
Party member
Posts: 114
Joined: Sun Mar 15, 2015 9:29 am
Location: Boston

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

Post 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.
((_((_CRAYOLA_((_((_> GitHub <_((_((_CRAYOLA_((_(()
Post Reply

Who is online

Users browsing this forum: No registered users and 30 guests