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

bacon crashes on rustc #10

Closed
jyn514 opened this issue Nov 4, 2020 · 15 comments
Closed

bacon crashes on rustc #10

jyn514 opened this issue Nov 4, 2020 · 15 comments
Assignees
Labels
bug Something isn't working

Comments

@jyn514
Copy link
Contributor

jyn514 commented Nov 4, 2020

It runs cargo check, finishes seeing all the 'duplicate lang error's, then immediately exits with

Error: No space left on device (os error 28)

df -h reports 300 GB free, so I don't expect that to be the issue.

@jyn514
Copy link
Contributor Author

jyn514 commented Nov 4, 2020

Here's an strace in case it helps: bacon.log

@Canop Canop added the bug Something isn't working label Nov 4, 2020
@jyn514
Copy link
Contributor Author

jyn514 commented Nov 4, 2020

Here's BACON_LOG=trace:

09:05:10 [ INFO] Starting Bacon v0.2.3 with log level TRACE
09:05:10 [DEBUG] (1) bacon::cli: args: Args { version: false, summary: false, clippy: false, root: None }
09:05:10 [DEBUG] (1) bacon::app: root_dir: "/home/joshua/rustc"
09:05:10 [TRACE] (2) mio::poll: [/home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.7.5/src/poll.rs:474] registering event source with poller: token=Token(0), interests=READABLE
09:05:10 [TRACE] (2) mio::poll: [/home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.7.5/src/poll.rs:474] registering event source with poller: token=Token(1), interests=READABLE
09:05:10 [DEBUG] (1) bacon::report: starting cargo check
09:05:10 [DEBUG] (1) bacon::report: cargo check finished
09:05:10 [DEBUG] (1) bacon::report: status: ExitStatus(ExitStatus(25856))
09:05:10 [DEBUG] (1) bacon::report: report: 0 warnings and 1331 errors
09:05:10 [TRACE] (1) mio::poll: [/home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.6.22/src/poll.rs:787] registering with poller
09:05:10 [TRACE] (1) mio::poll: [/home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.6.22/src/poll.rs:787] registering with poller
09:05:10 [TRACE] (1) mio::poll: [/home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.6.22/src/poll.rs:787] registering with poller

@jyn514
Copy link
Contributor Author

jyn514 commented Nov 4, 2020

09:05:10 [DEBUG] (1) bacon::report: report: 0 warnings and 1331 errors

Maybe it's trying to write too much to the buffer?

@Canop
Copy link
Owner

Canop commented Nov 4, 2020

Bacon wasn't designed with such big project in mind. But I still don't see how the report can't fit a few times in memory.

I'll have a look when I find some time (not in the next few days).

@jyn514
Copy link
Contributor Author

jyn514 commented Nov 4, 2020

It's crashing somewhere here by the log:

bacon/src/app.rs

Lines 47 to 62 in 0791359

state.draw(w)?;
let (watch_sender, watch_receiver) = bounded(0);
let mut watcher: RecommendedWatcher = Watcher::new_immediate(move |res| match res {
Ok(_) => {
debug!("notify event received");
if let Err(e) = watch_sender.send(()) {
debug!("error when notifying on inotify event: {}", e);
}
}
Err(e) => warn!("watch error: {:?}", e),
})?;
watcher.watch(src_dir, RecursiveMode::Recursive)?;
watcher.watch(cargo_toml_file, RecursiveMode::NonRecursive)?;
let computer = Computer::new(root_dir, args.clippy)?;
. Maybe it's trying to watch too many files at once?

@Canop
Copy link
Owner

Canop commented Nov 4, 2020

Maybe. It's the first time I use the notify crate and to be honest I don't know it well and didn't look at the source much.

@jyn514
Copy link
Contributor Author

jyn514 commented Nov 4, 2020

Yup, that's definitely it - it makes it to watch(src_dir) and no further. I think the fix is to print a warning and continue if you fail to watch the directory.

@jyn514
Copy link
Contributor Author

jyn514 commented Nov 4, 2020

Another option is to make it possible to opt-out of watching src/.

@Canop
Copy link
Owner

Canop commented Nov 4, 2020

You mean by specifying the precise directory to watch as argument (or use the current one) ?
This could be possible. Bacon would then look for the cargo.toml file up in the tree.

@Canop
Copy link
Owner

Canop commented Nov 8, 2020

@jyn514 The behavior changed with last commit (not yet released on crates.io):

  • if the current or passed directory is the package directory, then all sources are watched
  • if it's a sub-directory, then only this directory is watched

This is hopefully clear in the bacon.log file.

Can you tell me if it helps with the notify explosion problem and is still practicable ?

@jyn514
Copy link
Contributor Author

jyn514 commented Nov 8, 2020

@Canop now it gives a different error:

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

Here's bacon.log:

20:51:27 [ INFO] Starting Bacon v0.4.0-dev with log level DEBUG
20:51:27 [DEBUG] (1) bacon::cli: args: Args {
    version: false,
    summary: false,
    clippy: false,
    root: None,
}
20:51:28 [DEBUG] (1) bacon::cli: mission: Mission {
    name: "rustc",
    cargo_execution_directory: "/home/joshua/rustc",
    cargo_command_exe: "cargo",
    cargo_command_args: [
        "check",
        "--color",
        "always",
    ],
    files_to_watch: [
        "/home/joshua/rustc/library/alloc/Cargo.toml",
        "/home/joshua/rustc/library/backtrace/Cargo.toml",
        "/home/joshua/rustc/src/bootstrap/Cargo.toml",
        "/home/joshua/rustc/src/tools/build-manifest/Cargo.toml",
        "/home/joshua/rustc/src/build_helper/Cargo.toml",
        "/home/joshua/rustc/src/tools/cargo/Cargo.toml",
        "/home/joshua/rustc/src/tools/miri/cargo-miri/Cargo.toml",
        "/home/joshua/rustc/src/tools/cargo/crates/cargo-platform/Cargo.toml",
        "/home/joshua/rustc/src/tools/cargo/crates/cargo-test-macro/Cargo.toml",
        "/home/joshua/rustc/src/tools/cargo/crates/cargo-test-support/Cargo.toml",
        "/home/joshua/rustc/src/tools/cargotest/Cargo.toml",
        "/home/joshua/rustc/src/tools/clippy/Cargo.toml",
        "/home/joshua/rustc/src/tools/clippy/mini-macro/Cargo.toml",
        "/home/joshua/rustc/src/tools/clippy/clippy_lints/Cargo.toml",
        "/home/joshua/rustc/src/tools/compiletest/Cargo.toml",
        "/home/joshua/rustc/library/core/Cargo.toml",
        "/home/joshua/rustc/src/tools/cargo/crates/crates-io/Cargo.toml",
        "/home/joshua/rustc/src/tools/error_index_generator/Cargo.toml",
        "/home/joshua/rustc/src/tools/expand-yaml-anchors/Cargo.toml",
        "/home/joshua/rustc/src/tools/rust-installer/Cargo.toml",
        "/home/joshua/rustc/src/tools/linkchecker/Cargo.toml",
        "/home/joshua/rustc/src/tools/lint-docs/Cargo.toml",
        "/home/joshua/rustc/src/tools/miri/Cargo.toml",
        "/home/joshua/rustc/library/panic_abort/Cargo.toml",
        "/home/joshua/rustc/library/panic_unwind/Cargo.toml",
        "/home/joshua/rustc/library/proc_macro/Cargo.toml",
        "/home/joshua/rustc/library/profiler_builtins/Cargo.toml",
        "/home/joshua/rustc/src/tools/remote-test-client/Cargo.toml",
        "/home/joshua/rustc/src/tools/remote-test-server/Cargo.toml",
        "/home/joshua/rustc/src/tools/rls/Cargo.toml",
        "/home/joshua/rustc/src/tools/rls/rls-ipc/Cargo.toml",
        "/home/joshua/rustc/src/tools/rls/rls-rustc/Cargo.toml",
        "/home/joshua/rustc/src/tools/rust-demangler/Cargo.toml",
        "/home/joshua/rustc/src/tools/rustbook/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc/Cargo.toml",
        "/home/joshua/rustc/library/rustc-std-workspace-alloc/Cargo.toml",
        "/home/joshua/rustc/library/rustc-std-workspace-core/Cargo.toml",
        "/home/joshua/rustc/library/rustc-std-workspace-std/Cargo.toml",
        "/home/joshua/rustc/src/tools/rustc-workspace-hack/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_apfloat/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_arena/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_ast/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_ast_lowering/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_ast_passes/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_ast_pretty/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_attr/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_builtin_macros/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_codegen_llvm/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_codegen_ssa/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_data_structures/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_driver/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_error_codes/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_errors/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_expand/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_feature/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_fs_util/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_graphviz/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_hir/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_hir_pretty/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_incremental/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_index/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_infer/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_interface/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_lexer/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_lint/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_lint_defs/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_llvm/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_macros/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_metadata/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_middle/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_mir/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_mir_build/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_parse/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_parse_format/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_passes/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_plugin_impl/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_privacy/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_query_system/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_resolve/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_save_analysis/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_serialize/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_session/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_span/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_symbol_mangling/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_target/Cargo.toml",
        "/home/joshua/rustc/src/tools/clippy/rustc_tools_util/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_trait_selection/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_traits/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_ty/Cargo.toml",
        "/home/joshua/rustc/compiler/rustc_typeck/Cargo.toml",
        "/home/joshua/rustc/src/librustdoc/Cargo.toml",
        "/home/joshua/rustc/src/tools/rustdoc-themes/Cargo.toml",
        "/home/joshua/rustc/src/tools/rustdoc/Cargo.toml",
        "/home/joshua/rustc/src/tools/rustfmt/config_proc_macro/Cargo.toml",
        "/home/joshua/rustc/src/tools/rustfmt/Cargo.toml",
        "/home/joshua/rustc/library/std/Cargo.toml",
        "/home/joshua/rustc/library/term/Cargo.toml",
        "/home/joshua/rustc/library/test/Cargo.toml",
        "/home/joshua/rustc/src/tools/tidy/Cargo.toml",
        "/home/joshua/rustc/src/tools/tier-check/Cargo.toml",
        "/home/joshua/rustc/src/tools/unicode-table-generator/Cargo.toml",
        "/home/joshua/rustc/src/tools/unstable-book-gen/Cargo.toml",
        "/home/joshua/rustc/library/unwind/Cargo.toml",
    ],
    directories_to_watch: [
        "/home/joshua/rustc/library/alloc/src",
        "/home/joshua/rustc/library/backtrace/src",
        "/home/joshua/rustc/src/bootstrap/src",
        "/home/joshua/rustc/src/tools/build-manifest/src",
        "/home/joshua/rustc/src/build_helper/src",
        "/home/joshua/rustc/src/tools/cargo/src",
        "/home/joshua/rustc/src/tools/miri/cargo-miri/src",
        "/home/joshua/rustc/src/tools/cargo/crates/cargo-platform/src",
        "/home/joshua/rustc/src/tools/cargo/crates/cargo-test-macro/src",
        "/home/joshua/rustc/src/tools/cargo/crates/cargo-test-support/src",
        "/home/joshua/rustc/src/tools/cargotest/src",
        "/home/joshua/rustc/src/tools/clippy/src",
        "/home/joshua/rustc/src/tools/clippy/mini-macro/src",
        "/home/joshua/rustc/src/tools/clippy/clippy_lints/src",
        "/home/joshua/rustc/src/tools/compiletest/src",
        "/home/joshua/rustc/library/core/src",
        "/home/joshua/rustc/src/tools/cargo/crates/crates-io/src",
        "/home/joshua/rustc/src/tools/error_index_generator/src",
        "/home/joshua/rustc/src/tools/expand-yaml-anchors/src",
        "/home/joshua/rustc/src/tools/rust-installer/src",
        "/home/joshua/rustc/src/tools/linkchecker/src",
        "/home/joshua/rustc/src/tools/lint-docs/src",
        "/home/joshua/rustc/src/tools/miri/src",
        "/home/joshua/rustc/library/panic_abort/src",
        "/home/joshua/rustc/library/panic_unwind/src",
        "/home/joshua/rustc/library/proc_macro/src",
        "/home/joshua/rustc/library/profiler_builtins/src",
        "/home/joshua/rustc/src/tools/remote-test-client/src",
        "/home/joshua/rustc/src/tools/remote-test-server/src",
        "/home/joshua/rustc/src/tools/rls/src",
        "/home/joshua/rustc/src/tools/rls/rls-ipc/src",
        "/home/joshua/rustc/src/tools/rls/rls-rustc/src",
        "/home/joshua/rustc/src/tools/rust-demangler/src",
        "/home/joshua/rustc/src/tools/rustbook/src",
        "/home/joshua/rustc/compiler/rustc/src",
        "/home/joshua/rustc/library/rustc-std-workspace-alloc/src",
        "/home/joshua/rustc/library/rustc-std-workspace-core/src",
        "/home/joshua/rustc/library/rustc-std-workspace-std/src",
        "/home/joshua/rustc/src/tools/rustc-workspace-hack/src",
        "/home/joshua/rustc/compiler/rustc_apfloat/src",
        "/home/joshua/rustc/compiler/rustc_arena/src",
        "/home/joshua/rustc/compiler/rustc_ast/src",
        "/home/joshua/rustc/compiler/rustc_ast_lowering/src",
        "/home/joshua/rustc/compiler/rustc_ast_passes/src",
        "/home/joshua/rustc/compiler/rustc_ast_pretty/src",
        "/home/joshua/rustc/compiler/rustc_attr/src",
        "/home/joshua/rustc/compiler/rustc_builtin_macros/src",
        "/home/joshua/rustc/compiler/rustc_codegen_llvm/src",
        "/home/joshua/rustc/compiler/rustc_codegen_ssa/src",
        "/home/joshua/rustc/compiler/rustc_data_structures/src",
        "/home/joshua/rustc/compiler/rustc_driver/src",
        "/home/joshua/rustc/compiler/rustc_error_codes/src",
        "/home/joshua/rustc/compiler/rustc_errors/src",
        "/home/joshua/rustc/compiler/rustc_expand/src",
        "/home/joshua/rustc/compiler/rustc_feature/src",
        "/home/joshua/rustc/compiler/rustc_fs_util/src",
        "/home/joshua/rustc/compiler/rustc_graphviz/src",
        "/home/joshua/rustc/compiler/rustc_hir/src",
        "/home/joshua/rustc/compiler/rustc_hir_pretty/src",
        "/home/joshua/rustc/compiler/rustc_incremental/src",
        "/home/joshua/rustc/compiler/rustc_index/src",
        "/home/joshua/rustc/compiler/rustc_infer/src",
        "/home/joshua/rustc/compiler/rustc_interface/src",
        "/home/joshua/rustc/compiler/rustc_lexer/src",
        "/home/joshua/rustc/compiler/rustc_lint/src",
        "/home/joshua/rustc/compiler/rustc_lint_defs/src",
        "/home/joshua/rustc/compiler/rustc_llvm/src",
        "/home/joshua/rustc/compiler/rustc_macros/src",
        "/home/joshua/rustc/compiler/rustc_metadata/src",
        "/home/joshua/rustc/compiler/rustc_middle/src",
        "/home/joshua/rustc/compiler/rustc_mir/src",
        "/home/joshua/rustc/compiler/rustc_mir_build/src",
        "/home/joshua/rustc/compiler/rustc_parse/src",
        "/home/joshua/rustc/compiler/rustc_parse_format/src",
        "/home/joshua/rustc/compiler/rustc_passes/src",
        "/home/joshua/rustc/compiler/rustc_plugin_impl/src",
        "/home/joshua/rustc/compiler/rustc_privacy/src",
        "/home/joshua/rustc/compiler/rustc_query_system/src",
        "/home/joshua/rustc/compiler/rustc_resolve/src",
        "/home/joshua/rustc/compiler/rustc_save_analysis/src",
        "/home/joshua/rustc/compiler/rustc_serialize/src",
        "/home/joshua/rustc/compiler/rustc_session/src",
        "/home/joshua/rustc/compiler/rustc_span/src",
        "/home/joshua/rustc/compiler/rustc_symbol_mangling/src",
        "/home/joshua/rustc/compiler/rustc_target/src",
        "/home/joshua/rustc/src/tools/clippy/rustc_tools_util/src",
        "/home/joshua/rustc/compiler/rustc_trait_selection/src",
        "/home/joshua/rustc/compiler/rustc_traits/src",
        "/home/joshua/rustc/compiler/rustc_ty/src",
        "/home/joshua/rustc/compiler/rustc_typeck/src",
        "/home/joshua/rustc/src/librustdoc/src",
        "/home/joshua/rustc/src/tools/rustdoc-themes/src",
        "/home/joshua/rustc/src/tools/rustdoc/src",
        "/home/joshua/rustc/src/tools/rustfmt/config_proc_macro/src",
        "/home/joshua/rustc/src/tools/rustfmt/src",
        "/home/joshua/rustc/library/std/src",
        "/home/joshua/rustc/library/term/src",
        "/home/joshua/rustc/library/test/src",
        "/home/joshua/rustc/src/tools/tidy/src",
        "/home/joshua/rustc/src/tools/tier-check/src",
        "/home/joshua/rustc/src/tools/unicode-table-generator/src",
        "/home/joshua/rustc/src/tools/unstable-book-gen/src",
        "/home/joshua/rustc/library/unwind/src",
    ],
    display_settings: DisplaySettings {
        summary: false,
    },
}

@Canop
Copy link
Owner

Canop commented Nov 9, 2020

I just pushed some file existence checks

@Canop Canop self-assigned this Nov 9, 2020
@jyn514
Copy link
Contributor Author

jyn514 commented Nov 9, 2020

That fixed it, thanks!

@jyn514 jyn514 closed this as completed Nov 9, 2020
@Canop
Copy link
Owner

Canop commented Nov 9, 2020

Cool. Is it now possible and practical to use bacon with rustc, in your opinion ?

@jyn514
Copy link
Contributor Author

jyn514 commented Nov 9, 2020

@Canop not yet - cargo check doesn't work on rustc (#9 (comment)), and also bacon isn't spotting some errors that cargo emits (#20).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants