Skip to content
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

Release 0.13.0 does not compile #44

Closed
jimsalterjrs opened this issue Jul 14, 2022 · 6 comments
Closed

Release 0.13.0 does not compile #44

jimsalterjrs opened this issue Jul 14, 2022 · 6 comments

Comments

@jimsalterjrs
Copy link

When attempting to build from source:

   Compiling httm v0.13.0 (/home/me/httm)
error[E0716]: temporary value dropped while borrowed
   --> src/utility.rs:286:26
    |
286 |     let mut out_locked = std::io::stdout().lock();
    |                          ^^^^^^^^^^^^^^^^^       - temporary value is freed at the end of this statement
    |                          |
    |                          creates a temporary which is freed while still in use
287 |     write!(out_locked, "{}", output_buf)?;
    |     ------------------------------------ borrow later used here
    |
    = note: consider using a `let` binding to create a longer lived value

For more information about this error, try `rustc --explain E0716`.
error: could not compile `httm` due to previous error
cargo-deb: build failed
@jimsalterjrs jimsalterjrs changed the title Release 13.0 does not compile Release 0.13.0 does not compile Jul 14, 2022
@jimsalterjrs
Copy link
Author

0.12.11 built and installed fine on the same machine, btw. (Ubuntu 20.04)

@kimono-koans
Copy link
Owner

kimono-koans commented Jul 15, 2022

Jim, appreciate you taking the time to build from sources, and to file this bug. Know the extra work is not ideal for any user.

My best guess is that this is related to the version of Rust you have installed. Did you install Rust from apt instead of rustup? I believe this code builds with the latest Rust 1.62. Maybe run rustup update if you did install Rust via rustup? If you didn't, yes, this is probably an example of the faster moving Rust ecosystem moving faster than the distributions' packaging.

FYI, sidebar, many Rust packages have a minimum supported Rust version (MSV) they test against and with which they guarantee compatibility. Say versions 1.5 or 1.42. I don't, because I always update to the latest stable Rust version. This is really about me trying to keep httm simple for me.

This is definitely something that could also be checked in a CI/CD pipeline with a GitHub action to just build against the MSV. GitHub actions and CI/CD are not currently on my to-do, but maybe they should be, along with better tests integrated in the repo.

@kimono-koans
Copy link
Owner

This had a pretty simple fix for 1.59 and should build on 20.04 now. See: 580307a

To install the latest bits, without cloning the repo, use: cargo install --git https://github.com/kimono-koans/httm

@jimsalterjrs
Copy link
Author

My best guess is that this is related to the version of Rust you have installed. Did you install Rust from apt instead of rustup?

I first performed the rustup installation as suggested. But when I tried to use cargo in the next step, the machine complained about having no such command available, and offered apt install cargo as a way to get it.

I did a quick check to make sure cargo hadn't simply been put in /opt or something, could not find it, then did apt install cargo. After that, the cargo commands worked, but neither building from master nor building from the source for 0.13.0 worked; both produced the same error shown above.

Dropping back to 0.12.11 did work; beginning from the source for that release cargo deb finished without complaint, and dpkg -i on the deb produced resulted in a working httm binary.

@kimono-koans
Copy link
Owner

I first performed the rustup installation as suggested. But when I tried to use cargo in the next step, the machine complained about having no such command available, and offered apt install cargo as a way to get it.

That's interesting. FYI, it should install to .cargo/bin and add that directory to your path, for me, via . "$HOME/.cargo/env" to my .zshenv. Yeah, might have hit an rustup install bug.

@kimono-koans
Copy link
Owner

I'm closing these both, as I'm now using a GH action to build both Redhat and Debian packages on Ubuntu 18.04. Should work on most distros now.

See: https://github.com/kimono-koans/httm/blob/master/.github/workflows/package-build.yml

Feel free to reopen if you you think additional comments are necessary. Thanks Jim!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants