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

--ignore dir doesn't work well for changes made by command #284

Closed
c02y opened this issue May 26, 2022 · 4 comments
Closed

--ignore dir doesn't work well for changes made by command #284

c02y opened this issue May 26, 2022 · 4 comments
Labels
bug Something's not right!

Comments

@c02y
Copy link

c02y commented May 26, 2022

Please delete this template text before filing, but you need to include the following:

  • Watchexec's version: 1.19.0 installed from Arch Linux repo
  • The OS you're using: Arch Linux
  • A log with -vvv (if it has sensitive info you can email it at felix@passcod.name — do that after filing so you can reference the issue ID)
    This output becomes thousands of lines in a second, and the command runs repeatedly, the output is full of color code if I output the result into a file, so it is unreadable, unable to paste here.
  • A sample command that you've run that has the issue

Create a simple project structure like this

- CMakeLists.txt
- test.cpp

Contents like this:

$ cat CMakeLists.txt
cmake_minimum_required(VERSION 3.18)
project(test)

add_executable(test test.cpp)

$ cat test.cpp
#include <iostream>

int main(int argc, char *argv[])
{
        std::cout << "hello word" << std::endl;
        return 0;
}

Run command like this:

watchexec -i build "cmake -B build"

it will keep running repeatedly forever, since files in build are changed every time you run the command.

But (suggested by #254 (comment))

watchexec -i "build/**" "cmake -B build"

works very well.

Thank you

FYI: I think this is related to #40 and #123, and --watch-when-idle doesn't work at all (if this is the flag for this purpose)

@c02y c02y added the bug Something's not right! label May 26, 2022
@passcod
Copy link
Member

passcod commented May 26, 2022

I can strip the color codes myself if you send me a file, it's fine. It's likely the same issue as #254, and having another log will help find a good solution.

@c02y
Copy link
Author

c02y commented May 26, 2022

Output of:

watchexec -i build -vvv "cmake -B build"

log.txt

I only run it and Ctrl-c in less than a second, since it contains over 10k of lines after a second, if this log is not enough, please let me know.

And you can follow the easy steps I provided to reproduce this log.

@passcod
Copy link
Member

passcod commented May 26, 2022

Thanks, I'll have a look tonight!

@passcod
Copy link
Member

passcod commented May 30, 2022

Alright, this is indeed a duplicate of #254, and will likely be solved with the work for #250.

At its core, this is an issue with how the underlying globset library processes and interprets these patterns (it resolves it to **/build); the work for #250 is essentially a rewrite of the lower levels of ignore handling, due to other similar subtle issues with the globset and ignore crates.

Obviously that's a decent chunk of work; in the meantime using **/build/** or build/** can be used as workaround.

@passcod passcod closed this as completed May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something's not right!
Projects
None yet
Development

No branches or pull requests

2 participants