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

cannot upload a rock #172

Open
Tieske opened this issue Mar 5, 2021 · 11 comments
Open

cannot upload a rock #172

Tieske opened this issue Mar 5, 2021 · 11 comments

Comments

@Tieske
Copy link
Contributor

Tieske commented Mar 5, 2021

Using the GUI I can only upload a rockspec, the rock upload fails.

If I add a rockspec and a rock to the GUI, only the rockspec is uploaded and added. If I only add a rock I get "Errors: missing file".

I tried with both .src.rock and .all.rock.

(what's the difference between the two formats? I managed to upload a .all.rock using curl, but then a luarocks install would not find it.)

@Tieske
Copy link
Contributor Author

Tieske commented Mar 5, 2021

@hishamhm any ideas on that last part? why it doesn't find the .all.rock?

@hishamhm
Copy link
Member

what's the difference between the two formats? I managed to upload a .all.rock using curl, but then a luarocks install would not find it

.all.rock is a suffix for binary rocks that have no C-library component (.so/.dll) to it, only .lua modules (i.e. they are (theoretically at least) portable "binary" rocks). It's strange that luarocks install couldn't find it.

I'll do some experiments here to figure out what's going on!

BTW, what is the file size of the .src.rock you were trying to upload?

@Tieske
Copy link
Contributor Author

Tieske commented Mar 12, 2021

I hacked around it and uploaded it, zipping my own file, and then using curl to upload

current .src.rock is 4945172 bytes

@leafo
Copy link
Collaborator

leafo commented Mar 12, 2021

Do you mind uploading the two files you were trying to upload somewhere so I can grab them and do a test run locally? Should be an easy fix once I reproduce it

@Tieske
Copy link
Contributor Author

Tieske commented Mar 12, 2021

@leafo just any rock will do. It never worked for me. Only rockspec files I can upload via the site. Rocks won't work. But the LuaRocks command line allowed to work around that, so it never was a big issue.

It's just that with my current project the rock cannot be uploaded via LuaRocks cli, and hence I'm out of luck here, and came up with the hacks in my previous post.

@hishamhm
Copy link
Member

hishamhm commented Mar 12, 2021

@leafo I reproduced the issue at the site upload by attempting to upload Thijs's two files that appear here through the website.

It's just that with my current project the rock cannot be uploaded via LuaRocks cli

@Tieske I took a look at your repo — that's because the rockspec is playing a trick there with the update_api_files.sh to build the list of files, right? So technically the rockspec does not really contain the correct sequence of steps to download and install the files. One way around this would be to use type="make" and have the Makefile produce the list of generated files and install them (see docs here). That way the rockspec itself doesn't need to list the files, and luarocks upload would work correctly.

@Tieske
Copy link
Contributor Author

Tieske commented Mar 13, 2021

I'm aware I'm pulling some tricks here to not have to include the AWS repo files in this repo to keep it lean and mean. It just makes some existing issues more visible (as confirmed by @hishamhm ):

  • site upload not working
  • LuaRocks not finding the .all.rock that was uploaded

@hishamhm yes, using make also crossed my mind, but sacrifices compatibility (Windows, though not an immediate need)

wrt the rock format, while crafting my own ones I noticed that the .all.rock and .src.rock have completely different formats. Could that be the reason it cannot find it? I assume that after an upload the manifest/index is rebuild, so maybe that step doesn't properly pick up the .all.rock contents?

@hishamhm
Copy link
Member

LuaRocks not finding the .all.rock that was uploaded

The repository does have some .all.rock files added, and it seems to work. If you do for example luarocks search cqueues-pgsql it does list it under "Binary and pure-Lua rocks", and you can see that it gets used if you run luarocks install cqueues-pgsql --verbose (note that luarocks make and luarocks build prefer source rocks, but luarocks install prefers binary and pure-Lua rocks whenever available).

wrt the rock format, while crafting my own ones I noticed that the .all.rock and .src.rock have completely different formats.

They do, because .all.rock is a "binary rock" format, akin to a .linux-x86_64.rock format; .src.rock is a "source rock" format (containing typically a tarball or a git checkout).

@sburke-ce
Copy link

sburke-ce commented Sep 16, 2021

I am having the same issue. From luarocks.org/upload, i can upload the rockspec, but the browser does not recognize any .src.rock file as a candidate for upload. I confirmed this using both Chrome and Safari. It is just a guess, but i suspect that the input tag's accept parameter is causing this problem:

input accept=".src.rock"

I am guessing that the browser will interpret values with a single leading dot as an filename extension, but because ".src.rock" has two dots, it is treated as a literal file name. That would explain while the accept=".rockspec" works, but ".src.rock" does not. I would try changing this to:

input accept=".rock"

or perhaps

input accept="*.src.rock"

using an explicit wildcard.

@hishamhm
Copy link
Member

@sburke-ce are you able to upload using the luarocks upload CLI?

@sburke-ce
Copy link

sburke-ce commented Sep 24, 2021

@sburke-ce are you able to upload using the luarocks upload CLI?

Yes, @hishamhm, the luarockt upload command works for me.

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

4 participants