From d674714116c94c5ee32d9c9add3ea66b2de6e32a Mon Sep 17 00:00:00 2001 From: "Alejandro R. Mosteo" Date: Mon, 2 Sep 2024 22:26:39 +0200 Subject: [PATCH] Test for fix --- alire.toml | 2 +- deps/den | 2 +- testsuite/drivers/builds.py | 11 +--- .../cache/softlinks/my_index/crate-0.1.0.tgz | Bin 0 -> 760 bytes .../my_index/index/cr/crate/crate-0.1.0.toml | 11 ++++ .../cache/softlinks/my_index/index/index.toml | 1 + testsuite/tests/cache/softlinks/test.py | 60 ++++++++++++++++++ testsuite/tests/cache/softlinks/test.yaml | 8 +++ 8 files changed, 85 insertions(+), 10 deletions(-) create mode 100644 testsuite/tests/cache/softlinks/my_index/crate-0.1.0.tgz create mode 100644 testsuite/tests/cache/softlinks/my_index/index/cr/crate/crate-0.1.0.toml create mode 100644 testsuite/tests/cache/softlinks/my_index/index/index.toml create mode 100644 testsuite/tests/cache/softlinks/test.py create mode 100644 testsuite/tests/cache/softlinks/test.yaml diff --git a/alire.toml b/alire.toml index a2e72c926..d9ab5289d 100644 --- a/alire.toml +++ b/alire.toml @@ -69,7 +69,7 @@ commit = "56bbdc008e16996b6f76e443fd0165a240de1b13" [pins.den] url = "https://github.com/mosteo/den" -commit = "35d1f38395b93766dd64bca5901ce3b6a416ba1a" +commit = "681ab5ca522585953f2e1d70763731df34c96012" [pins.dirty_booleans] url = "https://github.com/mosteo/dirty_booleans" diff --git a/deps/den b/deps/den index 3a462136e..681ab5ca5 160000 --- a/deps/den +++ b/deps/den @@ -1 +1 @@ -Subproject commit 3a462136e76f4209d6507d9752cd0a6bc81a4f42 +Subproject commit 681ab5ca522585953f2e1d70763731df34c96012 diff --git a/testsuite/drivers/builds.py b/testsuite/drivers/builds.py index 48ff323d9..05e6359c7 100644 --- a/testsuite/drivers/builds.py +++ b/testsuite/drivers/builds.py @@ -83,14 +83,9 @@ def sync() -> None: """ Sync the shared build directory """ - # We force the sync by running a build, no matter if it succeeds or not - try: - subprocess.run(["alr", "-q", "-d", "build"] - , stdout=subprocess.DEVNULL - , stderr=subprocess.DEVNULL - ) - except: - pass + run_alr("build", "--stop-after=generation") + return + def sync_builds() -> None: sync() diff --git a/testsuite/tests/cache/softlinks/my_index/crate-0.1.0.tgz b/testsuite/tests/cache/softlinks/my_index/crate-0.1.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..4e90424e30d169be7a5f25d147ff9d14ddc67a3b GIT binary patch literal 760 zcmV9PbRthD9ywG-MR5<|S2 zc-8j*gai^uW99S2GmhD`)oJ%dlvIkRVj+abITPN=8FBsoi-NRPN(xEJ7J^7>Tdd4d z1G?s|J5}v!ReY}w&As0}`u;CvbLGGPyud7&=igeRy?&#;f2pj1{~V0{uj>PIjKRNq z;NLh)N+})k-w36OmF(Wu+qzv~L|4H7jsMFh`WML;^_e-5JlebRBw zfdv2B$&mkAlY##n-1Yy?6C((=R?n&bNN5WFjq&xL;0b>p_>cSFH_eeDM*8~i$Vk8b zm*tax4Fh5r$0YDS?Z4aYzcR&0_iz0|F!*0qegXe6|HrD`9ZoDUK2ZNl8vL`wzYF}| z_J3{jvSV$yKH#5>_Wob%uB#8`la2me-u`cL^j0QG+kV*b~R zG3M3(gMUMI=>JjwXCdZ)%XkM!$$w+|{U3+^KM!<-ASK{`da1FbesfgP8w{Pk&PV zXGOpNr(D?o=bVHw;D6Hp`IG#caGxNp!~Q?~FHbc884JK9|5673r2P6XIg8L3@IUE) z^J)G~?_W#!&%xOLzFsq*0ZFL;wbUxq|0GfWXJOj^YqNPNyQUN+M-84(|7)T?|D7Pz z|2cTzpCv}Z{a;hR{#)M&g#BOEX*do1$Ne+KNbxVF=%4>N2md*k_J2N~`O-hlzYh6t zoS{Gdc}5Wd{-gf6Vx;*G^`Eh%;Xelx&;R)jeq5O6|8oAD`u<|A*&)^7LGHyh9lS|0Dn07d_3t8}|Q1@1J`rj)DK%^}lJ3yc subdir/bin + ├── broken -> missing + ├── lib + │ ├── mock.so -> mock.so.0.0 + │ ├── mock.so.0 -> mock.so.0.0 + │ ├── mock.so.0.0 + │ ├── zzz.so -> mock.so + │ └── zzz.so.0 -> mock.so + ├── loop + │ ├── x -> z + │ ├── y -> x + │ └── z -> y + ├── order + │ ├── ab -> b + │ ├── af -> d/f + │ ├── b + │ ├── cb -> b + │ ├── d + │ │ └── f + │ └── zf -> d/f + ├── self -> self + ├── subdir + │ ├── bin + │ │ ├── loop -> ../../subdir + │ │ └── x + │ ├── parent -> .. + │ └── self -> ../subdir + ├── that -> this + └── this -> that + +""" + +import os +import shutil +import drivers.builds as builds +from drivers.alr import alr_with, init_local_crate, run_alr + + +init_local_crate() + +# Make the crate depend on our troublesome crate and ensure syncing +alr_with("crate") +builds.sync() + +# Ensure that a copy has been made to the cache +if builds.are_shared(): + assert os.path.exists(builds.find_dir("crate")) + +# Cleanup +os.chdir("..") +shutil.rmtree("xxx") + +print('SUCCESS') diff --git a/testsuite/tests/cache/softlinks/test.yaml b/testsuite/tests/cache/softlinks/test.yaml new file mode 100644 index 000000000..f0325a232 --- /dev/null +++ b/testsuite/tests/cache/softlinks/test.yaml @@ -0,0 +1,8 @@ +driver: python-script +build_mode: both +control: + - [SKIP, "skip_unix", "Test is Unix-only"] +indexes: + my_index: + in_fixtures: false + compiler_only_index: {}