-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
errors in the installation command #423
Comments
@bsun0802 without more details (like your OS info, your What I can guess is that the Questions:
Thank you, Abdou |
closes rust-lang#423 If the parsed JSON data curled during a bash installation is not valid, use the repository's tag files as a backup. If those files don't exist somehow, then checkout the master branch and install it.
Thanks,
{
"url": "https://api.github.com/repos/rust-lang/rustlings/releases/25420239",
"assets_url": "https://api.github.com/repos/rust-lang/rustlings/releases/25420239/assets",
"upload_url": "https://uploads.github.com/repos/rust-lang/rustlings/releases/25420239/assets{?name,label}",
"html_url": "https://github.com/rust-lang/rustlings/releases/tag/3.0.0",
"id": 25420239,
"node_id": "MDc6UmVsZWFzZTI1NDIwMjM5",
"tag_name": "3.0.0",
"target_commitish": "master",
"name": "Rustlings 3.0.0",
"draft": false,
"author": {
"login": "fmoko",
"id": 6445316,
"node_id": "MDQ6VXNlcjY0NDUzMTY=",
"avatar_url": "https://avatars2.githubusercontent.com/u/6445316?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/fmoko",
"html_url": "https://github.com/fmoko",
"followers_url": "https://api.github.com/users/fmoko/followers",
"following_url": "https://api.github.com/users/fmoko/following{/other_user}",
"gists_url": "https://api.github.com/users/fmoko/gists{/gist_id}",
"starred_url": "https://api.github.com/users/fmoko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/fmoko/subscriptions",
"organizations_url": "https://api.github.com/users/fmoko/orgs",
"repos_url": "https://api.github.com/users/fmoko/repos",
"events_url": "https://api.github.com/users/fmoko/events{/privacy}",
"received_events_url": "https://api.github.com/users/fmoko/received_events",
"type": "User",
"site_admin": false
},
"prerelease": false,
"created_at": "2020-04-11T22:01:08Z",
"published_at": "2020-04-11T22:04:24Z",
"assets": [
],
"tarball_url": "https://api.github.com/repos/rust-lang/rustlings/tarball/3.0.0",
"zipball_url": "https://api.github.com/repos/rust-lang/rustlings/zipball/3.0.0",
"body": "See the [changelog](https://github.com/fmoko/rustlings/blob/master/CHANGELOG.md#300-2020-04-11) for what's changed.\r\n\r\nAs for what makes this a breaking release, in #278 we decided to make the `compile` exercise mode log its output to stdout. Since this changes existing user behaviour in a (broadly) backwards-incompatible way, we decided to make this a major release.\r\n\r\nThe good thing is that you don't need to do anything to upgrade! 🎉 \r\n\r\nTo upgrade:\r\n\r\n```sh\r\ngit fetch\r\ngit checkout tags/3.0.0\r\n```"
} |
Your copy of curl seems to be functioning as required, (and expected.) It looks like your python3 install is having problems parsing the json. You can verify with: curl -s https://api.github.com/repos/rust-lang/rustlings/releases/latest | $(command -v python3) -c "import json,sys;obj=json.load(sys.stdin);print(obj['tag_name']);" I'm thinking of patching the install script to default to jq rather than python. If you have command -v jq||brew install jq;
curl -s https://api.github.com/repos/rust-lang/rustlings/releases/latest | jq -r '.tag_name' |
rust-lang#423 (comment) was having problems installing. (I think their python3 install was having a problem parsing json?) Having an install fail just because it was unable to locate the version number seems like "my kingdom for a horseshoe nail" now that the version is relatively stable. (Its good to have a single point of truth, but) we could have an emergency version number of "3.0.0" in this file rather than have the install fail because rust and rustlings does not depend on python for to function. Having this rustlings install depend on bash that depends on python seems like "extra steps" that could be avoided. The pure shell version also works with some other shells such as dash.
Hi @alexxroche While I agree that I am not saying that having python as a dependency is the safest thing to do, but it is definitely safer (in terms of availability and function) than relying on On top of that, when you add Ultimately, the safest thing to do (in my opinion) when dealing with this installation script may be to fall back on the If you look at my proposed changes in the linked pull request, you will see that the above mentioned attempts are being made to fetch a tag to install. In summary, I am not saying that any one tool is better than the other. What I am trying to avoid is ultimately having to deal with more issues that will arise from adding new dependencies. I am definitely happy to be proven wrong in the name of ease and efficiency of use. Thank you, Abdou |
@bsun0802 are you able to see a tag name when you run the following directly from your terminal:
? Thank you, Abdou |
I agree that adding dependencies is unhelpful. I have started to create a version of the Installing jq on OSX can be done with |
@alexxroche Let me begin by saying that I am for any installation that bypasses as many dependencies as possible. So, when you're done with the one you're working on, I will be the first to stick my sign of approval (if that means anything really) on it. My reservation was (and still is) that replacing one dependency with another may not solve the problem this issue is raising, and could eventually bring about other issues. Thank you! Abdou |
@AbdouSeck |
Thank you @bsun0802 (Looks like my guess was wrong about python being the problem.)
but have been unable to recreate this issue, (though I don't currently have a copy of OSX to check that We could have |
Hi @alexxroche , Great thanks! I see, the network problem might be the issues. I'm from China so there definitely gonna be network (GFW) problems. I'll try to figure them out, I might need to perform some steps manually. Thanks for all of you guys time and helps!! |
@bsun0802 Ah right, GitHub takes a long time to reach from China, so there may be timeouts. I'll see that we upload future Rustlings releases to some sort of edge servers so that they can be reached from most places in the world without erroring. Sorry about this! |
Or have the install script try to download a few times, (until timeout) and give a clear "Network Error" message if it is unable to download. (Its a shell script, so we can leverage I think the poor User eXperience was due to the python panic message when it tried to parse an empty file. I've written a version of the install that removes the python dependency and, (hopefully) will give clearer error messages if there is a network problem. (I can create a pull request if needed, but I wasn't sure if removing a dependency, (and adding the option to leverage jq) would be progress in the optimal direction for this project.) |
closes rust-lang#423 If the parsed JSON data curled during a bash installation is not valid, use the repository's tag files as a backup. If those files don't exist somehow, then checkout the master branch and install it.
closes rust-lang#423 If the parsed JSON data curled during a bash installation is not valid, use the repository's tag files as a backup. If those files don't exist somehow, then checkout the master branch and install it.
closes rust-lang#423 If the parsed JSON data curled during a bash installation is not valid, use the repository's tag files as a backup. If those files don't exist somehow, then checkout the master branch and install it.
closes rust-lang#423 If the parsed JSON data curled during a bash installation is not valid, use the repository's tag files as a backup. If those files don't exist somehow, then checkout the master branch and install it.
The following error appears when installing rustlings with provided script
curl -L https://git.io/rustlings | bash
the rustlings executable is installed successfully tho. Please give it a check.===============================
Traceback (most recent call last):
File "", line 1, in
File "/opt/anaconda3/lib/python3.7/json/init.py", line 296, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "/opt/anaconda3/lib/python3.7/json/init.py", line 348, in loads
return _default_decoder.decode(s)
File "/opt/anaconda3/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/opt/anaconda3/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Checking out version ...
error: pathspec 'tags/' did not match any file(s) known to git
The text was updated successfully, but these errors were encountered: