emk / heroku-buildpack-rust

A buildpack for Rust applications on Heroku, with full support for Rustup, cargo and build caching.
522 stars 186 forks source link

Build is failing, need help to figure this out #28

Closed king-numsgil closed 6 years ago

king-numsgil commented 6 years ago

Build log on Heroku is :

-----> Rust app detected
-----> Downloading rustup
-----> Using rustup to install Rust channel beta
info: downloading installer
error: invalid toolchain name: 'beta
 !     Push rejected, failed to compile Rust app.
 !     Push failed

So, why is it 'beta instead of beta?

RustConfig : VERSION="beta"

If you need more info, I can give it! Thanks for the help!

emk commented 6 years ago

Ouch, I'm sorry to see that. Did this work correctly before? Is it a new project? Have you changed anything recently? Have you forked the buildpack?

I've tried running the relevant portion of the script manually, and everything seems to be working fine, which only makes this more mysterious. :-(

This looks almost like a rustup issue, because the -----> Using rustup to install Rust channel beta line is correct.

One possible solution is to change the following in bin/compile:

set -eu

to:

set -euo xtrace

...and use the more detailed output to see what the script is doing step-by-step.

king-numsgil commented 6 years ago

Forked, modified the line, re-deployed and here is the new log :

+ '[' -z x ']'
+ '[' 0 -ne 1 ']'
+ '[' '!' -z ']'
+ '[' '!' -f /tmp/build_72ed0fb49953b7996b0ca56bae29055f/king-numsgil-numsgil-co-f1b69b7922efdb29d5cc312f26e73568e9c9fcd7//Cargo.toml ']'
+ '[' '!' -z ']'
+ cat
+ . /app/tmp/buildpacks/a242fc781c97920123b6a3a24c43752a5603c0420ace2c6ea6b043a6488281bc124f2c9b7a7e31d253287b154b3fe4efed062216eb9a87936e761f265b7fd956/export
++ export RUSTUP_HOME=/app/tmp/cache/multirust
++ RUSTUP_HOME=/app/tmp/cache/multirust
++ export CARGO_HOME=/app/tmp/cache/cargo
++ CARGO_HOME=/app/tmp/cache/cargo
++ PATH=/app/tmp/cache/cargo/bin:/usr/local/bin:/usr/bin:/bin:/tmp/codon/vendor/bin
+ mkdir -p /app/tmp/cache
+ cd /app/tmp/cache
+ '[' -d /app/tmp/cache/cargo ']'
+ echo '-----> Downloading rustup'
-----> Downloading rustup
+ curl https://sh.rustup.rs -sSf
+ chmod u+x rustup.sh
+ echo '-----> Using rustup to install Rust channel beta
-----> Using rustup to install Rust channel beta
+ ./rustup.sh -y --default-toolchain $'beta\r'
info: downloading installer
error: invalid toolchain name: 'beta
 !     Push rejected, failed to compile Rust app.
 !     Push failed

It was working last week, I was not using a fork (now I am, obviously), I shut down my app and made a new one using the same sources and the problem's still there.

Kinda lost here... Thanks for your time!

P.S. : I'm very new to this Heroku thingy. Learning the platform as well as Rust. The possibility of a stupid mistake is far from zero!

emk commented 6 years ago

Make sure your RustConfig uses Unix line endings. It looks you you're using Windows line endings in a Unix shell script, which will fail in strange and terrible ways. Not an obvious one to diagnose!

emk commented 6 years ago

If that doesn't fix it, it might have snuck in upstream with a pull request. :-( Let me know if that fixes it.

king-numsgil commented 6 years ago

That was it! Thanks a lot!

emk commented 6 years ago

Glad to hear it's working!