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

Taskfile loading doesn't work #12

Open
natnat-mc opened this issue Nov 17, 2020 · 0 comments
Open

Taskfile loading doesn't work #12

natnat-mc opened this issue Nov 17, 2020 · 0 comments

Comments

@natnat-mc
Copy link
Contributor

(error messages here are for 5.3, but they also apply to 5.1)

First, taskfiles are loaded in test.alfons.<name> instead of alfons.tasks.<name>:

Alfons 4.2
Using Alfons.moon (moon)
/usr/bin/lua5.3: /usr/local/lib/luarocks/rocks-5.3/alfons/4.2-1/bin/alfons:363: test.alfons.moonbuild not found.
stack traceback:
	[C]: in function 'error'
	/usr/local/lib/luarocks/rocks-5.3/alfons/4.2-1/bin/alfons:363: in global 'load'
	[string "Alfons"]:4: in function <[string "Alfons"]:3>
	(...tail calls...)
	/usr/local/lib/luarocks/rocks-5.3/alfons/4.2-1/bin/alfons:1018: in main chunk
	[C]: in ?

Then, taskfile loading fails if the first line of the taskfile is a shebang (which is still supposed to be valid lua (loadfile accepts it but not Alfons)):

Alfons 4.2
Using Alfons.moon (moon)
/usr/bin/lua5.3: /usr/local/lib/luarocks/rocks-5.3/alfons/4.2-1/bin/alfons:363: Could not load Taskfile 1: Could not load Alfonsfile content (5.2+): [string "Alfons"]:1: unexpected symbol near '#'
stack traceback:
	[C]: in function 'error'
	/usr/local/lib/luarocks/rocks-5.3/alfons/4.2-1/bin/alfons:363: in global 'load'
	[string "Alfons"]:4: in function <[string "Alfons"]:3>
	(...tail calls...)
	/usr/local/lib/luarocks/rocks-5.3/alfons/4.2-1/bin/alfons:1018: in main chunk
	[C]: in ?

Then again, Alfons complains about missing globals for loading the file (package, _G (which should be set to the environment itself, probably along with _ENV for 5.3 compat), rawset, setmetatable), and then about subalf being a table and not a function:

Alfons 4.2
Using Alfons.moon (moon)
/usr/bin/lua5.3: [string "Alfons"]:5: attempt to index a nil value (global 'package')
stack traceback:
        [string "Alfons"]:5: in upvalue 'alf'
        /usr/local/share/lua/5.3/alfons/init.lua:133: in local 'subalf'
        /usr/local/share/lua/5.3/alfons/init.lua:158: in global 'load'
        [string "Alfons"]:4: in function <[string "Alfons"]:3>
        (...tail calls...)
        /usr/local/lib/luarocks/rocks-5.3/alfons/test-3/bin/alfons:93: in main chunk
        [C]: in ?

The taskfile itself is https://push.codinget.me/moonbuild.lua and the Alfons.moon is https://push.codinget.me/Alfons.moon

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

No branches or pull requests

1 participant