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

[v.7.4.0] -w usage loops forever #149

Closed
apiraino opened this issue Jun 5, 2020 · 4 comments
Closed

[v.7.4.0] -w usage loops forever #149

apiraino opened this issue Jun 5, 2020 · 4 comments

Comments

@apiraino
Copy link

apiraino commented Jun 5, 2020

I used v7.3.0 with the following command line:

cargo watch -w src/ -x run

after the update to v.7.4.0 that command seems to not be working anymore (my Warp server is not starting anymore, I expect to it run and listen on localhost:3000).

Fiddling with command line parameters I could work around this new behaviour by adding --no-gitignore. The following command makes cargo watch work again as expected:

cargo watch --no-gitignore -w src/ -x run

I've tried editing the content or .gitignore or removing the file altogether but I didnt notice any difference.

Am I possibly missing something?

Thanks for your help!

Attaching a debug run of both cases in case it helps

Debug logs
$ cargo watch --debug -w src/ -x run
>>> Load Git/VCS ignores: true
>>> Load .ignore ignores: true
>>> Default ignores: ["*/.DS_Store", "*.sw?", "*.sw?x", "#*#", ".#*", ".*.kate-swp", "*/.hg/**", "*/.git/**", "*/.svn/**", "*.db", "*.db-*", "*/*.db-journal/**", "*/target/**"]
>>> All ignores: ["*/.DS_Store", "*.sw?", "*.sw?x", "#*#", ".#*", ".*.kate-swp", "*/.hg/**", "*/.git/**", "*/.svn/**", "*.db", "*.db-*", "*/*.db-journal/**", "*/target/**"]
>>> File updates debounce: 0.5 seconds
>>> Watches: ["src/"]
>>> Commands: ["cargo run"]
>>> Watchexec arguments: Args { cmd: ["cargo run"], paths: ["src/"], filters: [], ignores: ["*/.DS_Store", "*.sw?", "*.sw?x", "#*#", ".#*", ".*.kate-swp", "*/.hg/**", "*/.git/**", "*/.svn/**", "*.db", "*.db-*", "*/*.db-journal/**", "*/target/**"], clear_screen: true, signal: None, restart: true, debounce: 500, debug: true, run_initially: true, no_shell: false, no_vcs_ignore: false, no_ignore: false, once: false, poll: false, poll_interval: 500, watch_when_idle: false }

and

$ cargo watch --debug --no-gitignore -w src/ -x run
>>> Load Git/VCS ignores: false
>>> Load .ignore ignores: true
>>> Default ignores: ["*/.DS_Store", "*.sw?", "*.sw?x", "#*#", ".#*", ".*.kate-swp", "*/.hg/**", "*/.git/**", "*/.svn/**", "*.db", "*.db-*", "*/*.db-journal/**", "*/target/**"]
>>> All ignores: ["*/.DS_Store", "*.sw?", "*.sw?x", "#*#", ".#*", ".*.kate-swp", "*/.hg/**", "*/.git/**", "*/.svn/**", "*.db", "*.db-*", "*/*.db-journal/**", "*/target/**"]
>>> File updates debounce: 0.5 seconds
>>> Watches: ["src/"]
>>> Commands: ["cargo run"]
>>> Watchexec arguments: Args { cmd: ["cargo run"], paths: ["src/"], filters: [], ignores: ["*/.DS_Store", "*.sw?", "*.sw?x", "#*#", ".#*", ".*.kate-swp", "*/.hg/**", "*/.git/**", "*/.svn/**", "*.db", "*.db-*", "*/*.db-journal/**", "*/target/**"], clear_screen: false, signal: None, restart: true, debounce: 500, debug: true, run_initially: true, no_shell: false, no_vcs_ignore: true, no_ignore: false, once: false, poll: false, poll_interval: 500, watch_when_idle: false }
*** Adding ignore: "*/.DS_Store/**"
*** Adding ignore: "*.sw?/**"
*** Adding ignore: "*.sw?x/**"
*** Adding ignore: "**/#*#/**"
*** Adding ignore: "**/.#*"
*** Adding ignore: "**/.*.kate-swp/**"
*** Adding ignore: "*/.hg/**"
*** Adding ignore: "*/.git/**"
*** Adding ignore: "*/.svn/**"
*** Adding ignore: "*.db/**"
*** Adding ignore: "*.db-*"
*** Adding ignore: "*/*.db-journal/**"
*** Adding ignore: "*/target/**"
*** glob converted to regex: Glob { glob: "*/.DS_Store/**", re: "(?-u)^.*/\\.DS_Store(?:/?|/.*)$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: true }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('.'), Literal('D'), Literal('S'), Literal('_'), Literal('S'), Literal('t'), Literal('o'), Literal('r'), Literal('e'), RecursiveSuffix]) }
*** glob converted to regex: Glob { glob: "*.sw?/**", re: "(?-u)^.*\\.sw.(?:/?|/.*)$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: true }, tokens: Tokens([ZeroOrMore, Literal('.'), Literal('s'), Literal('w'), Any, RecursiveSuffix]) }
*** glob converted to regex: Glob { glob: "*.sw?x/**", re: "(?-u)^.*\\.sw.x(?:/?|/.*)$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: true }, tokens: Tokens([ZeroOrMore, Literal('.'), Literal('s'), Literal('w'), Any, Literal('x'), RecursiveSuffix]) }
*** glob converted to regex: Glob { glob: "**/#*#/**", re: "(?-u)^(?:/?|.*/)\\#.*\\#(?:/?|/.*)$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: true }, tokens: Tokens([RecursivePrefix, Literal('#'), ZeroOrMore, Literal('#'), RecursiveSuffix]) }
*** glob converted to regex: Glob { glob: "**/.#*", re: "(?-u)^(?:/?|.*/)\\.\\#.*$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: true }, tokens: Tokens([RecursivePrefix, Literal('.'), Literal('#'), ZeroOrMore]) }
*** glob converted to regex: Glob { glob: "**/.*.kate-swp/**", re: "(?-u)^(?:/?|.*/)\\..*\\.kate\\-swp(?:/?|/.*)$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: true }, tokens: Tokens([RecursivePrefix, Literal('.'), ZeroOrMore, Literal('.'), Literal('k'), Literal('a'), Literal('t'), Literal('e'), Literal('-'), Literal('s'), Literal('w'), Literal('p'), RecursiveSuffix]) }
*** glob converted to regex: Glob { glob: "*/.hg/**", re: "(?-u)^.*/\\.hg(?:/?|/.*)$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: true }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('.'), Literal('h'), Literal('g'), RecursiveSuffix]) }
*** glob converted to regex: Glob { glob: "*/.git/**", re: "(?-u)^.*/\\.git(?:/?|/.*)$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: true }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('.'), Literal('g'), Literal('i'), Literal('t'), RecursiveSuffix]) }
*** glob converted to regex: Glob { glob: "*/.svn/**", re: "(?-u)^.*/\\.svn(?:/?|/.*)$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: true }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('.'), Literal('s'), Literal('v'), Literal('n'), RecursiveSuffix]) }
*** glob converted to regex: Glob { glob: "*.db/**", re: "(?-u)^.*\\.db(?:/?|/.*)$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: true }, tokens: Tokens([ZeroOrMore, Literal('.'), Literal('d'), Literal('b'), RecursiveSuffix]) }
*** glob converted to regex: Glob { glob: "*.db-*", re: "(?-u)^.*\\.db\\-.*$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: true }, tokens: Tokens([ZeroOrMore, Literal('.'), Literal('d'), Literal('b'), Literal('-'), ZeroOrMore]) }
*** glob converted to regex: Glob { glob: "*/*.db-journal/**", re: "(?-u)^.*/.*\\.db\\-journal(?:/?|/.*)$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: true }, tokens: Tokens([ZeroOrMore, Literal('/'), ZeroOrMore, Literal('.'), Literal('d'), Literal('b'), Literal('-'), Literal('j'), Literal('o'), Literal('u'), Literal('r'), Literal('n'), Literal('a'), Literal('l'), RecursiveSuffix]) }
*** glob converted to regex: Glob { glob: "*/target/**", re: "(?-u)^.*/target(?:/?|/.*)$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: true }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('t'), Literal('a'), Literal('r'), Literal('g'), Literal('e'), Literal('t'), RecursiveSuffix]) }
*** built glob set; 0 literals, 0 basenames, 0 extensions, 0 prefixes, 0 suffixes, 0 required extensions, 13 regexes
*** Watching "/home/jman/Projects/rust/warp-websocket-test/src"
[Running 'cargo run']
*** Launching child process
*** Assembled command "sh" "-c" "cargo run; echo [Finished running. Exit status: $?]"
*** Waiting for filesystem activity
@passcod
Copy link
Member

passcod commented Jun 6, 2020

Okay, bug is actually that using -w without --no-gitignore busy-loops on a thread forever. Not sure why yet. Not using -w works.

@passcod passcod pinned this issue Jun 6, 2020
@passcod passcod changed the title [v.7.4.0] Ignore policy seems to block watching [v.7.4.0] -w usage loops forever Jun 6, 2020
@passcod
Copy link
Member

passcod commented Jun 6, 2020

Okay, so, running strace helps:

statx(AT_FDCWD, "/home/code/rust/watchexec/src/.git", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7ffd8e0ccdc0) = -1 ENOENT (No such file or directory)

times a billion

@passcod
Copy link
Member

passcod commented Jun 6, 2020

Fixed in watchexec, releases coming soon.

@apiraino
Copy link
Author

apiraino commented Jun 6, 2020

thank you!

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

No branches or pull requests

2 participants