alibuild 2.0.6__tar.gz → 2.0.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {alibuild-2.0.6 → alibuild-2.0.7}/PKG-INFO +1 -1
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild.egg-info/PKG-INFO +1 -1
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/_version.py +3 -3
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/migrate.py +36 -15
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/utilities.py +6 -1
- {alibuild-2.0.6 → alibuild-2.0.7}/docs/docs/reference.md +30 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/docs/docs/user.md +3 -2
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/test_migrate.py +48 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/test_utilities.py +10 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/.claude/skills/s3-conditional-writes/SKILL.md +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/.claude/skills/support-architecture/SKILL.md +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/.flake8 +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/.github/dependabot.yml +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/.github/workflows/documentation.yml +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/.github/workflows/homebrew.yml +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/.github/workflows/pr-check.yml +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/.github/workflows/release.yml +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/.gitignore +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/.pylintrc +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/ANALYTICS.md +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/DESIGN.md +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/LICENSE.md +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/PACKAGING.md +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/README.rst +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/REMOTE_STORE_CAS_AC.md +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alfaBuild +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/aliBuild +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/aliDeps +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/aliDoctor +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild.egg-info/SOURCES.txt +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild.egg-info/dependency_links.txt +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild.egg-info/requires.txt +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild.egg-info/top_level.txt +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/__init__.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/analytics.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/args.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/build.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/build_template.sh +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/clean.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/cmd.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/completion.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/completions/__init__.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/completions/bash.sh +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/completions/zsh.sh +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/deps.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/doctor.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/git.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/init.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/install.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/keyring.json +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/log.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/reconstruct.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/sandbox.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/scm.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/signing.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/sl.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/source.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/sync.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/sync_reapi.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/templating_plugin.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alibuild_helpers/workarea.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/alienv +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/codecov.yml +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/debian/changelog +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/debian/compat +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/debian/control +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/debian/copyright +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/debian/files +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/debian/rules +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/docs/SUPPORT +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/docs/docs/alice_logo.png +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/docs/docs/deps.png +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/docs/docs/index.md +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/docs/docs/quick.md +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/docs/docs/stylesheets/extra.css +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/docs/docs/troubleshooting.md +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/docs/mkdocs.yml +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/extras/nix/alibuild_nix.jnj +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/extras/nix/alidist-aliphysics.nix +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/extras/nix/alidist-helpers.nix +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/extras/nix/alidist.nix +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/extras/nix/flake.lock +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/extras/nix/flake.nix +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/extras/nix/hyperloop.nix +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/extras/nix/hyperloopTest.nix +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/extras/nix/nix-interactive.bash +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/extras/nix/update-envs.sh +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/pb +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/pyproject.toml +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/requirements.txt +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/setup.cfg +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/setup.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/templates/alibuild_nix.jnj +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/templates/alibuild_to_please.jnj +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/test_analytics.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/test_args.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/test_build.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/test_clean.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/test_cmd.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/test_completion.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/test_deps.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/test_doctor.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/test_git.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/test_hashing.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/test_init.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/test_install.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/test_log.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/test_packagelist.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/test_parseRecipe.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/test_reconstruct.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/test_sandbox.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/test_signing.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/test_source.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/test_sync.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/test_sync_reapi.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/test_workarea.py +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/testdist/broken1.sh +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/testdist/broken2.sh +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/testdist/broken3.sh +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/testdist/broken4.sh +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/testdist/broken5.sh +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/testdist/broken6.sh +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/testdist/broken7.sh +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/testdist/clobber-initdotsh.sh +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/testdist/defaults-o2.sh +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/testdist/delete-etc.sh +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tests/testdist/tracking-env.sh +0 -0
- {alibuild-2.0.6 → alibuild-2.0.7}/tox.ini +0 -0
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '2.0.
|
|
32
|
-
__version_tuple__ = version_tuple = (2, 0,
|
|
31
|
+
__version__ = version = '2.0.7'
|
|
32
|
+
__version_tuple__ = version_tuple = (2, 0, 7)
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'g194bf901d'
|
|
@@ -395,6 +395,28 @@ def _github_raw_base(remote_url):
|
|
|
395
395
|
return "https://raw.githubusercontent.com/" + (match.group(1) if match else "alisw/alidist")
|
|
396
396
|
|
|
397
397
|
|
|
398
|
+
def recipe_from_meta(meta, tarball_path):
|
|
399
|
+
"""The recipe an aliBuild 2.0 tarball archives in its .meta.json, or None.
|
|
400
|
+
|
|
401
|
+
Such a tarball is normally in the Action Cache already, and the migration
|
|
402
|
+
loop skips it as present before getting here. It reaches migrate when it was
|
|
403
|
+
uploaded to a plain legacy store, with no Action Cache to write to (e.g. a
|
|
404
|
+
Jenkins daily run with aliBuild 2.0 against b3://). It records no alidist
|
|
405
|
+
commit, so the archived recipe is the only way to migrate it -- and the
|
|
406
|
+
better one, being exactly what was built. A text that does not match its
|
|
407
|
+
recorded digest is not trusted (None: fall back to the alidist commit)."""
|
|
408
|
+
archived = meta.get("recipe") or {}
|
|
409
|
+
text = archived.get("text")
|
|
410
|
+
if not text:
|
|
411
|
+
return None
|
|
412
|
+
digest = "sha256:" + hashlib.sha256(text.encode("utf-8", "ignore")).hexdigest()
|
|
413
|
+
if archived.get("digest") not in (None, digest):
|
|
414
|
+
warning("%s: the archived recipe does not match its digest %s; ignoring it",
|
|
415
|
+
tarball_path, archived.get("digest"))
|
|
416
|
+
return None
|
|
417
|
+
return text
|
|
418
|
+
|
|
419
|
+
|
|
398
420
|
def recover_recipe(alidist_dir, alidist_commit, package):
|
|
399
421
|
"""Recover the full recipe of `package` at the recorded alidist commit.
|
|
400
422
|
|
|
@@ -805,21 +827,20 @@ def migrate_tarball(sync, tarball_path, alidist_dir, container_override=None,
|
|
|
805
827
|
tarball_path)
|
|
806
828
|
return None
|
|
807
829
|
container = container_for_migration(meta["architecture"], container_override)
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
return None
|
|
830
|
+
recipe = recipe_from_meta(meta, tarball_path)
|
|
831
|
+
if recipe is None:
|
|
832
|
+
# aliBuild 1.x tarballs record the alidist commit instead of the recipe.
|
|
833
|
+
alidist_commit = (meta.get("alidist") or {}).get("commit")
|
|
834
|
+
if not alidist_commit:
|
|
835
|
+
warning("%s records neither its recipe nor an alidist commit; skipping "
|
|
836
|
+
"(not migratable)", tarball_path)
|
|
837
|
+
return None
|
|
838
|
+
try:
|
|
839
|
+
recipe = recover_recipe(alidist_dir, alidist_commit, meta["package"]["name"])
|
|
840
|
+
except Exception as exc: # pylint: disable=broad-except
|
|
841
|
+
warning("Could not recover recipe for %s from alidist@%s: %s",
|
|
842
|
+
meta["package"]["name"], alidist_commit, exc)
|
|
843
|
+
return None
|
|
823
844
|
if verify:
|
|
824
845
|
ok, reason = verify_recovered_recipe(meta, recipe)
|
|
825
846
|
if not ok:
|
|
@@ -452,7 +452,7 @@ class GitReader:
|
|
|
452
452
|
m = re.search(r'^dist:(.*)@([^@]+)$', self.url)
|
|
453
453
|
fn, gh = m.groups()
|
|
454
454
|
err, d = git(("show", f"{gh}:{fn.lower()}.sh"),
|
|
455
|
-
directory=self.configDir)
|
|
455
|
+
directory=self.configDir, check=False)
|
|
456
456
|
if err:
|
|
457
457
|
raise RuntimeError("Cannot read recipe {fn} from reference {gh}.\n"
|
|
458
458
|
"Make sure you run first (this will not alter your recipes):\n"
|
|
@@ -543,6 +543,11 @@ def getPkgDirs(configDir):
|
|
|
543
543
|
return pkgDirs
|
|
544
544
|
|
|
545
545
|
def resolveFilename(taps: dict, pkg: str, configDir: str):
|
|
546
|
+
# A recipe pinned in the defaults' overrides (PKG@<ref>) is read with
|
|
547
|
+
# "git show" from the -c repository: it is not a file to look for, and no
|
|
548
|
+
# BITS_PATH directory can shadow it.
|
|
549
|
+
if pkg in taps:
|
|
550
|
+
return (taps[pkg], os.path.abspath(configDir))
|
|
546
551
|
for d in getPkgDirs(configDir):
|
|
547
552
|
filename = checkForFilename(taps, pkg, d)
|
|
548
553
|
if os.path.exists(filename):
|
|
@@ -4,6 +4,7 @@ layout: main
|
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
1. [Recipe formats](#recipe-formats)
|
|
7
|
+
1. [Searching several directories: `BITS_PATH`](#searching-several-directories-bits_path)
|
|
7
8
|
1. [The header](#the-header)
|
|
8
9
|
2. [The body](#the-body)
|
|
9
10
|
3. [Defaults, common requirements for builds](#defaults)
|
|
@@ -18,6 +19,35 @@ The recipes themselves are called `<package>.sh` where `<package>` is the name
|
|
|
18
19
|
of the package whose build recipe is described. Please note that all recipe
|
|
19
20
|
filenames are lowercase: _e.g._ the recipe for `ROOT` will be in `root.sh`.
|
|
20
21
|
|
|
22
|
+
### Searching several directories: `BITS_PATH`
|
|
23
|
+
|
|
24
|
+
Recipes can also come from directories other than the `-c` one, listed in the
|
|
25
|
+
`BITS_PATH` environment variable, separated by colons as in `PATH`:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
export BITS_PATH=/home/user/my-recipes:extra
|
|
29
|
+
aliBuild build O2 --defaults o2
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
For every package, and for the `defaults-<name>.sh` selected with
|
|
33
|
+
`--defaults`, aliBuild looks in each `BITS_PATH` directory in order and then in
|
|
34
|
+
the `-c` directory, and takes the first `<package>.sh` it finds. So a recipe in
|
|
35
|
+
a `BITS_PATH` directory replaces the one of the same name in alidist, and the
|
|
36
|
+
`-c` directory is always searched last.
|
|
37
|
+
|
|
38
|
+
- A relative entry is taken relative to the `-c` directory, not to the current
|
|
39
|
+
directory: above, `extra` means `alidist/extra`.
|
|
40
|
+
- Empty entries and a trailing colon are ignored; an unset or empty
|
|
41
|
+
`BITS_PATH` means only the `-c` directory is searched.
|
|
42
|
+
- Some files are only read from the `-c` directory: the architecture defaults
|
|
43
|
+
(`defaults-<arch>.sh`, see [below](#architecture-defaults)), and the list of
|
|
44
|
+
available defaults printed when the one requested does not exist.
|
|
45
|
+
- A recipe pinned to a commit in a defaults' `overrides` (`ROOT@<ref>`, see
|
|
46
|
+
[Defaults](#defaults)) is read with `git show` from that commit of the `-c`
|
|
47
|
+
repository, whatever `BITS_PATH` says. The `-c` directory must then be a
|
|
48
|
+
git repository. aliBuild v1.17.15 to v2.0.6 cannot find such a
|
|
49
|
+
recipe and stop with `Package ROOT not found`.
|
|
50
|
+
|
|
21
51
|
The recipe itself is made up of two parts: an header, and the actual build
|
|
22
52
|
script, separated by three dashes (`---`) standalone.
|
|
23
53
|
|
|
@@ -427,8 +427,9 @@ aliBuild reconstruct O2 --version nightly-20261015 \
|
|
|
427
427
|
`aliBuild migrate` turns tarballs from a classic store into reapi entries, so
|
|
428
428
|
that releases built before any of this existed become installable and
|
|
429
429
|
reconstructible. For each tarball it reads the embedded `.meta.json` provenance,
|
|
430
|
-
|
|
431
|
-
|
|
430
|
+
takes the full recipe from it (tarballs built by aliBuild 2.0 archive it there,
|
|
431
|
+
including those uploaded to a classic store only) or else recovers it from the
|
|
432
|
+
alidist commit recorded there (aliBuild 1.x), synthesises the Action Cache entry, and writes the CAS blob, the recipe blob, the entry, the
|
|
432
433
|
legacy redirect and the per-package link. The old store is only ever read, never
|
|
433
434
|
written.
|
|
434
435
|
|
|
@@ -226,6 +226,54 @@ class MigrateTestCase(unittest.TestCase):
|
|
|
226
226
|
self.assertIn("build zlib", recipe) # recovered from alidist
|
|
227
227
|
self.assertEqual(entry["action"]["package"], "zlib")
|
|
228
228
|
|
|
229
|
+
def _meta_with_archived_recipe(self, text, digest=None):
|
|
230
|
+
"""The .meta.json of an aliBuild 2.0 build: the recipe, no alidist commit."""
|
|
231
|
+
meta = json.loads(json.dumps(META))
|
|
232
|
+
del meta["alidist"], meta["alibuild_version"]
|
|
233
|
+
meta["recipe"] = {
|
|
234
|
+
"digest": digest or "sha256:" + hashlib.sha256(text.encode()).hexdigest(),
|
|
235
|
+
"text": text, "env": {}, "append_path": {}, "prepend_path": {}}
|
|
236
|
+
return meta
|
|
237
|
+
|
|
238
|
+
def test_migrate_tarball_uses_the_archived_recipe(self):
|
|
239
|
+
# A 2.0 build uploaded to a legacy store only (no Action Cache): it has
|
|
240
|
+
# no alidist commit, and used to be skipped as "already in the ledger".
|
|
241
|
+
text = "package: zlib\nversion: v1.3.1\n---\narchived zlib\n"
|
|
242
|
+
path = self._write_tarball(self._meta_with_archived_recipe(text))
|
|
243
|
+
sync = FakeReapiSync()
|
|
244
|
+
self.assertEqual(migrate_tarball(sync, path, None), "z" * 40)
|
|
245
|
+
entry, _, recipe = sync.calls[0]
|
|
246
|
+
self.assertEqual(recipe, text)
|
|
247
|
+
self.assertEqual(entry["action"]["recipeDigest"],
|
|
248
|
+
"sha256:" + hashlib.sha256(text.encode()).hexdigest())
|
|
249
|
+
|
|
250
|
+
def test_migrate_tarball_prefers_the_archived_recipe(self):
|
|
251
|
+
alidist, commit = self._make_alidist()
|
|
252
|
+
text = "package: zlib\nversion: v1.3.1\n---\narchived zlib\n"
|
|
253
|
+
meta = self._meta_with_archived_recipe(text)
|
|
254
|
+
meta["alidist"] = {"commit": commit}
|
|
255
|
+
sync = FakeReapiSync()
|
|
256
|
+
migrate_tarball(sync, self._write_tarball(meta), alidist)
|
|
257
|
+
self.assertIn("archived zlib", sync.calls[0][2])
|
|
258
|
+
|
|
259
|
+
def test_migrate_tarball_distrusts_a_mismatched_archived_recipe(self):
|
|
260
|
+
text = "package: zlib\n---\narchived zlib\n"
|
|
261
|
+
meta = self._meta_with_archived_recipe(text, digest="sha256:" + "0" * 64)
|
|
262
|
+
sync = FakeReapiSync()
|
|
263
|
+
self.assertIsNone(migrate_tarball(sync, self._write_tarball(meta), None))
|
|
264
|
+
self.assertEqual(sync.calls, [])
|
|
265
|
+
# ... and uses the alidist commit instead when there is one.
|
|
266
|
+
alidist, commit = self._make_alidist()
|
|
267
|
+
meta["alidist"] = {"commit": commit}
|
|
268
|
+
migrate_tarball(sync, self._write_tarball(meta), alidist)
|
|
269
|
+
self.assertIn("build zlib", sync.calls[0][2])
|
|
270
|
+
|
|
271
|
+
def test_migrate_tarball_skips_without_recipe_or_commit(self):
|
|
272
|
+
meta = json.loads(json.dumps(META)) # alidist commit None, no recipe
|
|
273
|
+
sync = FakeReapiSync()
|
|
274
|
+
self.assertIsNone(migrate_tarball(sync, self._write_tarball(meta), None))
|
|
275
|
+
self.assertEqual(sync.calls, [])
|
|
276
|
+
|
|
229
277
|
def test_migrate_tarball_skips_without_meta(self):
|
|
230
278
|
alidist, _ = self._make_alidist()
|
|
231
279
|
path = os.path.join(self.tmp, "nometa.tar.gz")
|
|
@@ -460,6 +460,16 @@ class TestUtilities(unittest.TestCase):
|
|
|
460
460
|
self.assertEqual(resolveFilename({}, "zlib", "alidost"), (None, None))
|
|
461
461
|
self.assertEqual(resolveFilename({}, "python", "alidist"), ("/bar/python.sh", "/bar"))
|
|
462
462
|
|
|
463
|
+
# A recipe pinned in the defaults' overrides is not a file: it is read
|
|
464
|
+
# from the -c repository at that ref, whatever BITS_PATH contains.
|
|
465
|
+
taps = {"root": "dist:ROOT@v6-32-00"}
|
|
466
|
+
with patch.object(os.path, "exists", fake_exists), \
|
|
467
|
+
patch.object(os.path, "abspath", fake_abspath), \
|
|
468
|
+
patch.object(os, "environ", {"BITS_PATH": "/bar:/foo"}):
|
|
469
|
+
self.assertEqual(resolveFilename(taps, "root", "alidist"),
|
|
470
|
+
("dist:ROOT@v6-32-00", "/fake/alidist"))
|
|
471
|
+
self.assertEqual(resolveFilename(taps, "python", "alidist"), ("/bar/python.sh", "/bar"))
|
|
472
|
+
|
|
463
473
|
|
|
464
474
|
class TestTopologicalSort(unittest.TestCase):
|
|
465
475
|
"""Check that various properties of topological sorting hold."""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|