Stream: git-wasmtime

Topic: wasmtime / issue #7377 curl install broken


view this post on Zulip Wasmtime GitHub notifications bot (Oct 26 2023 at 07:08):

monperrus opened issue #7377:

Hi all,

FYI curl-based installation is broken with 404

± curl https://wasmtime.dev/install.sh -sSf | bash
  Installing latest version of Wasmtime (https://api.github.com/repos/bytecodealliance/wasmtime/releases/126307703)
    Checking for existing Wasmtime installation
    Fetching archive for Linux, version https://api.github.com/repos/bytecodealliance/wasmtime/releases/126307703
https://github.com/bytecodealliance/wasmtime/releases/download/https://api.github.com/repos/bytecodealliance/wasmtime/releases/126307703/wasmtime-https://api.github.com/repos/bytecodealliance/wasmtime/releases/126307703-x86_64-linux.tar.xz
curl: (22) The requested URL returned error: 404

Error: Could not download Wasmtime version 'https://api.github.com/repos/bytecodealliance/wasmtime/releases/126307703'. See https://github.com/bytecodealliance/wasmtime/releases for a list of available releases

Thanks!

view this post on Zulip Wasmtime GitHub notifications bot (Oct 26 2023 at 15:17):

alexcrichton commented on issue #7377:

Thanks for the report, can you detail what system you're using? It may be that your system utilities such as curl or cut aren't behaving as the script is expecting.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 26 2023 at 15:23):

monperrus commented on issue #7377:

I'm running Ubuntu 22.04.3 LTS.
Thanks!

view this post on Zulip Wasmtime GitHub notifications bot (Oct 27 2023 at 14:32):

alexcrichton commented on issue #7377:

Can you execute these lines manually and paste their output? Ubuntu 22.04 is pretty standard so I'm not sure why they'd be going wrong.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 30 2023 at 06:53):

monperrus commented on issue #7377:

  curl --silent "https://api.github.com/repos/bytecodealliance/wasmtime/releases/latest" | \
    grep tag_name | \
    cut -d '"' -f 4
https://api.github.com/repos/bytecodealliance/wasmtime/releases/126802444

seems pretty OK

view this post on Zulip Wasmtime GitHub notifications bot (Oct 30 2023 at 13:41):

alexcrichton commented on issue #7377:

Hm so that should print v14.0.2 at this time on the terminal, not a URL, so that's the issue. Can you paste the output of the curl command alone perhaps?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 30 2023 at 16:52):

monperrus commented on issue #7377:

± curl --silent "https://api.github.com/repos/bytecodealliance/wasmtime/releases/latest"
{"url":"https://api.github.com/repos/bytecodealliance/wasmtime/releases/127213349","assets_url":"https://api.github.com/repos/bytecodealliance/wasmtime/releases/127213349/assets","upload_url":"https://uploads.github.com/repos/bytecodealliance/wasmtime/releases/127213349/assets{?name,label}","html_url":"https://github.com/bytecodealliance/wasmtime/releases/tag/v14.0.3","id":127213349,"author":{"login":"github-actions[bot]","id":41898282,"node_id":"MDM6Qm90NDE4OTgyODI=","avatar_url":"https://avatars.githubusercontent.com/in/15368?v=4","gravatar_id":"","url":"https://api.github.com/users/github-actions%5Bbot%5D","html_url":"https://github.com/apps/github-actions","followers_url":"https://api.github.com/users/github-actions%5Bbot%5D/followers","following_url":"https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/github-actions%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/github-actions%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/github-actions%5Bbot%5D/repos","events_url":"https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/github-actions%5Bbot%5D/received_events","type":"Bot","site_admin":false},"node_id":"RE_kwDOBhDaXM4HlR8l","tag_name":"v14.0.3","target_commitish":"main","name":"","draft":false,"prerelease":false,"created_at":"2023-10-30T15:15:54Z","published_at":"2023-10-30T16:04:19Z","assets":[{"url":"https://api.github.com/repos/bytecodealliance/wasmtime/releases/assets/133083898","id":133083898,"node_id":"RA_kwDOBhDaXM4H7rL6","name":"wasi_snapshot_preview1.command.wasm","label":"","uploader":{"login":"github-actions[bot]","id":41898282,"node_id":"MDM6Qm90NDE4OTgyODI=","avatar_url":"https://avatars.githubusercontent.com/in/15368?v=4","gravatar_id":"","url":"https://api.github.com/users/github-actions%5Bbot%5D","html_url":"https://github.com/apps/github-actions","followers_url":"https://api.github.com/users/github-actions%5Bbot%5D/followers","following_url":"https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/github-actions%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/github-actions%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/github-actions%5Bbot%5D/repos","events_url":"https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/github-actions%5Bbot%5D/received_events","type":"Bot","site_admin":false},"content_type":"application/octet-stream","state":"uploaded","size":96692,"download_count":1,"created_at":"2023-10-30T16:04:19Z","updated_at":"2023-10-30T16:04:20Z","browser_download_url":"https://github.com/bytecodealliance/wasmtime/releases/download/v14.0.3/wasi_snapshot_preview1.command.wasm"},{"url":"https://api.github.com/repos/bytecodealliance/wasmtime/releases/assets/133083900","id":133083900,"node_id":"RA_kwDOBhDaXM4H7rL8","name":"wasi_snapshot_preview1.reactor.wasm","label":"","uploader":{"login":"github-actions[bot]","id":41898282,"node_id":"MDM6Qm90NDE4OTgyODI=","avatar_url":"https://avatars.githubusercontent.com/in/15368?v=4","gravatar_id":"","url":"https://api.github.com/users/github-actions%5Bbot%5D","html_url":"https://github.com/apps/github-actions","followers_url":"https://api.github.com/users/github-actions%5Bbot%5D/followers","following_url":"https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/github-actions%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/github-actions%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/github-actions%5Bbot%5D/repos","events_url":"https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/github-actions%5Bbot%5D/received_events","type":"Bot","site_admin":false},"content_type":"application/octet-stream","state":"uploaded","size":109408,"download_count":1,"created_at":"2023-10-30T16:04:20Z","updated_at":"2023-10-30T16:04:20Z","browser_download_url":"https://github.com/bytecodealliance/wasmtime/releases/download/v14.0.3/wasi_snapshot_preview1.reactor.wasm"},{"url":"https://api.github.com/repos/bytecodealliance/wasmtime/releases/assets/133083902","id":133083902,"node_id":"RA_kwDOBhDaXM4H7rL-","name":"wasmtime-v14.0.3-aarch64-linux-c-api.tar.xz","label":"","uploader":{"login":"github-actions[bot]","id":41898282,"node_id":"MDM6Qm90NDE4OTgyODI=","avatar_url":"https://avatars.githubusercontent.com/in/15368?v=4","gravatar_id":"","url":"https://api.github.com/users/github-actions%5Bbot%5D","html_url":"https://github.com/apps/github-actions","followers_url":"https://api.github.com/users/github-actions%5Bbot%5D/followers","following_url":"https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/github-actions%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/github-actions%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/github-actions%5Bbot%5D/repos","events_url":"https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/github-actions%5Bbot%5D/received_events","type":"Bot","site_admin":false},"content_type":"application/octet-stream","state":"uploaded","size":15273120,"download_count":1,"created_at":"2023-10-30T16:04:21Z","updated_at":"2023-10-30T16:04:21Z","browser_download_url":"https://github.com/bytecodealliance/wasmtime/releases/download/v14.0.3/wasmtime-v14.0.3-aarch64-linux-c-api.tar.xz"},{"url":"https://api.github.com/repos/bytecodealliance/wasmtime/releases/assets/133083904","id":133083904,"node_id":"RA_kwDOBhDaXM4H7rMA","name":"wasmtime-v14.0.3-aarch64-linux.tar.xz","label":"","uploader":{"login":"github-actions[bot]","id":41898282,"node_id":"MDM6Qm90NDE4OTgyODI=","avatar_url":"https://avatars.githubusercontent.com/in/15368?v=4","gravatar_id":"","url":"https://api.github.com/users/github-actions%5Bbot%5D","html_url":"https://github.com/apps/github-actions","followers_url":"https://api.github.com/users/github-actions%5Bbot%5D/followers","following_url":"https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/github-actions%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/github-actions%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/github-actions%5Bbot%5D/repos","events_url":"https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/github-actions%5Bbot%5D/received_events","type":"Bot","site_admin":false},"content_type":"application/octet-stream","state":"uploaded","size":8476928,"download_count":2,"created_at":"2023-10-30T16:04:22Z","updated_at":"2023-10-30T16:04:22Z","browser_download_url":"https://github.com/bytecodealliance/wasmtime/releases/download/v14.0.3/wasmtime-v14.0.3-aarch64-linux.tar.xz"},{"url":"https://api.github.com/repos/bytecodealliance/wasmtime/releases/assets/133083906","id":133083906,"node_id":"RA_kwDOBhDaXM4H7rMC","name":"wasmtime-v14.0.3-aarch64-macos-c-api.tar.xz","label":"","uploader":{"login":"github-actions[bot]","id":41898282,"node_id":"MDM6Qm90NDE4OTgyODI=","avatar_url":"https://avatars.githubusercontent.com/in/15368?v=4","gravatar_id":"","url":"https://api.github.com/users/github-actions%5Bbot%5D","html_url":"https://github.com/apps/github-actions","followers_url":"https://api.github.com/users/github-actions%5Bbot%5D/followers","following_url":"https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/github-actions%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/github-actions%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/github-actions%5Bbot%5D/repos","events_url":"https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/github-actions%5Bbot%5D/received_events","type":"Bot","site_admin":false},"content_type":"application/octet-stream","state":"uploaded","size":12509852,"download_count":1,"created_at":"2023-10-30T16:04:23Z","updated_at":"2023-10-30T16:04:23Z","browser_download_url":"https://github.com/bytecodealliance/wasmtime/releases/download/v14.0.3/wasmtime-v14.0.3-aarch64-macos-c-api.tar.xz"},{"url":"https://api.github.com/repos/bytecodealliance/wasmtime/releases/asse
[message truncated]

view this post on Zulip Wasmtime GitHub notifications bot (Oct 30 2023 at 19:56):

alexcrichton commented on issue #7377:

Ah I'm not sure why but your curl is printing compact JSON where the script is expecting "pretty" JSON. I'm not sure why that's happening, but that's why the script is failing.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 31 2023 at 06:11):

monperrus commented on issue #7377:

Github sends compact JSON.
As far as I know, curl has no capability for pretty-printing json.
If we want to have pretty JSON, we need to send it through json_pp or jq.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 31 2023 at 06:39):

cfallin commented on issue #7377:

Weirdly, exactly that curl command returns formatted JSON for me; I wonder if we're hitting some sort of A/B test, or if there's some middlebox (compressing proxy or similar) somewhere in your network path, or...?

IIRC, one of the considerations against using jq was that it would have to be installed on the user's machine, and install.sh is meant to work in as many places as possible without unnecessary dependencies.

I wonder, though, if we can craft a sed regex or similar that grabs the tag name out of a single line or multiline JSON?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 31 2023 at 08:13):

monperrus commented on issue #7377:

IIRC, one of the considerations against using jq was that it would have to be installed on the user's machine

I see.

Weirdly, exactly that curl command returns formatted JSON for me

What! This is very surprising. I really don't see which component in the stack does that.

I wonder, though, if we can craft a sed regex or similar that grabs the tag name out of a single line or multiline JSON?

brittle. honestly, jq would be much better. The target users of wasmtime are probably tech-savvy enough to install jq by themselves if need be.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 02 2023 at 11:31):

monperrus commented on issue #7377:

I confirm that changing install.sh to | json_pp works!

  curl --silent "https://api.github.com/repos/bytecodealliance/wasmtime/releases/latest" | json_pp | \
    grep tag_name | \
    cut -d '"' -f 4

With this fix I have wasmtime on my machine, thanks!

view this post on Zulip Wasmtime GitHub notifications bot (Nov 02 2023 at 16:46):

cfallin commented on issue #7377:

brittle. honestly, jq would be much better. The target users of wasmtime are probably tech-savvy enough to install jq by themselves if need be.

A consideration when developing infrastructure like this is that the machines we may run on might not look like our own developer machines: for example, we want it to be easy to install wasmtime on a fresh virtual machine, server, CI environment, minimal Docker container, etc. The requirement to install JSON-munging tools would be a bit of a speedbump causing folks to trip; the use of a shell script and core Unix utilities only (plus curl) is pretty intentional here.

It's too bad there's no API endpoint that gives us exactly the latest release tag and nothing else. I wonder if some automation could e.g. put some file in place that helps with this -- @alexcrichton, what would you think about something in the release process that updates a latest-release.txt in the static site so one could do curl https://wasmtime.dev/latest-release.txt?

view this post on Zulip Wasmtime GitHub notifications bot (Nov 02 2023 at 17:29):

bjorn3 commented on issue #7377:

Using | sed 's/.*tag_name": *"//' | sed 's/".*//' instead of | grep tag_name | cut -d '"' -f 4 should work for both pretty and unpretty json.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 02 2023 at 18:20):

alexcrichton commented on issue #7377:

I like the idea of latest-release.txt but I don't know how to do that easily off the top of my head. I'd be tempted to go with @bjorn3's suggestion first if we can, but that should be confirmed to work on macOS since I know that they've got a BSD version of sed (or something like that) and it's different from the GNU version sometimes.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 02 2023 at 18:39):

cfallin commented on issue #7377:

Unfortunately the sed command lines above don't work on macOS -- with pretty JSON, the line containing the tag is edited to just the tag, but a bunch of other lines remain:

cfallin@fastly2:~% curl --silent "https://api.github.com/repos/bytecodealliance/wasmtime/releases/latest" | sed 's/.*tag_name": *"//' | sed 's/".*//' | head -n 30
{
  [ lots of blank lines ]
  },

v14.0.4

It appears that BSD sed doesn't do multiline edits -- the man-page says "Normally, sed cyclically copies a line of input, not including its terminating newline character, ..." (and I can't find another flag that would override that).

So it appears we're back to

view this post on Zulip Wasmtime GitHub notifications bot (Nov 02 2023 at 18:43):

bjorn3 commented on issue #7377:

Try adding | tr -d '\n' before the sed commands. This will remove all newlines.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 02 2023 at 18:58):

cfallin commented on issue #7377:

That worked for me -- just sent a PR for this, thanks!

view this post on Zulip Wasmtime GitHub notifications bot (Nov 02 2023 at 19:12):

cfallin closed issue #7377:

Hi all,

FYI curl-based installation is broken with 404

± curl https://wasmtime.dev/install.sh -sSf | bash
  Installing latest version of Wasmtime (https://api.github.com/repos/bytecodealliance/wasmtime/releases/126307703)
    Checking for existing Wasmtime installation
    Fetching archive for Linux, version https://api.github.com/repos/bytecodealliance/wasmtime/releases/126307703
https://github.com/bytecodealliance/wasmtime/releases/download/https://api.github.com/repos/bytecodealliance/wasmtime/releases/126307703/wasmtime-https://api.github.com/repos/bytecodealliance/wasmtime/releases/126307703-x86_64-linux.tar.xz
curl: (22) The requested URL returned error: 404

Error: Could not download Wasmtime version 'https://api.github.com/repos/bytecodealliance/wasmtime/releases/126307703'. See https://github.com/bytecodealliance/wasmtime/releases for a list of available releases

Thanks!


Last updated: Nov 22 2024 at 16:03 UTC