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 watch triggered by ignored file with non locked installation #176

Closed
arnodb opened this issue Jul 13, 2021 · 5 comments
Closed

Cargo watch triggered by ignored file with non locked installation #176

arnodb opened this issue Jul 13, 2021 · 5 comments
Labels

Comments

@arnodb
Copy link

arnodb commented Jul 13, 2021

Hi, the main problem is that cargo-watch is triggered by an update of .cargo/.package-cache when /.cargo/.package-cache is in the .gitignore and also marked as ignored by -i ".cargo/*". That leads to an infinite watch loop.

And I've spent half a day trying to narrow down the problem. Here are the results.

It can be reproduced with multiple versions of cargo-watch: 7.7.0, 7.7.1, 7.8.0. The following concerns 7.8.0.

--poll does not have that problem.

I have a version of cargo-watch compiled in May or June 2021 which does not have that problem. If I reinstall it in the exact same setup (basically debian buster), the problem appears.

If I do cargo install cargo-watch --locked then the problem vanishes. That is the first glimpse of hope.

The difference between the two can be summarized to the following diff in dependency versions:

--- aaa4        2021-07-13 14:13:01.771755708 +0200
+++ aaa3        2021-07-13 14:08:53.706883521 +0200
@@ -1,12 +1,12 @@
-   Compiling aho-corasick v0.7.18
+   Compiling aho-corasick v0.7.15
    Compiling ansi_term v0.11.0
    Compiling atty v0.2.14
    Compiling autocfg v1.0.1
    Compiling bitflags v1.2.1
-   Compiling bstr v0.2.16
+   Compiling bstr v0.2.15
    Compiling camino v1.0.4
    Compiling cargo-watch v7.8.0
-   Compiling cc v1.0.69
+   Compiling cc v1.0.67
    Compiling cfg-if v0.1.10
    Compiling cfg-if v1.0.0
    Compiling chrono v0.4.19
@@ -17,11 +17,11 @@
    Compiling derive_builder_core v0.10.2
    Compiling derive_builder_macro v0.10.2
    Compiling derive_builder v0.10.2
-   Compiling embed-resource v1.6.3
-   Compiling env_logger v0.8.4
+   Compiling embed-resource v1.6.2
+   Compiling env_logger v0.8.3
    Compiling filetime v0.2.14
    Compiling fnv v1.0.7
-   Compiling globset v0.4.8
+   Compiling globset v0.4.6
    Compiling glob v0.3.0
    Compiling ident_case v1.0.1
    Compiling inotify-sys v0.1.5
@@ -29,27 +29,27 @@
    Compiling iovec v0.1.4
    Compiling lazycell v1.3.0
    Compiling lazy_static v1.4.0
-   Compiling libc v0.2.98
+   Compiling libc v0.2.94
    Compiling log v0.4.14
-   Compiling memchr v2.4.0
+   Compiling memchr v2.3.4
    Compiling mio-extras v2.0.6
    Compiling mio v0.6.23
    Compiling net2 v0.2.37
    Compiling nix v0.20.0
-   Compiling notify v4.0.17
+   Compiling notify v4.0.16
    Compiling num-integer v0.1.44
    Compiling num-traits v0.2.14
-   Compiling proc-macro2 v1.0.27
+   Compiling proc-macro2 v1.0.26
    Compiling quote v1.0.9
-   Compiling regex-syntax v0.6.25
-   Compiling regex v1.5.4
+   Compiling regex-syntax v0.6.23
+   Compiling regex v1.4.6
    Compiling same-file v1.0.6
    Compiling shell-escape v0.1.5
    Compiling slab v0.4.3
    Compiling stderrlog v0.5.1
    Compiling strsim v0.10.0
    Compiling strsim v0.8.0
-   Compiling syn v1.0.73
+   Compiling syn v1.0.71
    Compiling termcolor v1.1.2
    Compiling term_size v0.3.2
    Compiling textwrap v0.11.0

I did not investigate more, but I think that is a good start for further investigation. Maybe somebody will have a flash when seening that diff :).

@arnodb
Copy link
Author

arnodb commented Jul 13, 2021

I forgot to mention I use a nightly toolchain: nightly-2021-04-19-x86_64-unknown-linux-gnu

@arnodb
Copy link
Author

arnodb commented Jul 13, 2021

Bumping globset from 0.4.6 to >=0.4.7 is triggering the problem.

@arnodb
Copy link
Author

arnodb commented Jul 13, 2021

This is due to BurntSushi/ripgrep@7534d51 in conjunction with watchexec adding /** to all entries of .gitignore.

According to the mentioned commit, I suspect watchexec should add 2 entries in that case.

@passcod
Copy link
Member

passcod commented Jul 14, 2021

That globset upgrade breaks our tests (and various other behaviour), so I've pinned it back, and that's why --locked works. I'll get cargo-watch to pin without --locked for now; reviewing the entire pattern behaviour so we can upgrade along will come... later.

@passcod
Copy link
Member

passcod commented Jul 15, 2021

Done in 7.8.1

@passcod passcod closed this as completed Jul 15, 2021
@passcod passcod added the bug label Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants