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

senc does not emit any error messages for failure scenarios #49

Open
robmorgan opened this issue Apr 5, 2024 · 7 comments
Open

senc does not emit any error messages for failure scenarios #49

robmorgan opened this issue Apr 5, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@robmorgan
Copy link

robmorgan commented Apr 5, 2024

senc doesn't seem to work for me. If I manually run it:

cd senc
mkdir -p out
cargo run -- -l trace -o ./_ci ./out

I get the following output:

Finished dev [unoptimized + debuginfo] target(s) in 0.15s
     Running `target/debug/senc -l trace -o ./_ci ./out`
TRACE: [84054582-022a-4cc4-94cf-9816ed2435c4] Worker started.
TRACE: [390ef900-c492-4c9e-a3e8-686ed884916a] Worker started.
TRACE: [84054582-022a-4cc4-94cf-9816ed2435c4] Worker disconnected; shutting down.
TRACE: [8ae14d12-70dd-4d13-a5f3-cda53414474f] Worker started.
TRACE: [82b9f2c9-d837-4158-9fc6-8391ac646e97] Worker started.
TRACE: [c099d01a-fcba-4a68-8a43-6915cca3bd30] Worker started.
TRACE: [82b9f2c9-d837-4158-9fc6-8391ac646e97] Worker disconnected; shutting down.
TRACE: [c099d01a-fcba-4a68-8a43-6915cca3bd30] Worker disconnected; shutting down.
TRACE: [df400229-a3b5-4742-8873-18f3cc5f7515] Worker started.
TRACE: [c0c64671-1382-4786-b9c3-961abd856620] Worker started.
TRACE: [90069fad-7ce7-4054-b0c2-3f6173b2ceb9] Worker started.
TRACE: [8ae14d12-70dd-4d13-a5f3-cda53414474f] Worker disconnected; shutting down.
TRACE: [c0c64671-1382-4786-b9c3-961abd856620] Worker disconnected; shutting down.
TRACE: [90069fad-7ce7-4054-b0c2-3f6173b2ceb9] Worker disconnected; shutting down.
TRACE: [390ef900-c492-4c9e-a3e8-686ed884916a] Worker disconnected; shutting down.
TRACE: [df400229-a3b5-4742-8873-18f3cc5f7515] Worker disconnected; shutting down.
TRACE: [df400229-a3b5-4742-8873-18f3cc5f7515] waiting for worker
TRACE: [7f692fa2-6e2c-4bc2-a811-7ab6860e3db0] Worker started.
TRACE: [847ee1a4-7fc9-4d24-b15f-5f740221b1d2] Worker started.
TRACE: [7f692fa2-6e2c-4bc2-a811-7ab6860e3db0] Worker disconnected; shutting down.
TRACE: [847ee1a4-7fc9-4d24-b15f-5f740221b1d2] Worker disconnected; shutting down.
TRACE: [390ef900-c492-4c9e-a3e8-686ed884916a] waiting for worker
TRACE: [8ae14d12-70dd-4d13-a5f3-cda53414474f] waiting for worker
TRACE: [c099d01a-fcba-4a68-8a43-6915cca3bd30] waiting for worker
TRACE: [7f692fa2-6e2c-4bc2-a811-7ab6860e3db0] waiting for worker
TRACE: [c0c64671-1382-4786-b9c3-961abd856620] waiting for worker
TRACE: [90069fad-7ce7-4054-b0c2-3f6173b2ceb9] waiting for worker
TRACE: [847ee1a4-7fc9-4d24-b15f-5f740221b1d2] waiting for worker
TRACE: [84054582-022a-4cc4-94cf-9816ed2435c4] waiting for worker
TRACE: [82b9f2c9-d837-4158-9fc6-8391ac646e97] waiting for worker

The same goes if I build using cargo release or download a pre-compiled binary.

It doesn't seem to actually generate anything in my out dir. I'm using the included _ci example. Could it be search for global node_modules or something?

@yorinasub17
Copy link
Member

Hmm I need to investigate this, but off the top of my head, did you run pnpm install in _ci before running senc?

@robmorgan
Copy link
Author

robmorgan commented Apr 5, 2024 via email

@robmorgan
Copy link
Author

I've noticed some of the tests are complaining about lodash. I'm not sure if it's related...

running 16 tests
test engine::tests::test_engine_runs_code_with_config_yaml_import ... ok
thread 'test engine::tests::test_engine_runs_code_with_config_json_import ... engine::tests::test_engine_runs_code_with_node_modulesok' panicked at '
error running js: node package lodash-es does not have a package.json file', src/engine.rs:824:14
test engine::tests::test_engine_runs_code_with_builtin_filefunctions ... ok
stack backtrace:
test engine::tests::test_engine_fails_code_with_import_outside_projectroot ... ok
test engine::tests::test_engine_prepends_hcl_prefix_if_set ... ok
test engine::tests::test_engine_prepends_prefix_if_set ... ok
test engine::tests::test_engine_runs_js_with_args ... ok
test engine::tests::test_engine_runs_code_with_out_data_output ... ok
test engine::tests::test_engine_runs_code_with_out_data_list_output ... ok
test engine::tests::test_engine_runs_js ... ok
test engine::tests::test_engine_runs_ts ... ok
test engine::tests::test_engine_checks_schema_pass ... ok
test engine::tests::test_engine_checks_schema_fail ... ok
   0: rust_begin_unwind
             at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panicking.rs:593:5
   1: core::panicking::panic_fmt
             at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/panicking.rs:67:14
   2: core::result::unwrap_failed
             at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/result.rs:1651:5
   3: core::result::Result<T,E>::expect
             at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/result.rs:1033:23
   4: senc::engine::tests::check_single_json_output_with_args::{{closure}}
             at ./src/engine.rs:822:22
   5: senc::engine::tests::check_single_json_output::{{closure}}
             at ./src/engine.rs:806:81
   6: senc::engine::tests::test_engine_runs_code_with_node_modules::{{closure}}
             at ./src/engine.rs:566:81

// <rest omitted for brevity>

@yorinasub17
Copy link
Member

Ah yes you need to run pnpm install in the fixtures directory.

@robmorgan
Copy link
Author

yeah the tests all pass once you run pnpm install in the fixtures directory, but I still can't get the _ci sources building:

cd _ci && pnpm install
mkdir -p out
cargo run -- -l trace -o ./_ci ./out

I'll keep investigating.

@robmorgan
Copy link
Author

Okay I've figured it out. One was a dumb use of CLI args by me. I was doing:

cargo run -- -l trace -o ./_ci ./out

When I actually needed to do:

cargo run -- ./_ci -o ./out -l trace

Another potential issue is I noticed is files::find_node_modules_dir is resolving my global node_modules dir (Users/robbym/node_modules). It's walking from my GOROOT up to my home folder. I know there's a bit of a trend now days to move away from global node_modules, but I wanted to check that this is the expected behaviour?

@yorinasub17 yorinasub17 added the bug Something isn't working label Apr 6, 2024
@yorinasub17
Copy link
Member

Ah yes the behavior of walking up the tree to find node_modules is intended (since otherwise I can't implement hierarchical node_modules support in monorepos), but the lack of error messages is not. I'm going to rename this issue for tracking that part of the problem.

@yorinasub17 yorinasub17 changed the title Senc doesn't work for me senc does not emit any error messages for failure scenarios Apr 6, 2024
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