sver can't reffer multi profiles on same sver.toml
kna opened this issue · 3 comments
kna commented
sver can't get file lists (and calc hash) for a profile which depends multi profiles on same sver.toml.
The root cause could be the following code:
Lines 190 to 193 in 205c8ce
It should check also a profile, I think.
The test code is here:
// repo layout
// .
// + test.txt
// + lib/sver.toml -> [default] dependency = ["lib/:prof1","lib/:prof2"], [prof1] dependency = ["test1.txt"], [prof2] dependency = ["test2.txt"]
#[test]
fn multiprofile_singledir() {
initialize();
// setup
let repo = setup_test_repository();
add_blob(&repo, "test1.txt", "hello".as_bytes());
add_blob(&repo, "test2.txt", "world".as_bytes());
add_blob(
&repo,
"lib/sver.toml",
"
[default]
dependencies = [
\"lib/:prof1\",
\"lib/:prof2\",
]
[prof1]
dependencies = [
\"test1.txt\",
]
[prof2]
dependencies = [
\"test2.txt\",
]"
.as_bytes(),
);
commit(&repo, "setup");
// default
{
let sver_repo = SverRepository::new(&calc_target_path(&repo, "lib")).unwrap();
// exercise
let sources = sver_repo.list_sources().unwrap();
let version = sver_repo.calc_version().unwrap();
// verify
assert_eq!(
sources,
vec!["lib/sver.toml", "test1.txt", "test2.txt"]
);
assert_eq!(
version.version,
"1a994876a6b773a73dd08ba8f176257f62ed9e95b5f034238c42da9702115ffe"
);
}
}
mitoma commented
Thank you for your report.
This is a bug, so I fixed it in #63.
However, the hash value has changed from the test case you reported.
No problems?