alibuild 1.17.11__tar.gz → 1.17.12__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-1.17.11 → alibuild-1.17.12}/PKG-INFO +1 -1
- {alibuild-1.17.11 → alibuild-1.17.12}/alfaBuild +2 -6
- {alibuild-1.17.11 → alibuild-1.17.12}/aliBuild +2 -6
- {alibuild-1.17.11 → alibuild-1.17.12}/alibuild.egg-info/PKG-INFO +1 -1
- {alibuild-1.17.11 → alibuild-1.17.12}/alibuild.egg-info/SOURCES.txt +1 -1
- {alibuild-1.17.11 → alibuild-1.17.12}/alibuild_helpers/_version.py +2 -2
- {alibuild-1.17.11 → alibuild-1.17.12}/alibuild_helpers/analytics.py +1 -4
- {alibuild-1.17.11 → alibuild-1.17.12}/alibuild_helpers/args.py +3 -4
- {alibuild-1.17.11 → alibuild-1.17.12}/alibuild_helpers/build.py +34 -25
- {alibuild-1.17.11 → alibuild-1.17.12}/alibuild_helpers/cmd.py +12 -48
- {alibuild-1.17.11 → alibuild-1.17.12}/alibuild_helpers/git.py +6 -6
- {alibuild-1.17.11 → alibuild-1.17.12}/alibuild_helpers/scm.py +1 -1
- {alibuild-1.17.11 → alibuild-1.17.12}/alibuild_helpers/sync.py +1 -1
- {alibuild-1.17.11 → alibuild-1.17.12}/alibuild_helpers/utilities.py +31 -29
- {alibuild-1.17.11 → alibuild-1.17.12}/alibuild_helpers/workarea.py +1 -4
- {alibuild-1.17.11 → alibuild-1.17.12}/docs/mkdocs.yml +1 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/setup.py +0 -2
- alibuild-1.17.12/templates/alibuild_to_please.jnj +63 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/tests/test_args.py +4 -12
- {alibuild-1.17.11 → alibuild-1.17.12}/tests/test_build.py +6 -14
- {alibuild-1.17.11 → alibuild-1.17.12}/tests/test_clean.py +1 -4
- {alibuild-1.17.11 → alibuild-1.17.12}/tests/test_cmd.py +1 -4
- {alibuild-1.17.11 → alibuild-1.17.12}/tests/test_deps.py +2 -10
- {alibuild-1.17.11 → alibuild-1.17.12}/tests/test_doctor.py +2 -10
- {alibuild-1.17.11 → alibuild-1.17.12}/tests/test_hashing.py +1 -4
- {alibuild-1.17.11 → alibuild-1.17.12}/tests/test_init.py +3 -10
- {alibuild-1.17.11 → alibuild-1.17.12}/tests/test_log.py +1 -4
- {alibuild-1.17.11 → alibuild-1.17.12}/tests/test_packagelist.py +9 -8
- {alibuild-1.17.11 → alibuild-1.17.12}/tests/test_parseRecipe.py +2 -6
- {alibuild-1.17.11 → alibuild-1.17.12}/tests/test_sync.py +1 -4
- {alibuild-1.17.11 → alibuild-1.17.12}/tests/test_utilities.py +1 -4
- {alibuild-1.17.11 → alibuild-1.17.12}/tests/test_workarea.py +2 -8
- {alibuild-1.17.11 → alibuild-1.17.12}/tox.ini +0 -8
- alibuild-1.17.11/Jenkinsfile +0 -99
- {alibuild-1.17.11 → alibuild-1.17.12}/.flake8 +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/.github/workflows/documentation.yml +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/.github/workflows/pr-check.yml +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/.github/workflows/release.yml +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/.gitignore +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/.pylintrc +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/ANALYTICS.md +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/DESIGN.md +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/LICENSE.md +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/MANIFEST.in +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/PACKAGING.md +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/README.rst +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/aliDeps +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/aliDoctor +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/alibuild.egg-info/dependency_links.txt +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/alibuild.egg-info/requires.txt +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/alibuild.egg-info/top_level.txt +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/alibuild_helpers/__init__.py +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/alibuild_helpers/build_template.sh +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/alibuild_helpers/clean.py +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/alibuild_helpers/deps.py +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/alibuild_helpers/doctor.py +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/alibuild_helpers/init.py +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/alibuild_helpers/log.py +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/alibuild_helpers/sl.py +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/alibuild_helpers/templating_plugin.py +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/alienv +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/codecov.yml +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/debian/changelog +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/debian/compat +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/debian/control +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/debian/copyright +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/debian/files +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/debian/rules +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/docs/README.md +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/docs/SUPPORT +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/docs/docs/alice_logo.png +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/docs/docs/deps.png +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/docs/docs/index.md +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/docs/docs/quick.md +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/docs/docs/reference.md +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/docs/docs/stylesheets/extra.css +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/docs/docs/troubleshooting.md +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/docs/docs/user.md +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/pb +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/pyproject.toml +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/requirements.txt +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/setup.cfg +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/tests/test_analytics.py +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/tests/test_git.py +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/tests/testdist/broken1.sh +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/tests/testdist/broken2.sh +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/tests/testdist/broken3.sh +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/tests/testdist/broken4.sh +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/tests/testdist/broken5.sh +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/tests/testdist/broken6.sh +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/tests/testdist/broken7.sh +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/tests/testdist/clobber-initdotsh.sh +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/tests/testdist/defaults-o2.sh +0 -0
- {alibuild-1.17.11 → alibuild-1.17.12}/tests/testdist/delete-etc.sh +0 -0
|
@@ -15,7 +15,7 @@ from alibuild_helpers.init import doInit
|
|
|
15
15
|
from alibuild_helpers.clean import doClean
|
|
16
16
|
from alibuild_helpers.doctor import doDoctor
|
|
17
17
|
from alibuild_helpers.deps import doDeps
|
|
18
|
-
from alibuild_helpers.log import info,
|
|
18
|
+
from alibuild_helpers.log import info, debug, logger, error
|
|
19
19
|
from alibuild_helpers.utilities import detectArch
|
|
20
20
|
from alibuild_helpers.build import doBuild
|
|
21
21
|
|
|
@@ -40,7 +40,6 @@ def doMain(args, parser):
|
|
|
40
40
|
"LC_MONETARY": "C",
|
|
41
41
|
"LC_NUMERIC": "C",
|
|
42
42
|
"LC_TIME": "C",
|
|
43
|
-
"LC_ALL": "C",
|
|
44
43
|
"GREP_OPTIONS": "",
|
|
45
44
|
"BASH_ENV": "",
|
|
46
45
|
"ALIBUILD_ARCHITECTURE": args.architecture
|
|
@@ -116,10 +115,7 @@ if __name__ == "__main__":
|
|
|
116
115
|
if profiler:
|
|
117
116
|
print("profiler started")
|
|
118
117
|
import cProfile, pstats
|
|
119
|
-
|
|
120
|
-
from StringIO import StringIO
|
|
121
|
-
except ImportError:
|
|
122
|
-
from io import StringIO
|
|
118
|
+
from io import StringIO
|
|
123
119
|
pr = cProfile.Profile()
|
|
124
120
|
pr.enable()
|
|
125
121
|
def profiler():
|
|
@@ -15,7 +15,7 @@ from alibuild_helpers.init import doInit
|
|
|
15
15
|
from alibuild_helpers.clean import doClean
|
|
16
16
|
from alibuild_helpers.doctor import doDoctor
|
|
17
17
|
from alibuild_helpers.deps import doDeps
|
|
18
|
-
from alibuild_helpers.log import info,
|
|
18
|
+
from alibuild_helpers.log import info, debug, logger, error
|
|
19
19
|
from alibuild_helpers.utilities import detectArch
|
|
20
20
|
from alibuild_helpers.build import doBuild
|
|
21
21
|
|
|
@@ -40,7 +40,6 @@ def doMain(args, parser):
|
|
|
40
40
|
"LC_MONETARY": "C",
|
|
41
41
|
"LC_NUMERIC": "C",
|
|
42
42
|
"LC_TIME": "C",
|
|
43
|
-
"LC_ALL": "C",
|
|
44
43
|
"GREP_OPTIONS": "",
|
|
45
44
|
"BASH_ENV": "",
|
|
46
45
|
"ALIBUILD_ARCHITECTURE": args.architecture
|
|
@@ -116,10 +115,7 @@ if __name__ == "__main__":
|
|
|
116
115
|
if profiler:
|
|
117
116
|
print("profiler started")
|
|
118
117
|
import cProfile, pstats
|
|
119
|
-
|
|
120
|
-
from StringIO import StringIO
|
|
121
|
-
except ImportError:
|
|
122
|
-
from io import StringIO
|
|
118
|
+
from io import StringIO
|
|
123
119
|
pr = cProfile.Profile()
|
|
124
120
|
pr.enable()
|
|
125
121
|
def profiler():
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
.pylintrc
|
|
4
4
|
ANALYTICS.md
|
|
5
5
|
DESIGN.md
|
|
6
|
-
Jenkinsfile
|
|
7
6
|
LICENSE.md
|
|
8
7
|
MANIFEST.in
|
|
9
8
|
PACKAGING.md
|
|
@@ -63,6 +62,7 @@ docs/docs/reference.md
|
|
|
63
62
|
docs/docs/troubleshooting.md
|
|
64
63
|
docs/docs/user.md
|
|
65
64
|
docs/docs/stylesheets/extra.css
|
|
65
|
+
templates/alibuild_to_please.jnj
|
|
66
66
|
tests/test_analytics.py
|
|
67
67
|
tests/test_args.py
|
|
68
68
|
tests/test_build.py
|
|
@@ -22,10 +22,7 @@ def askForAnalytics():
|
|
|
22
22
|
banner("In order to improve user experience, aliBuild would like to gather "
|
|
23
23
|
"analytics about your builds.\nYou can find all the details at:\n\n"
|
|
24
24
|
" https://github.com/alisw/alibuild/blob/master/ANALYTICS.md\n")
|
|
25
|
-
|
|
26
|
-
try: _input = raw_input
|
|
27
|
-
except NameError: _input = input
|
|
28
|
-
a = _input("Is that ok for you [YES/no]? ")
|
|
25
|
+
a = input("Is that ok for you [YES/no]? ")
|
|
29
26
|
if a.strip() and a.strip().lower().startswith("n"):
|
|
30
27
|
debug("User requsted disabling analytics.")
|
|
31
28
|
return disable_analytics()
|
|
@@ -7,10 +7,7 @@ import re
|
|
|
7
7
|
import os
|
|
8
8
|
import shlex
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
import commands
|
|
12
|
-
except ImportError:
|
|
13
|
-
import subprocess as commands
|
|
10
|
+
import subprocess as commands
|
|
14
11
|
from os.path import abspath, dirname, basename
|
|
15
12
|
import sys
|
|
16
13
|
|
|
@@ -110,6 +107,8 @@ def doParseArgs():
|
|
|
110
107
|
"in multiple packages. The comment will only be stored if "
|
|
111
108
|
"PACKAGE is compiled or downloaded during this run; if it "
|
|
112
109
|
"already exists, this does not happen."))
|
|
110
|
+
build_parser.add_argument("--only-deps", dest="onlyDeps", default=False, action="store_true",
|
|
111
|
+
help="Only build dependencies, not the main package (e.g. for caching)")
|
|
113
112
|
|
|
114
113
|
build_docker = build_parser.add_argument_group(title="Build inside a container", description="""\
|
|
115
114
|
Builds can be done inside a Docker container, to make it easier to get a
|
|
@@ -17,19 +17,12 @@ from alibuild_helpers.git import Git, git
|
|
|
17
17
|
from alibuild_helpers.sl import Sapling
|
|
18
18
|
from alibuild_helpers.scm import SCMError
|
|
19
19
|
from alibuild_helpers.sync import remote_from_url
|
|
20
|
-
import yaml
|
|
21
20
|
from alibuild_helpers.workarea import logged_scm, updateReferenceRepoSpec, checkout_sources
|
|
22
21
|
from alibuild_helpers.log import ProgressPrint, log_current_package
|
|
23
22
|
from glob import glob
|
|
24
23
|
from textwrap import dedent
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
except ImportError:
|
|
28
|
-
from ordereddict import OrderedDict
|
|
29
|
-
try:
|
|
30
|
-
from shlex import quote # Python 3.3+
|
|
31
|
-
except ImportError:
|
|
32
|
-
from pipes import quote # Python 2.7
|
|
24
|
+
from collections import OrderedDict
|
|
25
|
+
from shlex import quote
|
|
33
26
|
|
|
34
27
|
import concurrent.futures
|
|
35
28
|
import importlib
|
|
@@ -193,10 +186,7 @@ def storeHashes(package, specs, considerRelocation):
|
|
|
193
186
|
hasher(data)
|
|
194
187
|
|
|
195
188
|
for key in ("env", "append_path", "prepend_path"):
|
|
196
|
-
if
|
|
197
|
-
# Python 2: use YAML dict order to prevent changing hashes
|
|
198
|
-
h_all(str(yaml.safe_load(yamlDump(spec[key]))))
|
|
199
|
-
elif key not in spec:
|
|
189
|
+
if key not in spec:
|
|
200
190
|
h_all("none")
|
|
201
191
|
else:
|
|
202
192
|
# spec["env"] is of type OrderedDict[str, str].
|
|
@@ -486,7 +476,7 @@ def doBuild(args, parser):
|
|
|
486
476
|
checkedOutCommitName = scm.checkedOutCommitName(directory=args.configDir)
|
|
487
477
|
except SCMError:
|
|
488
478
|
dieOnError(True, "Cannot find SCM directory in %s." % args.configDir)
|
|
489
|
-
os.environ["ALIBUILD_ALIDIST_HASH"] = checkedOutCommitName
|
|
479
|
+
os.environ["ALIBUILD_ALIDIST_HASH"] = checkedOutCommitName # type: ignore
|
|
490
480
|
|
|
491
481
|
debug("Building for architecture %s", args.architecture)
|
|
492
482
|
debug("Number of parallel builds: %d", args.jobs)
|
|
@@ -550,9 +540,17 @@ def doBuild(args, parser):
|
|
|
550
540
|
del develCandidates, develCandidatesUpper, develPkgsUpper
|
|
551
541
|
|
|
552
542
|
if buildOrder:
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
543
|
+
if args.onlyDeps:
|
|
544
|
+
builtPackages = buildOrder[:-1]
|
|
545
|
+
else:
|
|
546
|
+
builtPackages = buildOrder
|
|
547
|
+
if len(builtPackages) > 1:
|
|
548
|
+
banner("Packages will be built in the following order:\n - %s",
|
|
549
|
+
"\n - ".join(x+" (development package)" if x in develPkgs else "%s@%s" % (x, specs[x]["tag"])
|
|
550
|
+
for x in builtPackages if x != "defaults-release"))
|
|
551
|
+
else:
|
|
552
|
+
banner("No dependencies of package %s to build.", buildOrder[-1])
|
|
553
|
+
|
|
556
554
|
|
|
557
555
|
if develPkgs:
|
|
558
556
|
banner("You have packages in development mode (%s).\n"
|
|
@@ -703,6 +701,12 @@ def doBuild(args, parser):
|
|
|
703
701
|
deps=",".join(buildOrder[:-1]),
|
|
704
702
|
), args.architecture)
|
|
705
703
|
|
|
704
|
+
# If we are building only the dependencies, the last package in
|
|
705
|
+
# the build order can be considered done.
|
|
706
|
+
if args.onlyDeps and len(buildOrder) > 1:
|
|
707
|
+
mainPackage = buildOrder.pop()
|
|
708
|
+
warning("Not rebuilding %s because --only-deps option provided.", mainPackage)
|
|
709
|
+
|
|
706
710
|
while buildOrder:
|
|
707
711
|
p = buildOrder[0]
|
|
708
712
|
spec = specs[p]
|
|
@@ -1122,14 +1126,19 @@ def doBuild(args, parser):
|
|
|
1122
1126
|
if not spec["revision"].startswith("local"):
|
|
1123
1127
|
syncHelper.upload_symlinks_and_tarball(spec)
|
|
1124
1128
|
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1129
|
+
if not args.onlyDeps:
|
|
1130
|
+
banner("Build of %s successfully completed on `%s'.\n"
|
|
1131
|
+
"Your software installation is at:"
|
|
1132
|
+
"\n\n %s\n\n"
|
|
1133
|
+
"You can use this package by loading the environment:"
|
|
1134
|
+
"\n\n alienv enter %s/latest-%s",
|
|
1135
|
+
mainPackage, socket.gethostname(),
|
|
1136
|
+
abspath(join(args.workDir, args.architecture)),
|
|
1137
|
+
mainPackage, mainBuildFamily)
|
|
1138
|
+
else:
|
|
1139
|
+
banner("Successfully built dependencies for package %s on `%s'.\n",
|
|
1140
|
+
mainPackage, socket.gethostname()
|
|
1141
|
+
)
|
|
1133
1142
|
for spec in specs.values():
|
|
1134
1143
|
if spec["is_devel_pkg"]:
|
|
1135
1144
|
banner("Build directory for devel package %s:\n%s/BUILD/%s-latest%s/%s",
|
|
@@ -1,68 +1,37 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import os.path
|
|
3
|
-
import sys
|
|
4
3
|
import time
|
|
5
4
|
from subprocess import Popen, PIPE, STDOUT
|
|
6
5
|
from textwrap import dedent
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
except ImportError:
|
|
10
|
-
class TimeoutExpired(Exception):
|
|
11
|
-
"""Stub exception for Python 2."""
|
|
12
|
-
try:
|
|
13
|
-
from shlex import quote # Python 3.3+
|
|
14
|
-
except ImportError:
|
|
15
|
-
from pipes import quote # Python 2.7
|
|
6
|
+
from subprocess import TimeoutExpired
|
|
7
|
+
from shlex import quote
|
|
16
8
|
|
|
17
9
|
from alibuild_helpers.log import debug, warning, dieOnError
|
|
18
10
|
|
|
19
|
-
# Keep the linter happy
|
|
20
|
-
if sys.version_info[0] >= 3:
|
|
21
|
-
basestring = str
|
|
22
|
-
unicode = None
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
def is_string(s):
|
|
26
|
-
if sys.version_info[0] >= 3:
|
|
27
|
-
return isinstance(s, str)
|
|
28
|
-
return isinstance(s, basestring)
|
|
29
|
-
|
|
30
|
-
|
|
31
11
|
def decode_with_fallback(data):
|
|
32
12
|
"""Try to decode DATA as utf-8; if that doesn't work, fall back to latin-1.
|
|
33
13
|
|
|
34
14
|
This combination should cover every possible byte string, as latin-1 covers
|
|
35
15
|
every possible single byte.
|
|
36
16
|
"""
|
|
37
|
-
if
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return str(data)
|
|
45
|
-
elif isinstance(data, str):
|
|
46
|
-
return unicode(data, "utf-8") # utf-8 is a safe assumption
|
|
47
|
-
elif not isinstance(data, unicode):
|
|
48
|
-
return unicode(str(data))
|
|
49
|
-
return data
|
|
17
|
+
if isinstance(data, bytes):
|
|
18
|
+
try:
|
|
19
|
+
return data.decode("utf-8")
|
|
20
|
+
except UnicodeDecodeError:
|
|
21
|
+
return data.decode("latin-1")
|
|
22
|
+
else:
|
|
23
|
+
return str(data)
|
|
50
24
|
|
|
51
25
|
|
|
52
26
|
def getoutput(command, timeout=None):
|
|
53
27
|
"""Run command, check it succeeded, and return its stdout as a string."""
|
|
54
|
-
proc = Popen(command, shell=
|
|
28
|
+
proc = Popen(command, shell=isinstance(command, str), stdout=PIPE, stderr=PIPE)
|
|
55
29
|
try:
|
|
56
30
|
stdout, stderr = proc.communicate(timeout=timeout)
|
|
57
31
|
except TimeoutExpired:
|
|
58
32
|
warning("Process %r timed out; terminated", command)
|
|
59
33
|
proc.terminate()
|
|
60
34
|
stdout, stderr = proc.communicate()
|
|
61
|
-
except TypeError:
|
|
62
|
-
# On Python 2, we don't have the timeout= parameter. However, "regular"
|
|
63
|
-
# users shouldn't be running under Python 2 any more, so just don't timeout
|
|
64
|
-
# there and let the admins handle it manually.
|
|
65
|
-
stdout, stderr = proc.communicate()
|
|
66
35
|
dieOnError(proc.returncode, "Command %s failed with code %d: %s" %
|
|
67
36
|
(command, proc.returncode, decode_with_fallback(stderr)))
|
|
68
37
|
return decode_with_fallback(stdout)
|
|
@@ -70,18 +39,13 @@ def getoutput(command, timeout=None):
|
|
|
70
39
|
|
|
71
40
|
def getstatusoutput(command, timeout=None):
|
|
72
41
|
"""Run command and return its return code and output (stdout and stderr)."""
|
|
73
|
-
proc = Popen(command, shell=
|
|
42
|
+
proc = Popen(command, shell=isinstance(command, str), stdout=PIPE, stderr=STDOUT)
|
|
74
43
|
try:
|
|
75
44
|
merged_output, _ = proc.communicate(timeout=timeout)
|
|
76
45
|
except TimeoutExpired:
|
|
77
46
|
warning("Process %r timed out; terminated", command)
|
|
78
47
|
proc.terminate()
|
|
79
48
|
merged_output, _ = proc.communicate()
|
|
80
|
-
except TypeError:
|
|
81
|
-
# On Python 2, we don't have the timeout= parameter. However, "regular"
|
|
82
|
-
# users shouldn't be running under Python 2 any more, so just don't timeout
|
|
83
|
-
# there and let the admins handle it manually.
|
|
84
|
-
merged_output, _ = proc.communicate()
|
|
85
49
|
merged_output = decode_with_fallback(merged_output)
|
|
86
50
|
# Strip a single trailing newline, if one exists, to match the behaviour of
|
|
87
51
|
# subprocess.getstatusoutput.
|
|
@@ -91,7 +55,7 @@ def getstatusoutput(command, timeout=None):
|
|
|
91
55
|
|
|
92
56
|
|
|
93
57
|
def execute(command, printer=debug, timeout=None):
|
|
94
|
-
popen = Popen(command, shell=
|
|
58
|
+
popen = Popen(command, shell=isinstance(command, str), stdout=PIPE, stderr=STDOUT)
|
|
95
59
|
start_time = time.time()
|
|
96
60
|
for line in iter(popen.stdout.readline, b""):
|
|
97
61
|
printer("%s", decode_with_fallback(line).strip("\n"))
|
|
@@ -46,8 +46,8 @@ class Git(SCM):
|
|
|
46
46
|
def listRefsCmd(self, repository):
|
|
47
47
|
return ["ls-remote", "--heads", "--tags", repository]
|
|
48
48
|
|
|
49
|
-
def cloneReferenceCmd(self,
|
|
50
|
-
cmd = ["clone", "--bare",
|
|
49
|
+
def cloneReferenceCmd(self, spec, referenceRepo, usePartialClone):
|
|
50
|
+
cmd = ["clone", "--bare", spec, referenceRepo]
|
|
51
51
|
if usePartialClone:
|
|
52
52
|
cmd.extend(clone_speedup_options())
|
|
53
53
|
return cmd
|
|
@@ -64,11 +64,11 @@ class Git(SCM):
|
|
|
64
64
|
cmd.extend(clone_speedup_options())
|
|
65
65
|
return cmd
|
|
66
66
|
|
|
67
|
-
def checkoutCmd(self,
|
|
68
|
-
return ["checkout", "-f",
|
|
67
|
+
def checkoutCmd(self, tag):
|
|
68
|
+
return ["checkout", "-f", tag]
|
|
69
69
|
|
|
70
|
-
def fetchCmd(self,
|
|
71
|
-
return ["fetch", "-f"] + clone_speedup_options() + [
|
|
70
|
+
def fetchCmd(self, remote, *refs):
|
|
71
|
+
return ["fetch", "-f"] + clone_speedup_options() + [remote, *refs]
|
|
72
72
|
|
|
73
73
|
def setWriteUrlCmd(self, url):
|
|
74
74
|
return ["remote", "set-url", "--push", "origin", url]
|
|
@@ -21,7 +21,7 @@ class SCM(object):
|
|
|
21
21
|
raise NotImplementedError
|
|
22
22
|
def cloneReferenceCmd(self, spec, referenceRepo, usePartialClone):
|
|
23
23
|
raise NotImplementedError
|
|
24
|
-
def cloneSourceCmd(self,
|
|
24
|
+
def cloneSourceCmd(self, source, destination, referenceRepo, usePartialClone):
|
|
25
25
|
raise NotImplementedError
|
|
26
26
|
def setWriteUrlCmd(self, url):
|
|
27
27
|
raise NotImplementedError
|
|
@@ -373,7 +373,7 @@ class CVMFSRemoteSync:
|
|
|
373
373
|
))
|
|
374
374
|
|
|
375
375
|
def upload_symlinks_and_tarball(self, spec):
|
|
376
|
-
dieOnError(
|
|
376
|
+
dieOnError(True, "CVMFS backend does not support uploading directly")
|
|
377
377
|
|
|
378
378
|
class S3RemoteSync:
|
|
379
379
|
"""Sync package build directory from and to S3 using s3cmd.
|
|
@@ -10,14 +10,8 @@ import re
|
|
|
10
10
|
import platform
|
|
11
11
|
|
|
12
12
|
from datetime import datetime
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
except ImportError:
|
|
16
|
-
from ordereddict import OrderedDict
|
|
17
|
-
try:
|
|
18
|
-
from shlex import quote # Python 3.3+
|
|
19
|
-
except ImportError:
|
|
20
|
-
from pipes import quote # Python 2.7
|
|
13
|
+
from collections import OrderedDict
|
|
14
|
+
from shlex import quote
|
|
21
15
|
|
|
22
16
|
from alibuild_helpers.cmd import getoutput
|
|
23
17
|
from alibuild_helpers.git import git
|
|
@@ -430,6 +424,10 @@ def getPackageList(packages, specs, configDir, preferSystem, noSystem,
|
|
|
430
424
|
filename = taps.get(pkg_filename, "%s/%s.sh" % (configDir, pkg_filename))
|
|
431
425
|
err, spec, recipe = parseRecipe(getRecipeReader(filename, configDir))
|
|
432
426
|
dieOnError(err, err)
|
|
427
|
+
# Unless there was an error, both spec and recipe should be valid.
|
|
428
|
+
# otherwise the error should have been caught above.
|
|
429
|
+
assert(spec is not None)
|
|
430
|
+
assert(recipe is not None)
|
|
433
431
|
dieOnError(spec["package"].lower() != pkg_filename,
|
|
434
432
|
"%s.sh has different package field: %s" % (p, spec["package"]))
|
|
435
433
|
|
|
@@ -490,28 +488,32 @@ def getPackageList(packages, specs, configDir, preferSystem, noSystem,
|
|
|
490
488
|
else:
|
|
491
489
|
# The check printed the name of a replacement; use it.
|
|
492
490
|
key = match.group("key").strip()
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
491
|
+
replacement = None
|
|
492
|
+
for replacement_matcher in spec["prefer_system_replacement_specs"]:
|
|
493
|
+
if re.match(replacement_matcher, key):
|
|
494
|
+
replacement = spec["prefer_system_replacement_specs"][replacement_matcher]
|
|
495
|
+
break
|
|
496
|
+
dieOnError(replacement is None, "Could not find named replacement spec for "
|
|
497
|
+
"%s: %s" % (spec["package"], key))
|
|
498
|
+
assert(replacement)
|
|
499
|
+
# We must keep the package name the same, since it is used to
|
|
500
|
+
# specify dependencies.
|
|
501
|
+
replacement["package"] = spec["package"]
|
|
502
|
+
# The version is required for all specs. What we put there will
|
|
503
|
+
# influence the package's hash, so allow the user to override it.
|
|
504
|
+
replacement.setdefault("version", requested_version)
|
|
505
|
+
spec = replacement
|
|
506
|
+
# Allows generalising the version based on the actual key provided
|
|
507
|
+
spec["version"] = spec["version"].replace("%(key)s", key)
|
|
508
|
+
recipe = replacement.get("recipe", "")
|
|
509
|
+
# If there's an explicitly-specified recipe, we're still building
|
|
510
|
+
# the package. If not, aliBuild will still "build" it, but it's
|
|
511
|
+
# basically instantaneous, so report to the user that we're taking
|
|
512
|
+
# it from the system.
|
|
513
|
+
if recipe:
|
|
514
|
+
ownPackages.add(spec["package"])
|
|
498
515
|
else:
|
|
499
|
-
|
|
500
|
-
# specify dependencies.
|
|
501
|
-
replacement["package"] = spec["package"]
|
|
502
|
-
# The version is required for all specs. What we put there will
|
|
503
|
-
# influence the package's hash, so allow the user to override it.
|
|
504
|
-
replacement.setdefault("version", requested_version)
|
|
505
|
-
spec = replacement
|
|
506
|
-
recipe = replacement.get("recipe", "")
|
|
507
|
-
# If there's an explicitly-specified recipe, we're still building
|
|
508
|
-
# the package. If not, aliBuild will still "build" it, but it's
|
|
509
|
-
# basically instantaneous, so report to the user that we're taking
|
|
510
|
-
# it from the system.
|
|
511
|
-
if recipe:
|
|
512
|
-
ownPackages.add(spec["package"])
|
|
513
|
-
else:
|
|
514
|
-
systemPackages.add(spec["package"])
|
|
516
|
+
systemPackages.add(spec["package"])
|
|
515
517
|
|
|
516
518
|
dieOnError(("system_requirement" in spec) and recipe.strip("\n\t "),
|
|
517
519
|
"System requirements %s cannot have a recipe" % spec["package"])
|
|
@@ -4,10 +4,7 @@ import os
|
|
|
4
4
|
import os.path
|
|
5
5
|
import shutil
|
|
6
6
|
import tempfile
|
|
7
|
-
|
|
8
|
-
from collections import OrderedDict
|
|
9
|
-
except ImportError:
|
|
10
|
-
from ordereddict import OrderedDict
|
|
7
|
+
from collections import OrderedDict
|
|
11
8
|
|
|
12
9
|
from alibuild_helpers.log import dieOnError, debug, error
|
|
13
10
|
from alibuild_helpers.utilities import call_ignoring_oserrors, symlink, short_commit_hash
|
|
@@ -76,8 +76,6 @@ setup(
|
|
|
76
76
|
# aliBuild was built from.
|
|
77
77
|
use_scm_version={'write_to': 'alibuild_helpers/_version.py'},
|
|
78
78
|
setup_requires=[
|
|
79
|
-
# The 6.* series removed support for Python 2.7.
|
|
80
|
-
'setuptools_scm<6.0.0' if sys.version_info < (3, 0) else
|
|
81
79
|
# The 7.* series removed support for Python 3.6.
|
|
82
80
|
'setuptools_scm<7.0.0' if sys.version_info < (3, 7) else
|
|
83
81
|
'setuptools_scm'
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# A alibuild template to convert the alidist recipes to
|
|
2
|
+
# the please build system. While not fully functional, it serves
|
|
3
|
+
# as explanatory example on how one can use templates to
|
|
4
|
+
# extract informations from alidist, without having to instrument
|
|
5
|
+
# alibuild itself.
|
|
6
|
+
#
|
|
7
|
+
# Use with:
|
|
8
|
+
#
|
|
9
|
+
# cat alibuild_to_please.jnj | python3 alibuild/aliBuild build lz4 --defaults o2 --debug --no-system --plugin templating --no-system --no-local alibuild-recipe-tools > opendata/BUILD.plz
|
|
10
|
+
#
|
|
11
|
+
{% for name, spec in specs.items() %}
|
|
12
|
+
|
|
13
|
+
{% if spec.source is defined %}
|
|
14
|
+
# {{ spec.source is defined }}
|
|
15
|
+
new_http_archive(
|
|
16
|
+
name = "download_{{name}}",
|
|
17
|
+
urls = ["{{spec.source}}/archive/refs/tags/{{spec.tag}}.tar.gz"],
|
|
18
|
+
)
|
|
19
|
+
{% endif %}
|
|
20
|
+
|
|
21
|
+
genrule(
|
|
22
|
+
name = "build_{{name}}",
|
|
23
|
+
output_dirs = ["_out"],
|
|
24
|
+
outs = [
|
|
25
|
+
{% if spec.tools is defined %}
|
|
26
|
+
{% for tool in spec.tools%}
|
|
27
|
+
"_out/{{tool}}",
|
|
28
|
+
{% endfor %}
|
|
29
|
+
{% endif %}
|
|
30
|
+
{% if spec.tools is defined %}
|
|
31
|
+
{% for lib in spec.libs%}
|
|
32
|
+
"_out/{{lib}}",
|
|
33
|
+
{% endfor %}
|
|
34
|
+
{% endif %}
|
|
35
|
+
],
|
|
36
|
+
{% if spec.source is defined %}
|
|
37
|
+
srcs = [":download_{{name}}"],
|
|
38
|
+
{% endif %}
|
|
39
|
+
deps = [
|
|
40
|
+
{% for build_require_name in spec.build_requires %}
|
|
41
|
+
":build_{{build_require_name}}",{% endfor %}
|
|
42
|
+
],
|
|
43
|
+
cmd = """
|
|
44
|
+
PKGNAME="{{name}}"
|
|
45
|
+
PKGVERSION="{{spec.version}}"
|
|
46
|
+
PKGREVISION="{{spec.revision}}"
|
|
47
|
+
PKGHASH="{{spec.package_hash}}"
|
|
48
|
+
{% if spec.source is defined %}
|
|
49
|
+
SOURCEDIR="$PWD/$SRCS/*"
|
|
50
|
+
{% endif %}
|
|
51
|
+
INSTALLROOT="$PWD/_out"
|
|
52
|
+
BUILDDIR="$PWD/_build"
|
|
53
|
+
JOBS="10"
|
|
54
|
+
mkdir -p $BUILDDIR
|
|
55
|
+
pushd $BUILDDIR
|
|
56
|
+
set -e
|
|
57
|
+
{{ spec.recipe | replace('\$', '\\\\\\\\$')}}
|
|
58
|
+
mkdir -p $INSTALLROOT
|
|
59
|
+
touch $INSTALLROOT/.please-did-build
|
|
60
|
+
popd
|
|
61
|
+
""",
|
|
62
|
+
)
|
|
63
|
+
{% endfor %}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
from __future__ import print_function
|
|
2
2
|
# Assuming you are using the mock library to ... mock things
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
from unittest.mock import patch, call # In Python 3, mock is built-in
|
|
6
|
-
except ImportError:
|
|
7
|
-
import mock
|
|
8
|
-
from mock import patch, call # Python 2
|
|
3
|
+
from unittest import mock
|
|
4
|
+
from unittest.mock import patch, call
|
|
9
5
|
|
|
10
6
|
import alibuild_helpers.args
|
|
11
7
|
from alibuild_helpers.args import doParseArgs, matchValidArch, finaliseArgs, DEFAULT_WORK_DIR, DEFAULT_CHDIR, ARCHITECTURE_TABLE
|
|
@@ -16,12 +12,8 @@ import os.path
|
|
|
16
12
|
import unittest
|
|
17
13
|
import shlex
|
|
18
14
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
ANALYTICS_MISSING_STATE_ERROR = "the following arguments are required: state"
|
|
22
|
-
else:
|
|
23
|
-
BUILD_MISSING_PKG_ERROR = "too few arguments"
|
|
24
|
-
ANALYTICS_MISSING_STATE_ERROR = "too few arguments"
|
|
15
|
+
BUILD_MISSING_PKG_ERROR = "the following arguments are required: PACKAGE"
|
|
16
|
+
ANALYTICS_MISSING_STATE_ERROR = "the following arguments are required: state"
|
|
25
17
|
|
|
26
18
|
# A few errors we should handle, together with the expected result
|
|
27
19
|
ARCHITECTURE_ERROR = [call(u"Unknown / unsupported architecture: foo.\n\n{table}Alternatively, you can use the `--force-unknown-architecture' option.".format(table=ARCHITECTURE_TABLE))]
|
|
@@ -6,16 +6,9 @@ import re
|
|
|
6
6
|
import sys
|
|
7
7
|
import unittest
|
|
8
8
|
# Assuming you are using the mock library to ... mock things
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
except ImportError:
|
|
13
|
-
from mock import call, patch, MagicMock, DEFAULT # Python 2
|
|
14
|
-
from StringIO import StringIO
|
|
15
|
-
try:
|
|
16
|
-
from collections import OrderedDict
|
|
17
|
-
except ImportError:
|
|
18
|
-
from ordereddict import OrderedDict
|
|
9
|
+
from unittest.mock import call, patch, MagicMock, DEFAULT
|
|
10
|
+
from io import StringIO
|
|
11
|
+
from collections import OrderedDict
|
|
19
12
|
|
|
20
13
|
from alibuild_helpers.utilities import parseRecipe, resolve_tag
|
|
21
14
|
from alibuild_helpers.build import doBuild, storeHashes, generate_initdotsh
|
|
@@ -79,8 +72,7 @@ TEST_ROOT_GIT_REFS = """\
|
|
|
79
72
|
87b87c4322d2a3fad315c919cb2e2dd73f2154dc\trefs/heads/master
|
|
80
73
|
f7b336611753f1f4aaa94222b0d620748ae230c0\trefs/heads/v6-08-00-patches
|
|
81
74
|
f7b336611753f1f4aaa94222b0d620748ae230c0\trefs/tags/test-tag"""
|
|
82
|
-
TEST_ROOT_BUILD_HASH = ("
|
|
83
|
-
"8ec3f41b6b585ef86a02e9c595eed67f34d63f08")
|
|
75
|
+
TEST_ROOT_BUILD_HASH = ("8ec3f41b6b585ef86a02e9c595eed67f34d63f08")
|
|
84
76
|
|
|
85
77
|
|
|
86
78
|
TEST_EXTRA_RECIPE = """\
|
|
@@ -97,8 +89,7 @@ f000\trefs/heads/master
|
|
|
97
89
|
ba22\trefs/tags/v1
|
|
98
90
|
ba22\trefs/tags/v2
|
|
99
91
|
baad\trefs/tags/v3"""
|
|
100
|
-
TEST_EXTRA_BUILD_HASH = ("
|
|
101
|
-
"5afae57bfc6a374e74c1c4427698ab5edebce0bc")
|
|
92
|
+
TEST_EXTRA_BUILD_HASH = ("5afae57bfc6a374e74c1c4427698ab5edebce0bc")
|
|
102
93
|
|
|
103
94
|
|
|
104
95
|
GIT_CLONE_REF_ZLIB_ARGS = ("clone", "--bare", "https://github.com/star-externals/zlib",
|
|
@@ -285,6 +276,7 @@ class BuildTestCase(unittest.TestCase):
|
|
|
285
276
|
environment={},
|
|
286
277
|
autoCleanup=False,
|
|
287
278
|
noDevel=[],
|
|
279
|
+
onlyDeps=False,
|
|
288
280
|
fetchRepos=False,
|
|
289
281
|
forceTracked=False,
|
|
290
282
|
plugin="legacy"
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
from __future__ import print_function
|
|
2
2
|
from textwrap import dedent
|
|
3
3
|
# Assuming you are using the mock library to ... mock things
|
|
4
|
-
|
|
5
|
-
from unittest.mock import patch, call # In Python 3, mock is built-in
|
|
6
|
-
except ImportError:
|
|
7
|
-
from mock import patch, call # Python 2
|
|
4
|
+
from unittest.mock import patch, call
|
|
8
5
|
|
|
9
6
|
from alibuild_helpers.clean import decideClean, doClean
|
|
10
7
|
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
from __future__ import print_function
|
|
2
2
|
# Assuming you are using the mock library to ... mock things
|
|
3
|
-
|
|
4
|
-
from unittest import mock # In Python 3, mock is built-in
|
|
5
|
-
except ImportError:
|
|
6
|
-
import mock # Python 2
|
|
3
|
+
from unittest import mock
|
|
7
4
|
|
|
8
5
|
from alibuild_helpers.cmd import execute, DockerRunner
|
|
9
6
|
|
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
from io import StringIO
|
|
4
|
-
except ImportError:
|
|
5
|
-
from mock import patch, call, MagicMock # Python 2
|
|
6
|
-
from StringIO import StringIO
|
|
7
|
-
try:
|
|
8
|
-
from collections import OrderedDict
|
|
9
|
-
except ImportError:
|
|
10
|
-
from ordereddict import OrderedDict
|
|
1
|
+
from unittest.mock import patch, MagicMock
|
|
2
|
+
from io import StringIO
|
|
11
3
|
|
|
12
4
|
from alibuild_helpers.deps import doDeps
|
|
13
5
|
from argparse import Namespace
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
from __future__ import print_function
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
from io import StringIO
|
|
5
|
-
except ImportError:
|
|
6
|
-
from mock import patch, call, MagicMock # Python 2
|
|
7
|
-
from StringIO import StringIO
|
|
8
|
-
try:
|
|
9
|
-
from collections import OrderedDict
|
|
10
|
-
except ImportError:
|
|
11
|
-
from ordereddict import OrderedDict
|
|
2
|
+
from unittest.mock import patch, MagicMock
|
|
3
|
+
from io import StringIO
|
|
12
4
|
|
|
13
5
|
from alibuild_helpers.doctor import doDoctor
|
|
14
6
|
from argparse import Namespace
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
from argparse import Namespace
|
|
2
2
|
import os.path as path
|
|
3
3
|
import unittest
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
except ImportError:
|
|
8
|
-
from mock import MagicMock, call, patch # Python 2
|
|
9
|
-
from StringIO import StringIO
|
|
10
|
-
try:
|
|
11
|
-
from collections import OrderedDict
|
|
12
|
-
except ImportError:
|
|
13
|
-
from ordereddict import OrderedDict
|
|
4
|
+
from unittest.mock import call, patch # In Python 3, mock is built-in
|
|
5
|
+
from io import StringIO
|
|
6
|
+
from collections import OrderedDict
|
|
14
7
|
|
|
15
8
|
from alibuild_helpers.init import doInit, parsePackagesDefinition
|
|
16
9
|
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import unittest
|
|
2
|
-
|
|
3
|
-
from unittest.mock import MagicMock, patch # In Python 3, mock is built-in
|
|
4
|
-
except ImportError:
|
|
5
|
-
from mock import MagicMock, patch # Python 2
|
|
2
|
+
from unittest.mock import MagicMock, patch
|
|
6
3
|
|
|
7
4
|
from alibuild_helpers.log import dieOnError, ProgressPrint
|
|
8
5
|
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
from __future__ import print_function
|
|
2
2
|
from textwrap import dedent
|
|
3
3
|
import unittest
|
|
4
|
-
|
|
5
|
-
from unittest import mock
|
|
6
|
-
except ImportError: # Python 2
|
|
7
|
-
import mock
|
|
4
|
+
from unittest import mock
|
|
8
5
|
|
|
9
6
|
from alibuild_helpers.cmd import getstatusoutput
|
|
10
7
|
from alibuild_helpers.utilities import getPackageList
|
|
@@ -160,10 +157,14 @@ class ReplacementTestCase(unittest.TestCase):
|
|
|
160
157
|
@mock.patch("alibuild_helpers.utilities.dieOnError")
|
|
161
158
|
def test_missing_replacement_spec(self, mock_dieOnError):
|
|
162
159
|
"""Check an error is thrown when the replacement spec is not found."""
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
160
|
+
assert_msg = "Could not find named replacement spec for missing-spec: missing_tag"
|
|
161
|
+
# Change the behaviour from sys.exit to a regular exception. Without it
|
|
162
|
+
# we don't stop execution properly and other asserts might trigger
|
|
163
|
+
mock_dieOnError.side_effect = lambda cond, _: (_ for _ in ()).throw(Exception("dieOnError called")) if cond else None
|
|
164
|
+
with self.assertRaises(Exception, msg=assert_msg) as context:
|
|
165
|
+
specs, systemPkgs, ownPkgs, failedReqs, validDefaults = \
|
|
166
|
+
getPackageListWithDefaults(["missing-spec"])
|
|
167
|
+
self.assertEqual(str(context.exception), "dieOnError called", msg=assert_msg)
|
|
167
168
|
|
|
168
169
|
|
|
169
170
|
@mock.patch("alibuild_helpers.utilities.getRecipeReader", new=MockReader)
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import unittest
|
|
2
|
-
import platform
|
|
3
2
|
from alibuild_helpers.utilities import parseRecipe, getRecipeReader, parseDefaults
|
|
4
3
|
from alibuild_helpers.utilities import FileReader, GitReader
|
|
5
|
-
from alibuild_helpers.utilities import validateDefaults
|
|
6
|
-
|
|
7
|
-
from collections import OrderedDict
|
|
8
|
-
except ImportError:
|
|
9
|
-
from ordereddict import OrderedDict
|
|
4
|
+
from alibuild_helpers.utilities import validateDefaults
|
|
5
|
+
from collections import OrderedDict
|
|
10
6
|
|
|
11
7
|
TEST1="""package: foo
|
|
12
8
|
version: bar
|
|
@@ -4,10 +4,7 @@ import sys
|
|
|
4
4
|
import unittest
|
|
5
5
|
from io import BytesIO
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
from unittest.mock import patch, MagicMock # In Python 3, mock is built-in
|
|
9
|
-
except ImportError:
|
|
10
|
-
from mock import patch, MagicMock # Python 2
|
|
7
|
+
from unittest.mock import patch, MagicMock
|
|
11
8
|
|
|
12
9
|
from alibuild_helpers import sync
|
|
13
10
|
from alibuild_helpers.utilities import resolve_links_path, resolve_store_path
|
|
@@ -3,10 +3,7 @@
|
|
|
3
3
|
import unittest
|
|
4
4
|
|
|
5
5
|
# Assuming you are using the mock library to ... mock things
|
|
6
|
-
|
|
7
|
-
from unittest.mock import patch # In Python 3, mock is built-in
|
|
8
|
-
except ImportError:
|
|
9
|
-
from mock import patch # Python 2
|
|
6
|
+
from unittest.mock import patch
|
|
10
7
|
|
|
11
8
|
from alibuild_helpers.utilities import doDetectArch, filterByArchitecture
|
|
12
9
|
from alibuild_helpers.utilities import Hasher
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
from os import getcwd
|
|
2
2
|
import unittest
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
except ImportError:
|
|
6
|
-
from mock import patch, MagicMock # Python 2
|
|
7
|
-
try:
|
|
8
|
-
from collections import OrderedDict
|
|
9
|
-
except ImportError:
|
|
10
|
-
from ordereddict import OrderedDict
|
|
3
|
+
from unittest.mock import patch, MagicMock # In Python 3, mock is built-in
|
|
4
|
+
from collections import OrderedDict
|
|
11
5
|
|
|
12
6
|
from alibuild_helpers.workarea import updateReferenceRepoSpec
|
|
13
7
|
from alibuild_helpers.git import Git
|
|
@@ -5,7 +5,6 @@ envlist = lint, py{27, 36, 37, 38, 39, 310, 311, 312, 313}, darwin
|
|
|
5
5
|
[gh-actions]
|
|
6
6
|
# The "lint" job is run separately.
|
|
7
7
|
python =
|
|
8
|
-
2.7: py27
|
|
9
8
|
3.6: py36
|
|
10
9
|
3.7: py37
|
|
11
10
|
3.8: py38
|
|
@@ -45,19 +44,12 @@ allowlist_externals =
|
|
|
45
44
|
sl
|
|
46
45
|
rm
|
|
47
46
|
deps =
|
|
48
|
-
py27: mock
|
|
49
47
|
coverage
|
|
50
48
|
distro
|
|
51
49
|
|
|
52
50
|
setenv =
|
|
53
51
|
# `aliBuild analytics` puts preference files under $HOME.
|
|
54
52
|
HOME = {envtmpdir}
|
|
55
|
-
# On Python2, dictionary order depends on PYTHONHASHSEED, but we dump plain
|
|
56
|
-
# dictionaries (not OrderedDicts!) straight into the package hashing
|
|
57
|
-
# algorithm. Therefore, disable tox's hash seed randomisation on py27 to
|
|
58
|
-
# ensure our dicts always have the same order. See also:
|
|
59
|
-
# https://tox.wiki/en/latest/example/basic.html#special-handling-of-pythonhashseed
|
|
60
|
-
py27: PYTHONHASHSEED = 0
|
|
61
53
|
# Keep coverage info for later upload, if needed. Files in {envtmpdir} are
|
|
62
54
|
# deleted after each run.
|
|
63
55
|
COVERAGE_FILE = {toxworkdir}/coverage.{envname}
|
alibuild-1.17.11/Jenkinsfile
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
#!groovy
|
|
2
|
-
|
|
3
|
-
node {
|
|
4
|
-
stage "Verify author"
|
|
5
|
-
def power_users = ["ktf", "dberzano"]
|
|
6
|
-
echo "Changeset from " + env.CHANGE_AUTHOR
|
|
7
|
-
|
|
8
|
-
if (power_users.contains(env.CHANGE_AUTHOR)) {
|
|
9
|
-
echo "PR comes from power user. Testing"
|
|
10
|
-
slackSend channel: '#github',
|
|
11
|
-
color: 'good',
|
|
12
|
-
message: "Automatically testing new PR in Jenkins.\nhttps://alijenkins.cern.ch/job/alibuild-pipeline/branch/${env.BRANCH_NAME} for progress report.",
|
|
13
|
-
token: env.SLACK_TOKEN
|
|
14
|
-
} else {
|
|
15
|
-
withCredentials([[$class: 'StringBinding', credentialsId: 'SLACK_TOKEN', variable: 'SLACK_TOKEN']]) {
|
|
16
|
-
slackSend channel: '#github',
|
|
17
|
-
color: 'good',
|
|
18
|
-
message: "A new PR to be approved for aliBuild. Please check https://alijenkins.cern.ch/job/alibuild-pipeline/branch/${env.BRANCH_NAME}",
|
|
19
|
-
token: env.SLACK_TOKEN
|
|
20
|
-
input "Do you want to test this change?"
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
stage "Run tests"
|
|
25
|
-
def build_script = '''
|
|
26
|
-
(cd alibuild && git show && git log HEAD~5..)
|
|
27
|
-
alibuild/aliBuild --help
|
|
28
|
-
rm -fr alidist
|
|
29
|
-
git clone https://github.com/alisw/alidist
|
|
30
|
-
CHANGED_FILES=`cd alibuild && git diff --name-only origin/$CHANGE_TARGET.. | sed -e 's|/.*||' | sort -u`
|
|
31
|
-
for d in $CHANGED_FILES; do
|
|
32
|
-
case $d in
|
|
33
|
-
# Changes in alibuild_helpers can we tested in isolation, so we
|
|
34
|
-
# do so.
|
|
35
|
-
alibuild_helpers|tests)
|
|
36
|
-
PYTHONPATH=alibuild python alibuild/tests/test_utilities.py
|
|
37
|
-
PYTHONPATH=alibuild python alibuild/tests/test_analytics.py
|
|
38
|
-
;;
|
|
39
|
-
# Changes to alibuild require a full rebuild to be validated. The
|
|
40
|
-
# goal as usual is to fail fast.
|
|
41
|
-
aliBuild)
|
|
42
|
-
alibuild/aliBuild -d build zlib
|
|
43
|
-
alibuild/aliBuild --reference-sources /build/mirror -d build AliRoot -n
|
|
44
|
-
;;
|
|
45
|
-
# All the other changes we do not have tests right now.
|
|
46
|
-
*) ;;
|
|
47
|
-
esac
|
|
48
|
-
done
|
|
49
|
-
|
|
50
|
-
# We do more extensive tests later
|
|
51
|
-
for d in $CHANGED_FILES; do
|
|
52
|
-
case $d in
|
|
53
|
-
# Rebuild everything if aliBuild or build_template.sh changed
|
|
54
|
-
aliBuild|*build_template.sh)
|
|
55
|
-
alibuild/aliBuild --reference-sources /build/mirror --remote-store rsync://repo.marathon.mesos/store/ -d build AliRoot
|
|
56
|
-
;;
|
|
57
|
-
# All the other changes we do not have tests right now.
|
|
58
|
-
*) ;;
|
|
59
|
-
esac
|
|
60
|
-
done
|
|
61
|
-
'''
|
|
62
|
-
|
|
63
|
-
withEnv(["CHANGED_TARGET=${env.CHANGE_TARGET}"]) {
|
|
64
|
-
parallel(
|
|
65
|
-
"slc5": {
|
|
66
|
-
node ("slc5_x86-64-large") {
|
|
67
|
-
dir ("alibuild") {
|
|
68
|
-
checkout scm
|
|
69
|
-
}
|
|
70
|
-
sh build_script
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
"slc6": {
|
|
74
|
-
node ("slc6_x86-64-large") {
|
|
75
|
-
dir ("alibuild") {
|
|
76
|
-
checkout scm
|
|
77
|
-
}
|
|
78
|
-
sh build_script
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
"slc7": {
|
|
82
|
-
node ("slc7_x86-64-large") {
|
|
83
|
-
dir ("alibuild") {
|
|
84
|
-
checkout scm
|
|
85
|
-
}
|
|
86
|
-
sh build_script
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
"ubuntu1510": {
|
|
90
|
-
node ("ubt1510_x86-64-large") {
|
|
91
|
-
dir ("alibuild") {
|
|
92
|
-
checkout scm
|
|
93
|
-
}
|
|
94
|
-
sh build_script
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
)
|
|
98
|
-
}
|
|
99
|
-
}
|
|
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
|