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

Adding debugging printout on compiler launch #38

Merged
merged 3 commits into from
May 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,43 @@ To debug in VS Code add this config:
"stopOnEntry": false
}

- To print out the compilation command line spawned by tests set env: RUST_LOG=launch_compiler.
For example:
```
> RUST_LOG=launch_compiler cargo test --manifest-path external-crates/move/Cargo.toml -p move-mv-llvm-compiler --test stdlib-with-p-option-tests; echo EOT
Compiling move-mv-llvm-compiler v0.1.0 (/home/sol/work/git/sui-solana-032024/external-crates/move/solana/move-mv-llvm-compiler)
Finished test [unoptimized + debuginfo] target(s) in 1.22s
Running tests/stdlib-with-p-option-tests.rs (external-crates/move/target/debug/deps/stdlib_with_p_option_tests-ffb0765866d3fdd7)
running 1 test
Finished dev [unoptimized + debuginfo] target(s) in 0.29s
Finished dev [unoptimized + debuginfo] target(s) in 0.18s
[2024-05-11T01:06:54Z DEBUG stdlib_with_p_option_tests::test_common] Command {
program: "/home/sol/work/git/sui-solana-032024/external-crates/move/target/debug/move-mv-llvm-compiler",
args: [
"/home/sol/work/git/sui-solana-032024/external-crates/move/target/debug/move-mv-llvm-compiler",
"-c",
"/home/sol/work/git/sui-solana-032024/external-crates/move/solana/move-mv-llvm-compiler/tests/stdlib-with-p-option-tests/hash_tests.move",
"--extension",
"ll.actual",
"-p",
"/home/sol/work/git/sui-solana-032024/external-crates/move/crates/move-stdlib",
"--test",
"--dev",
"-S",
"-o",
"/home/sol/work/git/sui-solana-032024/external-crates/move/solana/move-mv-llvm-compiler/tests/stdlib-with-p-option-tests/hash_tests-build",
],
create_pidfd: false,
}
test run_test::hash_tests.move ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.60s
EOT
```

### Protip

----
Expand Down
10 changes: 7 additions & 3 deletions external-crates/move/solana/move-mv-llvm-compiler/src/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,13 @@ pub fn resolve_dependency(
lock_file: None, // Option<PathBuf>
fetch_deps_only: true,
skip_fetch_latest_git_deps: true,
default_flavor: None, // todo sui
default_edition: None, // todo sui
deps_as_root: false, // todo sui
// Note: Sui introduced compiler_version and edition/flavor of tool chain,
// they may be set as
// "move build --default-move-edition --default-move-flavor".
// Since Solana uses own compiler and tools, ignore them.
default_flavor: None, // in Sui can be Some(Flavor::GlobalStorage) or set in.
default_edition: None,
deps_as_root: false, // deps_as_root is reserved, not used
silence_warnings: false,
warnings_are_errors: false,
additional_named_addresses: BTreeMap::new(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,8 @@ pub fn run_move_to_llvm_build(
fs::create_dir_all(test_plan.build_dir.to_str().unwrap()).expect("Directory does not exist");
cmd.args(["-o", test_plan.build_dir.to_str().expect("utf-8")]);

debug!(target: "launch_compiler", "{:#?}", &cmd);

let output = cmd.output()?;

if !output.status.success() {
Expand Down
Loading