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

cargo raze fails on macOS if /tmp/cargo-raze/doesnt/exist doesn't exist #545

Open
SigInt42 opened this issue Mar 18, 2023 · 6 comments
Open

Comments

@SigInt42
Copy link

Problematic code:

let mut internal_renderer = Tera::new("/tmp/cargo-raze/doesnt/exist/*").unwrap();

$ cargo raze
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { kind: Io(NotFound), source: Some(Os { code: 2, kind: NotFound, message: "No such file or directory" }) }', /Users/foobar/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-raze-0.16.1/src/rendering/bazel.rs:78:77
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

But if I create /tmp/cargo-raze/doesnt/exist it works:

$ mkdir -p /tmp/cargo-raze/doesnt/exist
$ cargo raze
$ echo $?
0

env:

$ rustup --version
rustup 1.25.2 (2023-02-01)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.68.0 (2c8cc3432 2023-03-06)`
@yatbear
Copy link

yatbear commented Mar 22, 2023

I got this error in Linux as well. Additionally this failure has been occurring in one of the CI jobs in my local fork: https://github.com/yatbear/tensorboard/actions/runs/4491201369/jobs/7899333584, but weirdly not in the upstream CI.

@yatbear
Copy link

yatbear commented Mar 31, 2023

Hi cargo-raze team,

This error is now occurring in our main repo now: https://github.com/tensorflow/tensorboard/actions/runs/4574349463/jobs/8078646809

Could you please provide some pointers for this? Thanks!

@groszewn
Copy link

This seems to be coming from Keats/tera#819, as far as I can tell.

groszewn added a commit to groszewn/cargo-raze that referenced this issue Mar 31, 2023
As mentioned in Keats/tera#819, there was a regression in how
non-existent glob paths are handled. Previously, invalid globs would be
expanded to the empty set, but now they lead to an error.

Since this implementation just wants a bogus template directory, we just
load the `Tera::default()` template.

This should address google#545

Signed off by: Nick Groszewski <[email protected]>
@groszewn
Copy link

groszewn commented Apr 3, 2023

Note, we avoid this error in the meantime by specifying --locked during cargo install to ensure the Cargo.lock is honored (instead of having transitive dependencies upgraded).

@dayfine
Copy link

dayfine commented Apr 24, 2023

I saw this when running on Circle CI too, I had to add a line to mkdir -p /tmp/cargo-raze/doesnt/exist/

@dayfine
Copy link

dayfine commented Apr 24, 2023

Probably just need to first create the path instead of relying on certain behavior at Tera's level?

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

4 participants