diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2025-02-24 17:06:56 +0100 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2025-02-28 14:57:48 +0100 |
commit | a1e68f7a02a61d5b03ca2fb1b1f5ec75fb1c9e31 (patch) | |
tree | d4eca81e217eca6493dbd3ab341f93a1080e71b0 /test | |
parent | b9b8339487824c7020130c51ab908cf38be7e17f (diff) | |
download | justbuild-a1e68f7a02a61d5b03ca2fb1b1f5ec75fb1c9e31.tar.gz |
just-lock clone: Fix wrong order in resolving trees
Match correctly the behavior of just-mr, i.e., resolve the special
entries of the relevant subtree of the original tree instead of
taking the subtree of the resolved original tree. This also means
that the clones of archives can directly stage the relevant subdir
of the unpacked content and forward any 'special' pragma (same as
for other cloned repository types).
Diffstat (limited to 'test')
-rw-r--r-- | test/end-to-end/just-lock/clone/archive-repos.sh | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/test/end-to-end/just-lock/clone/archive-repos.sh b/test/end-to-end/just-lock/clone/archive-repos.sh index 2d0c314e..c2c8a5b9 100644 --- a/test/end-to-end/just-lock/clone/archive-repos.sh +++ b/test/end-to-end/just-lock/clone/archive-repos.sh @@ -57,7 +57,7 @@ cat > repos.in.json <<EOF , "content": "${ZIP_REPO_CONTENT}" , "fetch": "http://non-existent.example.org/zip_repo.zip" , "subdir": "root" - , "pragma": {"special": "resolve-partially"} + , "pragma": {"special": "resolve-completely"} } } , "tgz_repo": @@ -118,7 +118,9 @@ grep "${CLONE_TO}/zip" repos.json grep "${CLONE_TO}/tgz" repos.json grep "${CLONE_TO}/foreign" repos.json grep "${CLONE_TO}/distdir" repos.json -[ ! $(grep pragma repos.json) ] # special pragmas should have been resolved +# check special pragmas are kept +grep resolve-completely repos.json +grep ignore repos.json echo # Check setup with local clones: @@ -127,24 +129,16 @@ echo echo # Check that the clones have the expected content -"${JUST}" install-cas --local-build-root "${LBR_ARCHIVES}" \ - "$(jq '."repositories"."zip_repo"."workspace_root" | .[1]' "${CONF}" | tr -d '"')::t" \ - -P root -o "${INSTALL_ZIP}" -diff -ruN "${INSTALL_ZIP}" "${CLONE_TO}/zip" - -"${JUST}" install-cas --local-build-root "${LBR_ARCHIVES}" \ - "$(jq '."repositories"."tgz_repo"."workspace_root" | .[1]' "${CONF}" | tr -d '"')::t" \ - -P root/baz -o "${INSTALL_TGZ}" -diff -ruN "${INSTALL_TGZ}" "${CLONE_TO}/tgz" - -"${JUST}" install-cas --local-build-root "${LBR_ARCHIVES}" \ - "$(jq '."repositories"."foreign_file"."workspace_root" | .[1]' "${CONF}" | tr -d '"')::t" \ - -o "${INSTALL_FOREIGN}" -diff -ruN "${INSTALL_FOREIGN}" "${CLONE_TO}/foreign" - -"${JUST}" install-cas --local-build-root "${LBR_ARCHIVES}" \ - "$(jq '."repositories"."distdir_repo"."workspace_root" | .[1]' "${CONF}" | tr -d '"')::t" \ - -o "${INSTALL_DISTDIR}" -diff -ruN "${INSTALL_DISTDIR}" "${CLONE_TO}/distdir" +[ $(jq '."repositories"."zip_repo"."workspace_root" | .[1]' "${CONF}" | tr -d '"') \ + = $("${JUST}" add-to-cas --local-build-root "${LBR_CLONES}" --resolve-special=tree-all "${CLONE_TO}/zip") ] + +[ $(jq '."repositories"."tgz_repo"."workspace_root" | .[1]' "${CONF}" | tr -d '"') \ + = $("${JUST}" add-to-cas --local-build-root "${LBR_CLONES}" --resolve-special=ignore "${CLONE_TO}/tgz") ] + +[ $(jq '."repositories"."foreign_file"."workspace_root" | .[1]' "${CONF}" | tr -d '"') \ + = $("${JUST}" add-to-cas --local-build-root "${LBR_CLONES}" "${CLONE_TO}/foreign") ] + +[ $(jq '."repositories"."distdir_repo"."workspace_root" | .[1]' "${CONF}" | tr -d '"') \ + = $("${JUST}" add-to-cas --local-build-root "${LBR_CLONES}" "${CLONE_TO}/distdir") ] echo "OK" |