alibuild 1.17.11__tar.gz → 1.17.13__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.13}/PKG-INFO +1 -1
- {alibuild-1.17.11 → alibuild-1.17.13}/alfaBuild +3 -7
- {alibuild-1.17.11 → alibuild-1.17.13}/aliBuild +3 -7
- {alibuild-1.17.11 → alibuild-1.17.13}/alibuild.egg-info/PKG-INFO +1 -1
- {alibuild-1.17.11 → alibuild-1.17.13}/alibuild.egg-info/SOURCES.txt +1 -1
- {alibuild-1.17.11 → alibuild-1.17.13}/alibuild_helpers/_version.py +2 -2
- {alibuild-1.17.11 → alibuild-1.17.13}/alibuild_helpers/analytics.py +1 -4
- {alibuild-1.17.11 → alibuild-1.17.13}/alibuild_helpers/args.py +3 -4
- {alibuild-1.17.11 → alibuild-1.17.13}/alibuild_helpers/build.py +59 -27
- {alibuild-1.17.11 → alibuild-1.17.13}/alibuild_helpers/cmd.py +12 -48
- {alibuild-1.17.11 → alibuild-1.17.13}/alibuild_helpers/git.py +6 -6
- {alibuild-1.17.11 → alibuild-1.17.13}/alibuild_helpers/scm.py +1 -1
- {alibuild-1.17.11 → alibuild-1.17.13}/alibuild_helpers/sync.py +1 -1
- {alibuild-1.17.11 → alibuild-1.17.13}/alibuild_helpers/utilities.py +17 -14
- {alibuild-1.17.11 → alibuild-1.17.13}/alibuild_helpers/workarea.py +1 -4
- {alibuild-1.17.11 → alibuild-1.17.13}/docs/mkdocs.yml +1 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/setup.py +0 -2
- alibuild-1.17.13/templates/alibuild_to_please.jnj +63 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/tests/test_args.py +4 -12
- {alibuild-1.17.11 → alibuild-1.17.13}/tests/test_build.py +6 -14
- {alibuild-1.17.11 → alibuild-1.17.13}/tests/test_clean.py +1 -4
- {alibuild-1.17.11 → alibuild-1.17.13}/tests/test_cmd.py +1 -4
- {alibuild-1.17.11 → alibuild-1.17.13}/tests/test_deps.py +2 -10
- {alibuild-1.17.11 → alibuild-1.17.13}/tests/test_doctor.py +2 -10
- {alibuild-1.17.11 → alibuild-1.17.13}/tests/test_hashing.py +1 -4
- {alibuild-1.17.11 → alibuild-1.17.13}/tests/test_init.py +3 -10
- {alibuild-1.17.11 → alibuild-1.17.13}/tests/test_log.py +1 -4
- {alibuild-1.17.11 → alibuild-1.17.13}/tests/test_packagelist.py +13 -9
- {alibuild-1.17.11 → alibuild-1.17.13}/tests/test_parseRecipe.py +2 -6
- {alibuild-1.17.11 → alibuild-1.17.13}/tests/test_sync.py +1 -4
- {alibuild-1.17.11 → alibuild-1.17.13}/tests/test_utilities.py +1 -4
- {alibuild-1.17.11 → alibuild-1.17.13}/tests/test_workarea.py +2 -8
- {alibuild-1.17.11 → alibuild-1.17.13}/tox.ini +0 -8
- alibuild-1.17.11/Jenkinsfile +0 -99
- {alibuild-1.17.11 → alibuild-1.17.13}/.flake8 +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/.github/workflows/documentation.yml +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/.github/workflows/pr-check.yml +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/.github/workflows/release.yml +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/.gitignore +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/.pylintrc +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/ANALYTICS.md +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/DESIGN.md +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/LICENSE.md +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/MANIFEST.in +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/PACKAGING.md +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/README.rst +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/aliDeps +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/aliDoctor +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/alibuild.egg-info/dependency_links.txt +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/alibuild.egg-info/requires.txt +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/alibuild.egg-info/top_level.txt +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/alibuild_helpers/__init__.py +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/alibuild_helpers/build_template.sh +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/alibuild_helpers/clean.py +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/alibuild_helpers/deps.py +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/alibuild_helpers/doctor.py +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/alibuild_helpers/init.py +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/alibuild_helpers/log.py +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/alibuild_helpers/sl.py +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/alibuild_helpers/templating_plugin.py +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/alienv +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/codecov.yml +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/debian/changelog +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/debian/compat +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/debian/control +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/debian/copyright +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/debian/files +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/debian/rules +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/docs/README.md +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/docs/SUPPORT +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/docs/docs/alice_logo.png +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/docs/docs/deps.png +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/docs/docs/index.md +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/docs/docs/quick.md +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/docs/docs/reference.md +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/docs/docs/stylesheets/extra.css +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/docs/docs/troubleshooting.md +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/docs/docs/user.md +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/pb +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/pyproject.toml +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/requirements.txt +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/setup.cfg +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/tests/test_analytics.py +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/tests/test_git.py +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/tests/testdist/broken1.sh +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/tests/testdist/broken2.sh +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/tests/testdist/broken3.sh +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/tests/testdist/broken4.sh +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/tests/testdist/broken5.sh +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/tests/testdist/broken6.sh +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/tests/testdist/broken7.sh +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/tests/testdist/clobber-initdotsh.sh +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/tests/testdist/defaults-o2.sh +0 -0
- {alibuild-1.17.11 → alibuild-1.17.13}/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
|
|
@@ -58,7 +57,7 @@ def doMain(args, parser):
|
|
|
58
57
|
error(e.message)
|
|
59
58
|
exit(1)
|
|
60
59
|
|
|
61
|
-
if args.action == "version":
|
|
60
|
+
if args.action == "version" or args.action == None:
|
|
62
61
|
print("aliBuild version: {version} ({arch})".format(
|
|
63
62
|
version=__version__ or "unknown", arch=args.architecture or "unknown"))
|
|
64
63
|
sys.exit(0)
|
|
@@ -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
|
|
@@ -58,7 +57,7 @@ def doMain(args, parser):
|
|
|
58
57
|
error(e.message)
|
|
59
58
|
exit(1)
|
|
60
59
|
|
|
61
|
-
if args.action == "version":
|
|
60
|
+
if args.action == "version" or args.action == None:
|
|
62
61
|
print("aliBuild version: {version} ({arch})".format(
|
|
63
62
|
version=__version__ or "unknown", arch=args.architecture or "unknown"))
|
|
64
63
|
sys.exit(0)
|
|
@@ -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
|
|
@@ -4,8 +4,8 @@ from alibuild_helpers import __version__
|
|
|
4
4
|
from alibuild_helpers.analytics import report_event
|
|
5
5
|
from alibuild_helpers.log import debug, info, banner, warning
|
|
6
6
|
from alibuild_helpers.log import dieOnError
|
|
7
|
-
from alibuild_helpers.cmd import execute, DockerRunner, BASH, install_wrapper_script
|
|
8
|
-
from alibuild_helpers.utilities import prunePaths, symlink, call_ignoring_oserrors, topological_sort
|
|
7
|
+
from alibuild_helpers.cmd import execute, DockerRunner, BASH, install_wrapper_script, getstatusoutput
|
|
8
|
+
from alibuild_helpers.utilities import prunePaths, symlink, call_ignoring_oserrors, topological_sort, detectArch
|
|
9
9
|
from alibuild_helpers.utilities import resolve_store_path
|
|
10
10
|
from alibuild_helpers.utilities import parseDefaults, readDefaults
|
|
11
11
|
from alibuild_helpers.utilities import getPackageList, asList
|
|
@@ -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]
|
|
@@ -1108,6 +1112,29 @@ def doBuild(args, parser):
|
|
|
1108
1112
|
""")
|
|
1109
1113
|
buildErrMsg += "".join("\n ( cd %s && git pull --rebase )" % dp for dp in updatablePkgs)
|
|
1110
1114
|
|
|
1115
|
+
# Gather build info for the error message
|
|
1116
|
+
try:
|
|
1117
|
+
safe_args = {
|
|
1118
|
+
"pkgname", "defaults", "architecture", "forceUnknownArch",
|
|
1119
|
+
"develPrefix", "jobs", "noSystem", "noDevel", "forceTracked", "plugin",
|
|
1120
|
+
"disable", "annotate", "onlyDeps", "docker"
|
|
1121
|
+
}
|
|
1122
|
+
args_str = " ".join(f"--{k}={v}" for k, v in vars(args).items() if v and k in safe_args)
|
|
1123
|
+
detected_arch = detectArch()
|
|
1124
|
+
buildErrMsg += dedent(f"""
|
|
1125
|
+
Build info:
|
|
1126
|
+
OS: {detected_arch}
|
|
1127
|
+
Using aliBuild from alibuild@{__version__ or "unknown"} recipes in alidist@{os.environ["ALIBUILD_ALIDIST_HASH"][:10]}
|
|
1128
|
+
Build arguments: {args_str}
|
|
1129
|
+
""")
|
|
1130
|
+
|
|
1131
|
+
if detected_arch.startswith("osx"):
|
|
1132
|
+
buildErrMsg += f'XCode version: {getstatusoutput("xcodebuild -version")[1]}'
|
|
1133
|
+
|
|
1134
|
+
except Exception as exc:
|
|
1135
|
+
warning("Failed to gather build info", exc_info=exc)
|
|
1136
|
+
|
|
1137
|
+
|
|
1111
1138
|
dieOnError(err, buildErrMsg.strip())
|
|
1112
1139
|
|
|
1113
1140
|
# We need to create 2 sets of links, once with the full requires,
|
|
@@ -1122,14 +1149,19 @@ def doBuild(args, parser):
|
|
|
1122
1149
|
if not spec["revision"].startswith("local"):
|
|
1123
1150
|
syncHelper.upload_symlinks_and_tarball(spec)
|
|
1124
1151
|
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1152
|
+
if not args.onlyDeps:
|
|
1153
|
+
banner("Build of %s successfully completed on `%s'.\n"
|
|
1154
|
+
"Your software installation is at:"
|
|
1155
|
+
"\n\n %s\n\n"
|
|
1156
|
+
"You can use this package by loading the environment:"
|
|
1157
|
+
"\n\n alienv enter %s/latest-%s",
|
|
1158
|
+
mainPackage, socket.gethostname(),
|
|
1159
|
+
abspath(join(args.workDir, args.architecture)),
|
|
1160
|
+
mainPackage, mainBuildFamily)
|
|
1161
|
+
else:
|
|
1162
|
+
banner("Successfully built dependencies for package %s on `%s'.\n",
|
|
1163
|
+
mainPackage, socket.gethostname()
|
|
1164
|
+
)
|
|
1133
1165
|
for spec in specs.values():
|
|
1134
1166
|
if spec["is_devel_pkg"]:
|
|
1135
1167
|
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,12 +488,12 @@ 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
|
-
|
|
498
|
-
|
|
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
|
+
if replacement:
|
|
499
497
|
# We must keep the package name the same, since it is used to
|
|
500
498
|
# specify dependencies.
|
|
501
499
|
replacement["package"] = spec["package"]
|
|
@@ -503,6 +501,8 @@ def getPackageList(packages, specs, configDir, preferSystem, noSystem,
|
|
|
503
501
|
# influence the package's hash, so allow the user to override it.
|
|
504
502
|
replacement.setdefault("version", requested_version)
|
|
505
503
|
spec = replacement
|
|
504
|
+
# Allows generalising the version based on the actual key provided
|
|
505
|
+
spec["version"] = spec["version"].replace("%(key)s", key)
|
|
506
506
|
recipe = replacement.get("recipe", "")
|
|
507
507
|
# If there's an explicitly-specified recipe, we're still building
|
|
508
508
|
# the package. If not, aliBuild will still "build" it, but it's
|
|
@@ -512,6 +512,9 @@ def getPackageList(packages, specs, configDir, preferSystem, noSystem,
|
|
|
512
512
|
ownPackages.add(spec["package"])
|
|
513
513
|
else:
|
|
514
514
|
systemPackages.add(spec["package"])
|
|
515
|
+
else:
|
|
516
|
+
warning(f"Could not find named replacement spec for {spec['package']}: {key}, "
|
|
517
|
+
"falling back to building the package ourselves.")
|
|
515
518
|
|
|
516
519
|
dieOnError(("system_requirement" in spec) and recipe.strip("\n\t "),
|
|
517
520
|
"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))]
|