cargo-dist: Bash installer is generated with CRLF linebreaks
As in title, the bash installer, for whatever reason, is generated with CRLF, which makes it effectively fail.
❯ cargo dist
analyzing workspace:
portproxy
[bin] portproxy
WARN skipping powershell installer: not building any supported platforms (use --artifacts=global)
bundling portproxy-v0.2.0-aarch64-apple-darwin.tar.xz
bundling portproxy-v0.2.0-installer.sh
building cargo target (aarch64-apple-darwin/dist)
(...)
bundled: /Users/mborejszo/source/portproxy/target/distrib/portproxy-v0.2.0-aarch64-apple-darwin.tar.xz
bundled: /Users/mborejszo/source/portproxy/target/distrib/portproxy-v0.2.0-installer.sh
announcing v0.2.0
portproxy 0.2.0
/Users/mborejszo/source/portproxy/target/distrib/portproxy-v0.2.0-installer.sh
/Users/mborejszo/source/portproxy/target/distrib/portproxy-v0.2.0-aarch64-apple-darwin.tar.xz
[bin] portproxy
[misc] LICENSE.md, README.md
❯ file target/distrib/portproxy-v0.2.0-installer.sh
target/distrib/portproxy-v0.2.0-installer.sh: Bourne-Again shell script text executable, ASCII text, with CRLF, LF line terminators
❯ bash target/distrib/portproxy-v0.2.0-installer.sh
: command not foundproxy-v0.2.0-installer.sh: line 7:
: command not foundproxy-v0.2.0-installer.sh: line 14:
: invalid optionortproxy-v0.2.0-installer.sh: line 15: set: -
set: usage: set [--abefhkmnptuvxBCHP] [-o option] [arg ...]
: command not foundproxy-v0.2.0-installer.sh: line 16:
: command not foundproxy-v0.2.0-installer.sh: line 22:
'arget/distrib/portproxy-v0.2.0-installer.sh: line 23: syntax error near unexpected token `{
'arget/distrib/portproxy-v0.2.0-installer.sh: line 23: `download_binary_and_run_installer() {
Simple solution may be to run dos2unix conversion on the generated installer string.
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 24 (24 by maintainers)
This is becoming more peculiar on hourly basis, huh! 😮
Yeah at this point I’d also vote for “better be sure” approach of #182, as I think no-one really knows why this happens (or does not happen).
i’ve opened a PR that i want to cut a release with to see if it works, if not, i’ll cut one with #182 - honestly i’m just very curious where the errant line endings are coming from at this point. feel like by the end of this i should write a blog post 😅
@milesj , @spitfire05 , thank you so much!! this is very helpful. i am still not 100% certain why i can’t reproduce but i think accepting #182 is the right call. given that i can’t reproduce, i’ll be taking ya’lls word for it that this fixes the issue (though it certainly would make sense to logically and was what @Gankra originally implemented in #148 before my (apparently foolish) git config suggestion) - i’m going to cut a 0.0.5-prerelease and will message here to ask if ya’ll could test it (assuming you are willing?)
Hmm interesting. I think it once generated a non-bugged installer when I was using a locally built
cargo-dist
from master branch, but I could not reproduce it later. Anyway, the simplest way I am reproducing this bug is:bin version used (installed with
cargo install
):I am currently on an M1 mac, will try to check on Windows tomorrow.
Hope that helps.