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

fix rockspec url #11

Merged
merged 2 commits into from
Oct 7, 2023
Merged

fix rockspec url #11

merged 2 commits into from
Oct 7, 2023

Conversation

teto
Copy link
Contributor

@teto teto commented Oct 6, 2023

Fixes #8

@teto teto requested a review from alerque October 6, 2023 22:41
@alerque
Copy link
Member

alerque commented Oct 6, 2023

Can I suggest you add another commit with the previous stable published rockspec version? Exactly how it is (broken or not) would be preferred. That just gives a way to diff from that to the current one to compare. Useful for PR review but also for later debugging other things. You can actually add as many back-releases of published rockspecs as you like, my personal preference is to keep all of them in the rockspecs folder for posterity. It does make it easier down the road to trace changes. But even if you don't do many of them, the last published one would be useful.

@teto
Copy link
Contributor Author

teto commented Oct 7, 2023

maybe you missed it because it was a renaming but I did move from the main folder to "rockspecs/" the currently broken rockspec. Following up on your remark I've added the 6.1 version

@alerque
Copy link
Member

alerque commented Oct 7, 2023

Yes I probably skimmed the diff too fast.

Copy link
Member

@alerque alerque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@teto teto merged commit e4d200c into master Oct 7, 2023
15 checks passed
@teto teto deleted the fix-rockspec branch October 7, 2023 18:57
@alerque
Copy link
Member

alerque commented Oct 7, 2023

And now we cross our fingers and see if this CI run ends in a successful publish to LuaRocks ;-)

@teto
Copy link
Contributor Author

teto commented Oct 7, 2023

I've been waiting for this for the past few months. Crossing fingers indeed xD

@teto
Copy link
Contributor Author

teto commented Oct 7, 2023

and it failed xD ! we dont see the command executed which is sad. I suppose it's a luarocks upload. Not sure why it needs a folder, is that for a rock ? what If I only care about rockspecs ? https://github.com/lunarmodules/lua-iconv/actions/runs/6442931263/job/17494299938#step:8:13

@alerque
Copy link
Member

alerque commented Oct 7, 2023

Nope. I forgot, the way it is setup right now to publish a stable version there also needs to be a matching tag in the Git repo. On the master branch locally can you git tag 7.0.0 on the merge commit this PR produced, then git push --tags? Or I can do the honours if you don't want to.

@alerque
Copy link
Member

alerque commented Oct 7, 2023

In order to verify that the rockspec actually works, it has to have the Git tag because without it the URL mentioned in the rockspec as where to download sources doesn't exist.

@teto
Copy link
Contributor Author

teto commented Oct 7, 2023

I had already created the tag but before the merge so maybe it's missing some file. I'll let you do the honour this time as you know more what needs to be done.

NB: I had created a manual v7.0.0 tag before this MR, feel free to remove/edit it

@alerque
Copy link
Member

alerque commented Oct 7, 2023

Why the deuce does the GH releases interface show me as the one having tagged v7.0.0. I have no recollection of doing that and you just say you did do it! Why is GH contradicting both of us about our own actions?

image

@teto
Copy link
Contributor Author

teto commented Oct 7, 2023

I pushed the tag on your commit, github UI is just lying xD

@alerque
Copy link
Member

alerque commented Oct 7, 2023

I see. The commit is mine and it has no author info on the tag itself so it just makes stuff up. Great.

In any case 8e19fde has fixed your issue, see source.dir in Rockspec Format for details. GitHub allows downloads of source archives with any arbitrary name you want if you ask for the tag name the some valid archive filename. This format means the archive filename and the directory that it extracts to match.

CI ran properly and LuaRocks.org now has a new release.

@alerque
Copy link
Member

alerque commented Oct 7, 2023

I'll just note for the record that editing a rockspec like I just did only works before it successfully publishes. Once it is published to LuaRocks it should be considered immutable (future deploy CI jobs would fail anyway) and if something needs fixing it should be done with a new $ROCKREL bump.

@teto
Copy link
Contributor Author

teto commented Oct 15, 2023

I was trying to run luarocks nix on lua-iconv but it still fails because the rockspecs urls point at a wrong uri:

nix-prefetch-url https://github.com/downloads/ittner/lua-iconv/lua-iconv-7.tar.gz
error: unable to download 'https://github.com/downloads/ittner/lua-iconv/lua-iconv-7.tar.gz': HTTP error 404

       response body:

       Not Found

And the uploaded rockspecs are absent from the rockspec folder too https://luarocks.org/modules/lunarmodules/lua-iconv/7-3 . I am not sure how to fix that properly, if you dont mind having a look

@alerque
Copy link
Member

alerque commented Oct 16, 2023

@teto This appears to be a bug on LuaRocks.org itself and potentially a related one in the luarocks app itself. I'll look into reporting this after mentioning here that your problem is that you're not working with the latest version. The latest release with the correct URL in the rockspec and the rockspec file where it belongs is 7.0.0-2, tagged in Git as v7.0.0.

The src URL listed in the published lua-iconv-7.0.0-2.rockspec is https://github.com/lunarmodules/lua-iconv/archive/v7.0.0/lua-iconv-7.0.0.tar.gz which is correct and works.

I was somewhat surprised to find luarocks install lua-icon works to install 7-3, but the reason is it uses the published src.rock instead of downloading the published rockspec and fetching the sources mentioned in the manifest (which is where your broken link is originating).

I believe the real fix is to make sure LuaRocks.org and luarocks do a better job of sorting version numbers so 7.0.0 is newer than 7, but that might need long term adjustments. The short term workaround is probably tag a new bigger version number.

@alerque
Copy link
Member

alerque commented Oct 16, 2023

I checked out the source of luarocks and the current sorting is deliberate. I disagree that it is the best way, but it intentionally discards segments not present in both strings. In other words 7 and 7.0.0 evaluate to the same version, and the rockrel ends up getting them in the "wrong" order for us. I think we should bump the rockrel to -4 to get past this problem.

@alerque
Copy link
Member

alerque commented Oct 17, 2023

I just pushed a -4 rockrel so LuaRocks.org turns up the newest release as one that has a valid URL in the rockspec, and luarocks install should find it as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

source url unavailable
2 participants