Crate keyword#303
Conversation
6139038 to
c5f33a7
Compare
|
In c5f33a7: This is full of unrelated lockfile changes. |
LesterEvSe
left a comment
There was a problem hiding this comment.
Update the section regarding the crate keyword in the doc/architecture.md file.
e8d0f3d to
fcdc6dd
Compare
fcdc6dd to
94bd65c
Compare
| // Parse the base path prefix (e.g., `dependency_root_path::file::` or `dependency_root_path::dir::file::`). | ||
| // We require at least 2 segments here because a valid import needs a minimum | ||
| // of 3 items total: the dependency_root_path, the file, and the specific item/function. |
There was a problem hiding this comment.
Should we mention crate keyword here?
|
Running https://github.com/Sdoba16/SimplicityHL/tree/feature/crate-keyword/functional-tests/valid-test-cases/external-library-uses-crate using simc directly fails in my case Is this expected? |
37ee79c to
43e1744
Compare
Should work with the updates |
Could we add a regression test for this? Something like below use std::path::{Path, PathBuf};
use std::process::Command;
fn repo_path(path: &str) -> PathBuf {
Path::new(env!("CARGO_MANIFEST_DIR")).join(path)
}
#[test]
fn cli_dependency_can_use_crate_root() {
let root = repo_path("functional-tests/valid-test-cases/external-library-uses-crate");
let main = root.join("main.simf");
let ext_lib = root.join("ext_lib");
let dep_arg = format!("{}:ext_lib={}", root.display(), ext_lib.display());
let output = Command::new(env!("CARGO_BIN_EXE_simc"))
.arg(main)
.arg("--dep")
.arg(dep_arg)
.output()
.expect("failed to run simc");
assert!(
output.status.success(),
"simc failed\nstatus: {:?}\nstdout:\n{}\nstderr:\n{}",
output.status.code(),
String::from_utf8_lossy(&output.stdout),
String::from_utf8_lossy(&output.stderr),
);
} |
f4b6a88 to
8f002f3
Compare
LesterEvSe
left a comment
There was a problem hiding this comment.
ACK 8f002f3; tested locally
Added support of crate keyword for local dependencies.
Added check that local files are dependent only with crate keyword.
Small fix for test_utils.
Closes #294