Document installing without the install script - #26
Conversation
The only documented install was `curl … | sh`, which plenty of employers forbid outright. Nothing new has to be published for the alternative to work: `manifest.json` already lists every target with its checksum, the archives are plain HTTP, and each one holds a single `mapbox` executable. So this writes down what was already true. Every command in the new section was run verbatim before being committed, including the versioned URL: `cli.mapbox.com/v0.2.1/…` and `cli.mapbox.com/latest/…` both serve, `0.2.1/…` without the `v` is a 403, and `grep "$file" SHA256SUMS | shasum -a 256 -c -` is what checks one archive without the other four reporting as missing. Also drops "signed" from the sentence above it, because the builds are not. `codesign -dv` on the published macOS artifact reports `Signature=adhoc`, `TeamIdentifier=not set` — a linker signature, which arm64 requires to run at all, not a Mapbox one. There is no signing or notarization step anywhere in the publish pipeline, and none for Authenticode either. What the install script checks is the SHA-256 checksum, which the sentence already said. That has a consequence a manual installer meets and a `curl … | sh` user never does, so the section ends with it: `curl` attaches no quarantine flag, a browser download does, and Gatekeeper refuses an unsigned binary carrying one. 596 tests, fmt clean, no broken in-page anchors.
The section named `x86_64-pc-windows-msvc` as one of five published targets
and then offered only a `sh` block: `curl`, `grep`, `shasum`, `tar` and a
`mv` into `~/.local/bin`. A Windows reader was told their build exists and
given no way to fetch or check it, in the one section that exists for people
who cannot run the install script.
PowerShell takes a shorter route than the POSIX one rather than a translated
version of it. `manifest.json` is structured and `Invoke-RestMethod` parses
it, so there is no `SHA256SUMS` line to pick apart — the sha256 arrives as a
field beside the filename.
`Invoke-WebRequest` and `Get-FileHash` rather than `curl` and `sha256sum`:
`curl` is an alias for `Invoke-WebRequest` in Windows PowerShell and the real
thing in pwsh, and neither `sha256sum` nor `shasum` is guaranteed to be
present at all.
Run before committing, against the real published artifact, on pwsh 7.6:
verified and extracted: mapbox-v0.2.1-x86_64-pc-windows-msvc.zip
mapbox.exe
My first version parsed `SHA256SUMS` with `Select-String` and threw
"checksum mismatch" on a correct download, because the match returned null
and the comparison was against an empty string. It would have told a reader
their download was corrupt. That is the version this replaces.
|
|
||
| Run `mapbox --help` once it's on your `PATH`. | ||
|
|
||
| ### Download the archive yourself |
There was a problem hiding this comment.
We already support specifying a version in the install command. Could we use that here instead of the manual steps?
For example:
curl -fsSL https://cli.mapbox.com/install.sh | MAPBOX_CLI_VERSION=v0.2.1 sh
mattpodwysocki
left a comment
There was a problem hiding this comment.
Half yes, half no — and the "no" half is why this section exists.
Why the manual steps stay
The section opens with "if piping one into a shell is not allowed where you work". curl … | MAPBOX_CLI_VERSION=v0.2.1 sh is still piping a script into a shell, so for the reader this section is written for, it isn't an alternative — it's the thing they already can't do. Plenty of shops block it outright, and a coding agent's sandbox refuses it, which is what prompted the section: mapbox/mapbox-cli-private#162 has the detail.
But you found a real gap, and I've fixed it
MAPBOX_CLI_VERSION appeared in no .md anywhere in this repository. Suggesting people use it meant suggesting something they had no way to discover — so your comment landed on a documentation bug, just not the one it was aimed at.
It's now documented in the install section, next to the install commands where someone pinning a version would look, along with MAPBOX_INSTALL_DIR which was also missing:
curl -fsSL https://cli.mapbox.com/install.sh | MAPBOX_CLI_VERSION=0.2.1 shAnd chasing it turned up that the variable was broken for the spelling anyone would actually use — a bare 0.2.1 403'd, because the channel's directories carry a v. Both are in #29, which also answers your note on #27.
So: this PR keeps the manual download steps, #29 documents and fixes the pinning. I think that covers what you were after from both directions — let me know if you'd still like something changed here.
#26 landed first, so its Added/Fixed entries and this branch's Fixed entries both belong under `## Unreleased`. The README merged on its own, but the merge left `MAPBOX_INSTALL_DIR` explained twice — once in the install section this branch documents it in, and once in #26's manual-download section. The second is now a pointer rather than a second explanation.
Only CHANGELOG.md conflicted: #26 added an Added and a Fixed entry where this branch has a Changed block. All seven entries belong, so the section is now Added / Changed / Fixed, the order 0.2.0 uses. The source changes merged on their own.
Only CHANGELOG.md conflicted. #26's Added entry and its Fixed entry both belong alongside this branch's Fixed entry, so the section is one Added and one Fixed holding both. No source change was involved.
Reported on #27. The channel's directories are named `v0.2.1`, and `MAPBOX_CLI_VERSION` went into the URL untouched — so the spelling a person would actually copy failed: $ MAPBOX_CLI_VERSION=0.2.1 … curl: (56) The requested URL returned error: 403 mapbox-cli: could not read https://cli.mapbox.com/0.2.1/manifest.json Every place a version is read from shows it without the `v`: `mapbox --version`, CHANGELOG.md, Cargo.toml. So the one spelling that worked was the one nobody sees, and the failure was a bare S3 `403`, which reads as "you are not allowed" rather than "no such version". The review asked for a note about it. A note documents a trap; this removes it. Both installers now prepend the `v` when the value starts with a digit, which leaves `latest` — and any other channel name — alone, since only a leading digit means a version number is being named. Verified against the live channel: `0.2.1`, `v0.2.1` and `latest` all install 0.2.1. Two cases added to each installer suite, including one pinning `latest` because getting that wrong would break the default install rather than an edge case. Both confirmed to fail with the fix reverted. **And the variable is now documented at all**, which is the other half of this. `MAPBOX_CLI_VERSION` appeared in no `.md` in the repository — the reviewer on #26 suggested using it, which is how I found that a reader had no way to know it exists. It goes in the install section with `MAPBOX_INSTALL_DIR`, which was also undocumented. 601 tests, both installer suites green, fmt clean, no broken anchors.
The only documented way to install was
curl … | sh, which plenty of employers forbid outright. Nothing new has to be published for the alternative to work —manifest.jsonalready lists every target with its checksum, the archives are plain HTTP, and each holds a singlemapboxexecutable. This writes down what was already true.Every command was run verbatim before being committed
Not adapted from the install script, not reasoned about:
Things that check turned up, which a plausible-looking doc would have got wrong:
cli.mapbox.com/v0.2.1/…serves, and so doeslatest/…, but0.2.1/…without thevis a 403. The version in the path is the tag, not the version string.shasum -a 256 -c SHA256SUMSfails for anyone who downloaded one archive, since the other four report as missing.grep "$file" SHA256SUMS | shasum -a 256 -c -is the form that works, and it's what the section says.cdstep and nothing else to place.The builds are not signed, so that word is gone
The sentence above the install commands said Mapbox publishes signed builds. On the published macOS artifact:
That's the linker's signature, which arm64 requires to execute at all — not a Mapbox one. I then grepped the publish pipeline for
codesign,notarytool,signtool, certificates and keychains: there is no signing step anywhere, on any platform. What the install script actually checks is the SHA-256 checksum, which the same sentence already said correctly.That has a consequence a manual installer meets and a
curl … | shuser never does, so the section ends with it:curlattaches no quarantine flag (verified — the download carries onlycom.apple.provenance), a browser download does, and Gatekeeper refuses an unsigned binary carrying one.xattr -d com.apple.quarantine mapboxclears it.I've filed the signing gap separately rather than leaving it as a README footnote — it's a pipeline change, not a docs one.
596 tests,
cargo fmt --checkclean, no broken in-page anchors, and the TOC has the new subsection.