Git Product home page Git Product logo

Comments (15)

hishamhm avatar hishamhm commented on May 22, 2024

After some digging, I think I found it. Looks like you're using LuaPosix and, to my surprise, it doesn't support octal mode setting. I've just pushed a change to use the textual notation. This should be more "portable".

Please confirm if this fixes your issue.

from luarocks.

vladfedin avatar vladfedin commented on May 22, 2024

Thanks for fast response, though now I got something new:

user@ubuntu:~/projects/pk-hb/server/lib/pk-tools$ sudo luarocks make rockspec/pk-tools.pk-ensure-nginx-site-enabled-scm-1.rockspec 

Error: LuaRocks 2.0.7 bug (please report at [email protected]).
/usr/local/share/lua/5.1//luarocks/dir.lua:12: assertion failed!
stack traceback:
    [C]: in function 'assert'
    /usr/local/share/lua/5.1//luarocks/dir.lua:12: in function 'base_name'
    /usr/local/share/lua/5.1//luarocks/build.lua:59: in function 'install_files'
    /usr/local/share/lua/5.1//luarocks/build.lua:206: in function 
    (tail call): ?
    (tail call): ?
    [C]: in function 'xpcall'
    /usr/local/share/lua/5.1//luarocks/command_line.lua:151: in function 'run_command'
    /usr/local/bin/luarocks:23: in main chunk
    [C]: ?

from luarocks.

hishamhm avatar hishamhm commented on May 22, 2024

I committed a fix for that. Please let me know how things go. If things run smoothly I'll pack a release in the coming days.

from luarocks.

vladfedin avatar vladfedin commented on May 22, 2024

Thanks alot, new code worked for me!

from luarocks.

amrhassan avatar amrhassan commented on May 22, 2024

I'm getting this error in luarocks 2.2.0

/usr/bin/lua: /usr/share/lua/5.2/luarocks/fs/lua.lua:740: bad argument #2 to 'chmod' (bad mode)
stack traceback:
    [C]: in function 'error'
    /home/amr/.luarocks/share/lua/5.2/posix/_argcheck.lua:20: in function 'argerror'
    /home/amr/.luarocks/share/lua/5.2/posix/compat.lua:150: in function </home/amr/.luarocks/share/lua/5.2/posix/compat.lua:146>
    (...tail calls...)
    /usr/share/lua/5.2/luarocks/fs/lua.lua:740: in function 'chmod'
    /usr/share/lua/5.2/luarocks/tools/tar.lua:136: in function 'untar'
    csagent.lua:78: in function 'download_jumpscripts'
    csagent.lua:113: in main chunk
    [C]: in ?

from luarocks.

ignacio avatar ignacio commented on May 22, 2024

Can you run the luarocks command again, with --verbose flag, and paste the results here?

from luarocks.

amrhassan avatar amrhassan commented on May 22, 2024

This actually happens while using luarocks as a Lua module in my application, not while running the luarocks executable. It's during calling luarocks.tools.tar.untar() which I passed two strings.

from luarocks.

ignacio avatar ignacio commented on May 22, 2024

Ok, can you add

util.printerr("file: ".. tostring(file) .. " mode: " .. tostring(mode))

before line 740?

The first argument seems to require a valid path. Let's check that too.

Also, which version of LuaPosix are you using?

from luarocks.

amrhassan avatar amrhassan commented on May 22, 2024

I'm using luarocks 2.2.0, and LuaPosix 33.2.1. The first argument is indeed a valid file path.

file: /tmp/csagent-1421841817/jumpscripts/luajumpscripts/jumpscale/test/lua_echo.lua mode: ---------rw-r--r--
/usr/bin/lua: /usr/share/lua/5.2/luarocks/fs/lua.lua:741: bad argument #2 to 'chmod' (bad mode)
stack traceback:
    [C]: in function 'error'
    /home/amr/.luarocks/share/lua/5.2/posix/_argcheck.lua:20: in function 'argerror'
    /home/amr/.luarocks/share/lua/5.2/posix/compat.lua:150: in function </home/amr/.luarocks/share/lua/5.2/posix/compat.lua:146>
    (...tail calls...)
    /usr/share/lua/5.2/luarocks/fs/lua.lua:741: in function 'chmod'
    /usr/share/lua/5.2/luarocks/tools/tar.lua:136: in function 'untar'
    csagent.lua:70: in function 'download_jumpscripts'
    csagent.lua:143: in function 'main'
    csagent.lua:167: in main chunk
    [C]: in ?

from luarocks.

ignacio avatar ignacio commented on May 22, 2024

Try that in a script:

local posix = require "posix"

local file = "/tmp/csagent-1421841817/jumpscripts/luajumpscripts/jumpscale/test/lua_echo.lua"
local mode = "---------rw-r--r--"
print( posix.chmod(file, mode) )

According to http://luaposix.github.io/luaposix/modules/posix.html#chmod it seems that your mode string is not valid. All those dashes at the start are valid?

Also, which version of LuaPosix (not LuaRocks) are you using?

from luarocks.

amrhassan avatar amrhassan commented on May 22, 2024

LuaPosix 33.2.1 (latest atm), but I'm not calling posix.chmod(). It's LuaRocks's tar.untar() function that calls it on files that got extracted from the tar archive. Is it a problem with how the permissions are stored in that specific tar archive?

from luarocks.

ignacio avatar ignacio commented on May 22, 2024

Do you have a tar file that works so we can compare them and see if that's
indeed the problem?

from luarocks.

hishamhm avatar hishamhm commented on May 22, 2024

We have code in lua.lua that converts octal notation to rwx notation because of an old LuaPosix bug. Looks like tar is giving out lots of zeros in its mode string ("000644").

from luarocks.

hishamhm avatar hishamhm commented on May 22, 2024

I pushed a fix for that, @amrhassan, please take a look.

from luarocks.

amrhassan avatar amrhassan commented on May 22, 2024

That seems to fix it. Thank you @hishamhm :)

from luarocks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.