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

v1.25.1 MacOS Issue: No such file or directory (os error 2) #765

Open
schultz-is opened this issue Jan 8, 2024 · 11 comments
Open

v1.25.1 MacOS Issue: No such file or directory (os error 2) #765

schultz-is opened this issue Jan 8, 2024 · 11 comments
Labels
bug Something's not right! has workaround Bug has a workaround, so it might not need urgent attention need repro Needs a reproduction and some investigation

Comments

@schultz-is
Copy link

I'm seeing issues running all invocations of watchexec in a certain directory with version 1.25.1, where the same invocations succeeded with version 1.25.0 and before. I'm also unable to reproduce these errors outside of the directory in question. Even simplifying the watch file list to a single extant file, replacing the command with something simple, and removing all other flags fails (e.g. watchexec -w Makefile -- echo hello).

Watchexec version: v1.25.1 via Homebrew
OS: MacOS Sonoma 14.2.1
Error: Error: × No such file or directory (os error 2)
Example Invocation: watchexec --no-vcs-ignore -w cmd -w pkg -w go.mod -w go.sum -w ../../lib -- make server
Resulting Log (with -vvv):

{"timestamp":"2024-01-08T17:48:18.043263Z","level":"INFO","fields":{"message":"logging initialised"},"target":"watchexec_cli"}
{"timestamp":"2024-01-08T17:48:18.044049Z","level":"DEBUG","fields":{"message":"arguments","args":"Args { command: [\"make\", \"server\"], paths: [\"cmd\", \"pkg\", \"go.mod\", \"go.sum\", \"../../lib\"], screen_clear: None, on_busy_update: Queue, watch_when_idle: false, restart: false, signal: None, kill: false, stop_signal: None, stop_timeout: TimeSpan(60s), signal_map: [], debounce: TimeSpan(50ms), stdin_quit: false, no_vcs_ignore: true, no_project_ignore: false, no_global_ignore: false, no_default_ignore: false, no_discover_ignore: false, ignore_nothing: false, postpone: false, delay_run: None, poll: None, shell: None, no_shell: false, no_shell_long: false, no_environment: false, emit_events_to: Environment, only_emit_events: false, env: [], no_process_group: false, once: false, notify: false, color: Auto, timings: false, quiet: false, bell: false, project_origin: None, workdir: None, filter_extensions: [], filter_patterns: [], filter_files: [], ignore_patterns: [], ignore_files: [], filter_fs_events: [Create, Remove, Rename, Modify, Metadata], filter_fs_meta: false, print_events: false, verbose: Some(3), log_file: Some(\"/Users/schultz/Desktop/log.out\"), manual: false, completions: None }"},"target":"watchexec_cli"}
{"timestamp":"2024-01-08T17:48:18.044624Z","level":"INFO","fields":{"message":"constructing Watchexec from CLI","version":"1.25.1"},"target":"watchexec_cli"}
{"timestamp":"2024-01-08T17:48:18.045406Z","level":"DEBUG","fields":{"message":"new"},"target":"watchexec_cli::config","span":{"name":"args-runtime"},"spans":[]}
{"timestamp":"2024-01-08T17:48:18.045416Z","level":"DEBUG","fields":{"message":"Config: on_error"},"target":"watchexec::config","span":{"name":"args-runtime"},"spans":[{"name":"args-runtime"}]}
{"timestamp":"2024-01-08T17:48:18.045460Z","level":"DEBUG","fields":{"message":"Config: pathset","pathset":"[WatchedPath(\"cmd\"), WatchedPath(\"pkg\"), WatchedPath(\"go.mod\"), WatchedPath(\"go.sum\"), WatchedPath(\"../../lib\")]"},"target":"watchexec::config","span":{"name":"args-runtime"},"spans":[{"name":"args-runtime"}]}
{"timestamp":"2024-01-08T17:48:18.045584Z","level":"DEBUG","fields":{"message":"Config: throttle","throttle":"50ms"},"target":"watchexec::config","span":{"name":"args-runtime"},"spans":[{"name":"args-runtime"}]}
{"timestamp":"2024-01-08T17:48:18.045708Z","level":"DEBUG","fields":{"message":"Config: keyboard","enable":"false"},"target":"watchexec::config","span":{"name":"args-runtime"},"spans":[{"name":"args-runtime"}]}
{"timestamp":"2024-01-08T17:48:18.045747Z","level":"DEBUG","fields":{"message":"additional environment variables to add to command","add_envs":"{}"},"target":"watchexec_cli::config","span":{"name":"args-runtime"},"spans":[{"name":"args-runtime"}]}
{"timestamp":"2024-01-08T17:48:18.045760Z","level":"DEBUG","fields":{"message":"new"},"target":"watchexec_cli::config","span":{"args":"Args { command: [\"make\", \"server\"], paths: [\"cmd\", \"pkg\", \"go.mod\", \"go.sum\", \"../../lib\"], screen_clear: None, on_busy_update: Queue, watch_when_idle: false, restart: false, signal: None, kill: false, stop_signal: None, stop_timeout: TimeSpan(60s), signal_map: [], debounce: TimeSpan(50ms), stdin_quit: false, no_vcs_ignore: true, no_project_ignore: false, no_global_ignore: false, no_default_ignore: false, no_discover_ignore: false, ignore_nothing: false, postpone: false, delay_run: None, poll: None, shell: None, no_shell: false, no_shell_long: false, no_environment: false, emit_events_to: Environment, only_emit_events: false, env: [], no_process_group: false, once: false, notify: false, color: Auto, timings: false, quiet: false, bell: false, project_origin: None, workdir: None, filter_extensions: [], filter_patterns: [], filter_files: [], ignore_patterns: [], ignore_files: [], filter_fs_events: [Create, Remove, Rename, Modify, Metadata], filter_fs_meta: false, print_events: false, verbose: Some(3), log_file: Some(\"/Users/schultz/Desktop/log.out\"), manual: false, completions: None }","name":"interpret_command_args"},"spans":[{"name":"args-runtime"}]}
{"timestamp":"2024-01-08T17:48:18.046034Z","level":"DEBUG","fields":{"message":"close","time.busy":"32.2µs","time.idle":"241µs"},"target":"watchexec_cli::config","span":{"args":"Args { command: [\"make\", \"server\"], paths: [\"cmd\", \"pkg\", \"go.mod\", \"go.sum\", \"../../lib\"], screen_clear: None, on_busy_update: Queue, watch_when_idle: false, restart: false, signal: None, kill: false, stop_signal: None, stop_timeout: TimeSpan(60s), signal_map: [], debounce: TimeSpan(50ms), stdin_quit: false, no_vcs_ignore: true, no_project_ignore: false, no_global_ignore: false, no_default_ignore: false, no_discover_ignore: false, ignore_nothing: false, postpone: false, delay_run: None, poll: None, shell: None, no_shell: false, no_shell_long: false, no_environment: false, emit_events_to: Environment, only_emit_events: false, env: [], no_process_group: false, once: false, notify: false, color: Auto, timings: false, quiet: false, bell: false, project_origin: None, workdir: None, filter_extensions: [], filter_patterns: [], filter_files: [], ignore_patterns: [], ignore_files: [], filter_fs_events: [Create, Remove, Rename, Modify, Metadata], filter_fs_meta: false, print_events: false, verbose: Some(3), log_file: Some(\"/Users/schultz/Desktop/log.out\"), manual: false, completions: None }","name":"interpret_command_args"},"spans":[{"name":"args-runtime"}]}
{"timestamp":"2024-01-08T17:48:18.046167Z","level":"DEBUG","fields":{"message":"Config: on_action_async"},"target":"watchexec::config","span":{"name":"args-runtime"},"spans":[{"name":"args-runtime"}]}
{"timestamp":"2024-01-08T17:48:18.046171Z","level":"DEBUG","fields":{"message":"close","time.busy":"756µs","time.idle":"8.54µs"},"target":"watchexec_cli::config","span":{"name":"args-runtime"},"spans":[]}
{"timestamp":"2024-01-08T17:48:18.046373Z","level":"DEBUG","fields":{"message":"current directory","curdir":"\"/Users/schultz/Repositories/[REDACTED]\""},"target":"watchexec_cli::filterer::common"}
{"timestamp":"2024-01-08T17:48:18.046410Z","level":"DEBUG","fields":{"message":"home directory","homedir":"Some(\"/Users/schultz\")"},"target":"watchexec_cli::filterer::common"}
{"timestamp":"2024-01-08T17:48:18.046701Z","level":"DEBUG","fields":{"message":"resolved whether the homedir is explicitly requested","homedir_requested":"false"},"target":"watchexec_cli::filterer::common"}
{"timestamp":"2024-01-08T17:48:18.046706Z","level":"DEBUG","fields":{"message":"resolved all watched paths","paths":"{\"/Users/schultz/Repositories/pokerbob/lib\", \"/Users/schultz/Repositories/[REDACTED]/go.mod\", \"/Users/schultz/Repositories/[REDACTED]/go.sum\", \"/Users/schultz/Repositories/[REDACTED]/cmd\", \"/Users/schultz/Repositories/[REDACTED]/pkg\"}"},"target":"watchexec_cli::filterer::common"}
{"timestamp":"2024-01-08T17:48:18.049013Z","level":"DEBUG","fields":{"message":"resolved all project origins","origins":"{\"/Users/schultz/Repositories/[REDACTED]\", \"/Users/schultz/Repositories/pokerbob\"}"},"target":"watchexec_cli::filterer::common"}
{"timestamp":"2024-01-08T17:48:18.049038Z","level":"INFO","fields":{"message":"resolved common/project origin","project_origin":"\"/Users/schultz/Repositories/pokerbob\""},"target":"watchexec_cli::filterer::common"}
{"timestamp":"2024-01-08T17:48:18.049045Z","level":"INFO","fields":{"message":"resolved working directory","workdir":"\"/Users/schultz/Repositories/[REDACTED]\""},"target":"watchexec_cli::filterer::common"}
{"timestamp":"2024-01-08T17:48:18.049085Z","level":"INFO","fields":{"message":"resolved vcs types","vcs_types":"[Git]"},"target":"watchexec_cli::filterer::common"}
@schultz-is schultz-is added the bug Something's not right! label Jan 8, 2024
@hlship
Copy link

hlship commented Jan 8, 2024

I'm hitting this as well (OS X), previously worked fine.

@passcod
Copy link
Member

passcod commented Jan 8, 2024

@schultz-is could you run with -vvvv to see if there's more of a hint as to what's up?

@hlship can you describe your situation? as it seems quite specific to a single file here, I'm curious as to the commonality

@schultz-is
Copy link
Author

@schultz-is could you run with -vvvv to see if there's more of a hint as to what's up?

Sure thing, here you go!

  2024-01-08T21:05:31.862032Z  INFO watchexec_cli: logging initialised
    at crates/cli/src/lib.rs:91

  2024-01-08T21:05:31.862772Z DEBUG watchexec_cli: arguments, args: Args { command: ["make", "server"], paths: ["cmd", "pkg", "go.mod", "go.sum", "../../lib"], screen_clear: None, on_busy_update: Queue, watch_when_idle: false, restart: false, signal: None, kill: false, stop_signal: None, stop_timeout: TimeSpan(60s), signal_map: [], debounce: TimeSpan(50ms), stdin_quit: false, no_vcs_ignore: true, no_project_ignore: false, no_global_ignore: false, no_default_ignore: false, no_discover_ignore: false, ignore_nothing: false, postpone: false, delay_run: None, poll: None, shell: None, no_shell: false, no_shell_long: false, no_environment: false, emit_events_to: Environment, only_emit_events: false, env: [], no_process_group: false, once: false, notify: false, color: Auto, timings: false, quiet: false, bell: false, project_origin: None, workdir: None, filter_extensions: [], filter_patterns: [], filter_files: [], ignore_patterns: [], ignore_files: [], filter_fs_events: [Create, Remove, Rename, Modify, Metadata], filter_fs_meta: false, print_events: false, verbose: Some(5), log_file: None, manual: false, completions: None }
    at crates/cli/src/lib.rs:188

  2024-01-08T21:05:31.863531Z  INFO watchexec_cli: constructing Watchexec from CLI, version: 1.25.1
    at crates/cli/src/lib.rs:100

  2024-01-08T21:05:31.864449Z DEBUG watchexec_cli::config: new
    at crates/cli/src/config.rs:50
    in watchexec_cli::config::args-runtime

  2024-01-08T21:05:31.864463Z DEBUG watchexec::config: Config: on_error
    at crates/lib/src/config.rs:237
    in watchexec_cli::config::args-runtime

  2024-01-08T21:05:31.864590Z DEBUG watchexec::config: Config: pathset, pathset: [WatchedPath("cmd"), WatchedPath("pkg"), WatchedPath("go.mod"), WatchedPath("go.sum"), WatchedPath("../../lib")]
    at crates/lib/src/config.rs:201
    in watchexec_cli::config::args-runtime

  2024-01-08T21:05:31.864713Z DEBUG watchexec::config: Config: throttle, throttle: 50ms
    at crates/lib/src/config.rs:223
    in watchexec_cli::config::args-runtime

  2024-01-08T21:05:31.864850Z DEBUG watchexec::config: Config: keyboard, enable: false
    at crates/lib/src/config.rs:215
    in watchexec_cli::config::args-runtime

  2024-01-08T21:05:31.864909Z DEBUG watchexec_cli::config: additional environment variables to add to command, add_envs: {}
    at crates/cli/src/config.rs:186
    in watchexec_cli::config::args-runtime

  2024-01-08T21:05:31.864921Z DEBUG watchexec_cli::config: new
    at crates/cli/src/config.rs:467
    in watchexec_cli::config::interpret_command_args with args: Args { command: ["make", "server"], paths: ["cmd", "pkg", "go.mod", "go.sum", "../../lib"], screen_clear: None, on_busy_update: Queue, watch_when_idle: false, restart: false, signal: None, kill: false, stop_signal: None, stop_timeout: TimeSpan(60s), signal_map: [], debounce: TimeSpan(50ms), stdin_quit: false, no_vcs_ignore: true, no_project_ignore: false, no_global_ignore: false, no_default_ignore: false, no_discover_ignore: false, ignore_nothing: false, postpone: false, delay_run: None, poll: None, shell: None, no_shell: false, no_shell_long: false, no_environment: false, emit_events_to: Environment, only_emit_events: false, env: [], no_process_group: false, once: false, notify: false, color: Auto, timings: false, quiet: false, bell: false, project_origin: None, workdir: None, filter_extensions: [], filter_patterns: [], filter_files: [], ignore_patterns: [], ignore_files: [], filter_fs_events: [Create, Remove, Rename, Modify, Metadata], filter_fs_meta: false, print_events: false, verbose: Some(5), log_file: None, manual: false, completions: None }
    in watchexec_cli::config::args-runtime

  2024-01-08T21:05:31.865093Z DEBUG watchexec_cli::config: close, time.busy: 69.7µs, time.idle: 101µs
    at crates/cli/src/config.rs:467
    in watchexec_cli::config::interpret_command_args with args: Args { command: ["make", "server"], paths: ["cmd", "pkg", "go.mod", "go.sum", "../../lib"], screen_clear: None, on_busy_update: Queue, watch_when_idle: false, restart: false, signal: None, kill: false, stop_signal: None, stop_timeout: TimeSpan(60s), signal_map: [], debounce: TimeSpan(50ms), stdin_quit: false, no_vcs_ignore: true, no_project_ignore: false, no_global_ignore: false, no_default_ignore: false, no_discover_ignore: false, ignore_nothing: false, postpone: false, delay_run: None, poll: None, shell: None, no_shell: false, no_shell_long: false, no_environment: false, emit_events_to: Environment, only_emit_events: false, env: [], no_process_group: false, once: false, notify: false, color: Auto, timings: false, quiet: false, bell: false, project_origin: None, workdir: None, filter_extensions: [], filter_patterns: [], filter_files: [], ignore_patterns: [], ignore_files: [], filter_fs_events: [Create, Remove, Rename, Modify, Metadata], filter_fs_meta: false, print_events: false, verbose: Some(5), log_file: None, manual: false, completions: None }
    in watchexec_cli::config::args-runtime

  2024-01-08T21:05:31.865326Z DEBUG watchexec::config: Config: on_action_async
    at crates/lib/src/config.rs:261
    in watchexec_cli::config::args-runtime

  2024-01-08T21:05:31.865334Z DEBUG watchexec_cli::config: close, time.busy: 872µs, time.idle: 13.6µs
    at crates/cli/src/config.rs:50
    in watchexec_cli::config::args-runtime

  2024-01-08T21:05:31.865831Z DEBUG watchexec_cli::filterer::common: current directory, curdir: "/Users/schultz/Repositories/[REDACTED]"
    at crates/cli/src/filterer/common.rs:25

  2024-01-08T21:05:31.865862Z DEBUG watchexec_cli::filterer::common: home directory, homedir: Some("/Users/schultz")
    at crates/cli/src/filterer/common.rs:35

  2024-01-08T21:05:31.866114Z DEBUG watchexec_cli::filterer::common: resolved whether the homedir is explicitly requested, homedir_requested: false
    at crates/cli/src/filterer/common.rs:43

  2024-01-08T21:05:31.866121Z DEBUG watchexec_cli::filterer::common: resolved all watched paths, paths: {"/Users/schultz/Repositories/[REDACTED]/pkg", "/Users/schultz/Repositories/pokerbob/lib", "/Users/schultz/Repositories/[REDACTED]/go.sum", "/Users/schultz/Repositories/[REDACTED]/go.mod", "/Users/schultz/Repositories/[REDACTED]/cmd"}
    at crates/cli/src/filterer/common.rs:53

  2024-01-08T21:05:31.870316Z DEBUG watchexec_cli::filterer::common: resolved all project origins, origins: {"/Users/schultz/Repositories/[REDACTED]", "/Users/schultz/Repositories/pokerbob"}
    at crates/cli/src/filterer/common.rs:73

  2024-01-08T21:05:31.870356Z  INFO watchexec_cli::filterer::common: resolved common/project origin, project_origin: "/Users/schultz/Repositories/pokerbob"
    at crates/cli/src/filterer/common.rs:83

  2024-01-08T21:05:31.870364Z  INFO watchexec_cli::filterer::common: resolved working directory, workdir: "/Users/schultz/Repositories/[REDACTED]"
    at crates/cli/src/filterer/common.rs:86

  2024-01-08T21:05:31.870426Z  INFO watchexec_cli::filterer::common: resolved vcs types, vcs_types: [Git]
    at crates/cli/src/filterer/common.rs:97

Error:   × No such file or directory (os error 2)

@hlship
Copy link

hlship commented Jan 8, 2024

Here's mine:

> script/local-build.sh
+ watchexec -vvvv --watch ../pedestal/docs --watch ui-overrides --watch local-antora-playbook.yml --watch lib --debounce=500ms echo npx antora --stacktrace local-antora-playbook.yml
  2024-01-08T21:55:15.372702Z  INFO watchexec_cli: logging initialised
    at crates/cli/src/lib.rs:91

  2024-01-08T21:55:15.372845Z DEBUG watchexec_cli: arguments, args: Args { command: ["echo", "npx", "antora", "--stacktrace", "local-antora-playbook.yml"], paths: ["../pedestal/docs", "ui-overrides", "local-antora-playbook.yml", "lib"], screen_clear: None, on_busy_update: Queue, watch_when_idle: false, restart: false, signal: None, kill: false, stop_signal: None, stop_timeout: TimeSpan(60s), signal_map: [], debounce: TimeSpan(500ms), stdin_quit: false, no_vcs_ignore: false, no_project_ignore: false, no_global_ignore: false, no_default_ignore: false, no_discover_ignore: false, ignore_nothing: false, postpone: false, delay_run: None, poll: None, shell: None, no_shell: false, no_shell_long: false, no_environment: false, emit_events_to: Environment, only_emit_events: false, env: [], no_process_group: false, once: false, notify: false, color: Auto, timings: false, quiet: false, bell: false, project_origin: None, workdir: None, filter_extensions: [], filter_patterns: [], filter_files: [], ignore_patterns: [], ignore_files: [], filter_fs_events: [Create, Remove, Rename, Modify, Metadata], filter_fs_meta: false, print_events: false, verbose: Some(4), log_file: None, manual: false, completions: None }
    at crates/cli/src/lib.rs:188

  2024-01-08T21:55:15.373002Z  INFO watchexec_cli: constructing Watchexec from CLI, version: 1.25.1
    at crates/cli/src/lib.rs:100

  2024-01-08T21:55:15.373711Z DEBUG watchexec_cli::config: new
    at crates/cli/src/config.rs:50
    in watchexec_cli::config::args-runtime

  2024-01-08T21:55:15.373724Z DEBUG watchexec::config: Config: on_error
    at crates/lib/src/config.rs:237
    in watchexec_cli::config::args-runtime

  2024-01-08T21:55:15.373748Z DEBUG watchexec::config: Config: pathset, pathset: [WatchedPath("../pedestal/docs"), WatchedPath("ui-overrides"), WatchedPath("local-antora-playbook.yml"), WatchedPath("lib")]
    at crates/lib/src/config.rs:201
    in watchexec_cli::config::args-runtime

  2024-01-08T21:55:15.373772Z DEBUG watchexec::config: Config: throttle, throttle: 500ms
    at crates/lib/src/config.rs:223
    in watchexec_cli::config::args-runtime

  2024-01-08T21:55:15.373794Z DEBUG watchexec::config: Config: keyboard, enable: false
    at crates/lib/src/config.rs:215
    in watchexec_cli::config::args-runtime

  2024-01-08T21:55:15.378845Z DEBUG watchexec_cli::config: additional environment variables to add to command, add_envs: {}
    at crates/cli/src/config.rs:186
    in watchexec_cli::config::args-runtime

  2024-01-08T21:55:15.378894Z DEBUG watchexec_cli::config: new
    at crates/cli/src/config.rs:467
    in watchexec_cli::config::interpret_command_args with args: Args { command: ["echo", "npx", "antora", "--stacktrace", "local-antora-playbook.yml"], paths: ["../pedestal/docs", "ui-overrides", "local-antora-playbook.yml", "lib"], screen_clear: None, on_busy_update: Queue, watch_when_idle: false, restart: false, signal: None, kill: false, stop_signal: None, stop_timeout: TimeSpan(60s), signal_map: [], debounce: TimeSpan(500ms), stdin_quit: false, no_vcs_ignore: false, no_project_ignore: false, no_global_ignore: false, no_default_ignore: false, no_discover_ignore: false, ignore_nothing: false, postpone: false, delay_run: None, poll: None, shell: None, no_shell: false, no_shell_long: false, no_environment: false, emit_events_to: Environment, only_emit_events: false, env: [], no_process_group: false, once: false, notify: false, color: Auto, timings: false, quiet: false, bell: false, project_origin: None, workdir: None, filter_extensions: [], filter_patterns: [], filter_files: [], ignore_patterns: [], ignore_files: [], filter_fs_events: [Create, Remove, Rename, Modify, Metadata], filter_fs_meta: false, print_events: false, verbose: Some(4), log_file: None, manual: false, completions: None }
    in watchexec_cli::config::args-runtime

  2024-01-08T21:55:15.378954Z DEBUG watchexec_cli::config: close, time.busy: 21.0µs, time.idle: 38.9µs
    at crates/cli/src/config.rs:467
    in watchexec_cli::config::interpret_command_args with args: Args { command: ["echo", "npx", "antora", "--stacktrace", "local-antora-playbook.yml"], paths: ["../pedestal/docs", "ui-overrides", "local-antora-playbook.yml", "lib"], screen_clear: None, on_busy_update: Queue, watch_when_idle: false, restart: false, signal: None, kill: false, stop_signal: None, stop_timeout: TimeSpan(60s), signal_map: [], debounce: TimeSpan(500ms), stdin_quit: false, no_vcs_ignore: false, no_project_ignore: false, no_global_ignore: false, no_default_ignore: false, no_discover_ignore: false, ignore_nothing: false, postpone: false, delay_run: None, poll: None, shell: None, no_shell: false, no_shell_long: false, no_environment: false, emit_events_to: Environment, only_emit_events: false, env: [], no_process_group: false, once: false, notify: false, color: Auto, timings: false, quiet: false, bell: false, project_origin: None, workdir: None, filter_extensions: [], filter_patterns: [], filter_files: [], ignore_patterns: [], ignore_files: [], filter_fs_events: [Create, Remove, Rename, Modify, Metadata], filter_fs_meta: false, print_events: false, verbose: Some(4), log_file: None, manual: false, completions: None }
    in watchexec_cli::config::args-runtime

  2024-01-08T21:55:15.379070Z DEBUG watchexec::config: Config: on_action_async
    at crates/lib/src/config.rs:261
    in watchexec_cli::config::args-runtime

  2024-01-08T21:55:15.379082Z DEBUG watchexec_cli::config: close, time.busy: 5.36ms, time.idle: 12.8µs
    at crates/cli/src/config.rs:50
    in watchexec_cli::config::args-runtime

  2024-01-08T21:55:15.379302Z DEBUG watchexec_cli::filterer::common: current directory, curdir: "/Users/howard.lewisship/workspaces/github/pedestal-docs"
    at crates/cli/src/filterer/common.rs:25

  2024-01-08T21:55:15.379338Z DEBUG watchexec_cli::filterer::common: home directory, homedir: Some("/Users/howard.lewisship")
    at crates/cli/src/filterer/common.rs:35

  2024-01-08T21:55:15.379547Z DEBUG watchexec_cli::filterer::common: resolved whether the homedir is explicitly requested, homedir_requested: false
    at crates/cli/src/filterer/common.rs:43

  2024-01-08T21:55:15.379560Z DEBUG watchexec_cli::filterer::common: resolved all watched paths, paths: {"/Users/howard.lewisship/workspaces/github/pedestal-docs/ui-overrides", "/Users/howard.lewisship/workspaces/github/pedestal/docs", "/Users/howard.lewisship/workspaces/github/pedestal-docs/lib", "/Users/howard.lewisship/workspaces/github/pedestal-docs/local-antora-playbook.yml"}
    at crates/cli/src/filterer/common.rs:53

  2024-01-08T21:55:15.381701Z DEBUG watchexec_cli::filterer::common: resolved all project origins, origins: {"/Users/howard.lewisship/workspaces/github/pedestal-docs", "/Users/howard.lewisship/workspaces/github/pedestal"}
    at crates/cli/src/filterer/common.rs:73

  2024-01-08T21:55:15.381740Z  INFO watchexec_cli::filterer::common: resolved common/project origin, project_origin: "/Users/howard.lewisship/workspaces/github"
    at crates/cli/src/filterer/common.rs:83

  2024-01-08T21:55:15.381748Z  INFO watchexec_cli::filterer::common: resolved working directory, workdir: "/Users/howard.lewisship/workspaces/github/pedestal-docs"
    at crates/cli/src/filterer/common.rs:86

  2024-01-08T21:55:15.381863Z  INFO watchexec_cli::filterer::common: resolved vcs types, vcs_types: []
    at crates/cli/src/filterer/common.rs:97

Error:   × No such file or directory (os error 2)

@hlship
Copy link

hlship commented Jan 8, 2024

My workaround: added --project-origin .

@hlship
Copy link

hlship commented Jan 8, 2024

In my case, I'm running inside one git workspace, but some of my watched directories are in a neighboring git workspace.

@passcod
Copy link
Member

passcod commented Jan 8, 2024

Hmm. I'll see if I can replicate that on my old macbook air as I don't really see what's happening still and need to debug in place.

@schultz-is does @hlship's workaround work for you?

@passcod passcod added the need repro Needs a reproduction and some investigation label Jan 8, 2024
@passcod passcod pinned this issue Jan 8, 2024
@schultz-is
Copy link
Author

@schultz-is does @hlship's workaround work for you?

Yep, it does! Thanks for that @hlship. Please let me know if I can help more in any way with debugging or repoducing, @passcod.

@passcod passcod added the has workaround Bug has a workaround, so it might not need urgent attention label Jan 8, 2024
@flip111
Copy link

flip111 commented Jan 9, 2024

I'm on ubuntu 23.10 watchexec version 1.25.1 i have a monorepo with server and client directories. I start watchexec in the client directory. The main directory ., client directory ./client and server directory ./server all have .gitignore files.

» watchexec --project-origin . -w src -e purs,js,yaml -- spago build

Runs successfully

watchexec --project-origin .. -w src -e purs,js,yaml -- spago build
Error:   × No such file or directory (os error 2)

Errors.

On another computer the same directory structure and files don't give this error (ubuntu 22.04, watchexec 1.24.2)


By the way it would be helpful if the error Error: × No such file or directory (os error 2) could be extended by saying it's about the -w flag with the src directory. Initially i thought it was a problem with the command being ran spago build and after that i thought it was about the source file specification in -e

@passcod
Copy link
Member

passcod commented Jan 9, 2024

saying it's about the -w flag with the src directory

We don't have that kind of precise fault attribution knowledge (code-wise) but I do agree it should show which path there is no such file at.

In any case your issue, and hopefully the others', seems to be a combination of the explicit watches being resolved from the project origin rather than the current directory, which I believe isn't the intent.

@mloughran
Copy link

I thought I'd add some context in terms of how this issue is affecting us, in case it's helpful:

We use watchexec (which we love btw!) within a monorepo, where watchexec is usually invoked within a subdirectory rather than at the root of the repo. We commonly watch . (the service directory) and perhaps some other relative paths. The workaround is either to specify --project-origin=. in such invocations (even though this isn't actually the repo root), or --project-origin=../../.. and then having rather long and messy --watch paths. For now we've decided just to install an old watchexec binary rather than making the above changes and watch this issue :).

In any case your issue, and hopefully the others', seems to be a combination of the explicit watches being resolved from the project origin rather than the current directory, which I believe isn't the intent.

Absolutely correct. It would be good to confirm that this is definitely not the intent!

The manpage currently says the following, which suggests that paths are relative to the current path (since that's the default), but this could certainly be made more explicit.

By default, Watchexec watches the current directory.

...

Upon starting, Watchexec resolves a "project origin" from the watched paths. See the help for '--project-origin' for more information.

DavideSilva added a commit to subvisual/citizend that referenced this issue Mar 28, 2024
Why:
* This was not working correctly, possibly due to this
  [bug](watchexec/watchexec#765)

How:
* Adding an extra flag to `watchexec` so it correctly starts the process
luistorres pushed a commit to subvisual/citizend that referenced this issue Mar 28, 2024
Why:
* This was not working correctly, possibly due to this
  [bug](watchexec/watchexec#765)

How:
* Adding an extra flag to `watchexec` so it correctly starts the process
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something's not right! has workaround Bug has a workaround, so it might not need urgent attention need repro Needs a reproduction and some investigation
Projects
None yet
Development

No branches or pull requests

5 participants