alibuild 1.17.10__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.
Files changed (94) hide show
  1. {alibuild-1.17.10 → alibuild-1.17.12}/PKG-INFO +1 -1
  2. {alibuild-1.17.10 → alibuild-1.17.12}/alfaBuild +2 -6
  3. {alibuild-1.17.10 → alibuild-1.17.12}/aliBuild +2 -6
  4. {alibuild-1.17.10 → alibuild-1.17.12}/alibuild.egg-info/PKG-INFO +1 -1
  5. {alibuild-1.17.10 → alibuild-1.17.12}/alibuild.egg-info/SOURCES.txt +1 -1
  6. {alibuild-1.17.10 → alibuild-1.17.12}/alibuild_helpers/_version.py +2 -2
  7. {alibuild-1.17.10 → alibuild-1.17.12}/alibuild_helpers/analytics.py +1 -4
  8. {alibuild-1.17.10 → alibuild-1.17.12}/alibuild_helpers/args.py +6 -6
  9. {alibuild-1.17.10 → alibuild-1.17.12}/alibuild_helpers/build.py +36 -26
  10. {alibuild-1.17.10 → alibuild-1.17.12}/alibuild_helpers/cmd.py +12 -48
  11. {alibuild-1.17.10 → alibuild-1.17.12}/alibuild_helpers/git.py +6 -6
  12. {alibuild-1.17.10 → alibuild-1.17.12}/alibuild_helpers/scm.py +1 -1
  13. {alibuild-1.17.10 → alibuild-1.17.12}/alibuild_helpers/sync.py +1 -1
  14. {alibuild-1.17.10 → alibuild-1.17.12}/alibuild_helpers/utilities.py +31 -29
  15. {alibuild-1.17.10 → alibuild-1.17.12}/alibuild_helpers/workarea.py +1 -4
  16. {alibuild-1.17.10 → alibuild-1.17.12}/docs/docs/user.md +1 -1
  17. {alibuild-1.17.10 → alibuild-1.17.12}/docs/mkdocs.yml +1 -0
  18. {alibuild-1.17.10 → alibuild-1.17.12}/setup.py +0 -2
  19. alibuild-1.17.12/templates/alibuild_to_please.jnj +63 -0
  20. {alibuild-1.17.10 → alibuild-1.17.12}/tests/test_args.py +4 -12
  21. {alibuild-1.17.10 → alibuild-1.17.12}/tests/test_build.py +6 -14
  22. {alibuild-1.17.10 → alibuild-1.17.12}/tests/test_clean.py +1 -4
  23. {alibuild-1.17.10 → alibuild-1.17.12}/tests/test_cmd.py +1 -4
  24. {alibuild-1.17.10 → alibuild-1.17.12}/tests/test_deps.py +2 -10
  25. {alibuild-1.17.10 → alibuild-1.17.12}/tests/test_doctor.py +2 -10
  26. {alibuild-1.17.10 → alibuild-1.17.12}/tests/test_hashing.py +1 -4
  27. {alibuild-1.17.10 → alibuild-1.17.12}/tests/test_init.py +3 -10
  28. {alibuild-1.17.10 → alibuild-1.17.12}/tests/test_log.py +1 -4
  29. {alibuild-1.17.10 → alibuild-1.17.12}/tests/test_packagelist.py +9 -8
  30. {alibuild-1.17.10 → alibuild-1.17.12}/tests/test_parseRecipe.py +2 -6
  31. {alibuild-1.17.10 → alibuild-1.17.12}/tests/test_sync.py +1 -4
  32. {alibuild-1.17.10 → alibuild-1.17.12}/tests/test_utilities.py +1 -4
  33. {alibuild-1.17.10 → alibuild-1.17.12}/tests/test_workarea.py +2 -8
  34. {alibuild-1.17.10 → alibuild-1.17.12}/tox.ini +0 -8
  35. alibuild-1.17.10/Jenkinsfile +0 -99
  36. {alibuild-1.17.10 → alibuild-1.17.12}/.flake8 +0 -0
  37. {alibuild-1.17.10 → alibuild-1.17.12}/.github/workflows/documentation.yml +0 -0
  38. {alibuild-1.17.10 → alibuild-1.17.12}/.github/workflows/pr-check.yml +0 -0
  39. {alibuild-1.17.10 → alibuild-1.17.12}/.github/workflows/release.yml +0 -0
  40. {alibuild-1.17.10 → alibuild-1.17.12}/.gitignore +0 -0
  41. {alibuild-1.17.10 → alibuild-1.17.12}/.pylintrc +0 -0
  42. {alibuild-1.17.10 → alibuild-1.17.12}/ANALYTICS.md +0 -0
  43. {alibuild-1.17.10 → alibuild-1.17.12}/DESIGN.md +0 -0
  44. {alibuild-1.17.10 → alibuild-1.17.12}/LICENSE.md +0 -0
  45. {alibuild-1.17.10 → alibuild-1.17.12}/MANIFEST.in +0 -0
  46. {alibuild-1.17.10 → alibuild-1.17.12}/PACKAGING.md +0 -0
  47. {alibuild-1.17.10 → alibuild-1.17.12}/README.rst +0 -0
  48. {alibuild-1.17.10 → alibuild-1.17.12}/aliDeps +0 -0
  49. {alibuild-1.17.10 → alibuild-1.17.12}/aliDoctor +0 -0
  50. {alibuild-1.17.10 → alibuild-1.17.12}/alibuild.egg-info/dependency_links.txt +0 -0
  51. {alibuild-1.17.10 → alibuild-1.17.12}/alibuild.egg-info/requires.txt +0 -0
  52. {alibuild-1.17.10 → alibuild-1.17.12}/alibuild.egg-info/top_level.txt +0 -0
  53. {alibuild-1.17.10 → alibuild-1.17.12}/alibuild_helpers/__init__.py +0 -0
  54. {alibuild-1.17.10 → alibuild-1.17.12}/alibuild_helpers/build_template.sh +0 -0
  55. {alibuild-1.17.10 → alibuild-1.17.12}/alibuild_helpers/clean.py +0 -0
  56. {alibuild-1.17.10 → alibuild-1.17.12}/alibuild_helpers/deps.py +0 -0
  57. {alibuild-1.17.10 → alibuild-1.17.12}/alibuild_helpers/doctor.py +0 -0
  58. {alibuild-1.17.10 → alibuild-1.17.12}/alibuild_helpers/init.py +0 -0
  59. {alibuild-1.17.10 → alibuild-1.17.12}/alibuild_helpers/log.py +0 -0
  60. {alibuild-1.17.10 → alibuild-1.17.12}/alibuild_helpers/sl.py +0 -0
  61. {alibuild-1.17.10 → alibuild-1.17.12}/alibuild_helpers/templating_plugin.py +0 -0
  62. {alibuild-1.17.10 → alibuild-1.17.12}/alienv +0 -0
  63. {alibuild-1.17.10 → alibuild-1.17.12}/codecov.yml +0 -0
  64. {alibuild-1.17.10 → alibuild-1.17.12}/debian/changelog +0 -0
  65. {alibuild-1.17.10 → alibuild-1.17.12}/debian/compat +0 -0
  66. {alibuild-1.17.10 → alibuild-1.17.12}/debian/control +0 -0
  67. {alibuild-1.17.10 → alibuild-1.17.12}/debian/copyright +0 -0
  68. {alibuild-1.17.10 → alibuild-1.17.12}/debian/files +0 -0
  69. {alibuild-1.17.10 → alibuild-1.17.12}/debian/rules +0 -0
  70. {alibuild-1.17.10 → alibuild-1.17.12}/docs/README.md +0 -0
  71. {alibuild-1.17.10 → alibuild-1.17.12}/docs/SUPPORT +0 -0
  72. {alibuild-1.17.10 → alibuild-1.17.12}/docs/docs/alice_logo.png +0 -0
  73. {alibuild-1.17.10 → alibuild-1.17.12}/docs/docs/deps.png +0 -0
  74. {alibuild-1.17.10 → alibuild-1.17.12}/docs/docs/index.md +0 -0
  75. {alibuild-1.17.10 → alibuild-1.17.12}/docs/docs/quick.md +0 -0
  76. {alibuild-1.17.10 → alibuild-1.17.12}/docs/docs/reference.md +0 -0
  77. {alibuild-1.17.10 → alibuild-1.17.12}/docs/docs/stylesheets/extra.css +0 -0
  78. {alibuild-1.17.10 → alibuild-1.17.12}/docs/docs/troubleshooting.md +0 -0
  79. {alibuild-1.17.10 → alibuild-1.17.12}/pb +0 -0
  80. {alibuild-1.17.10 → alibuild-1.17.12}/pyproject.toml +0 -0
  81. {alibuild-1.17.10 → alibuild-1.17.12}/requirements.txt +0 -0
  82. {alibuild-1.17.10 → alibuild-1.17.12}/setup.cfg +0 -0
  83. {alibuild-1.17.10 → alibuild-1.17.12}/tests/test_analytics.py +0 -0
  84. {alibuild-1.17.10 → alibuild-1.17.12}/tests/test_git.py +0 -0
  85. {alibuild-1.17.10 → alibuild-1.17.12}/tests/testdist/broken1.sh +0 -0
  86. {alibuild-1.17.10 → alibuild-1.17.12}/tests/testdist/broken2.sh +0 -0
  87. {alibuild-1.17.10 → alibuild-1.17.12}/tests/testdist/broken3.sh +0 -0
  88. {alibuild-1.17.10 → alibuild-1.17.12}/tests/testdist/broken4.sh +0 -0
  89. {alibuild-1.17.10 → alibuild-1.17.12}/tests/testdist/broken5.sh +0 -0
  90. {alibuild-1.17.10 → alibuild-1.17.12}/tests/testdist/broken6.sh +0 -0
  91. {alibuild-1.17.10 → alibuild-1.17.12}/tests/testdist/broken7.sh +0 -0
  92. {alibuild-1.17.10 → alibuild-1.17.12}/tests/testdist/clobber-initdotsh.sh +0 -0
  93. {alibuild-1.17.10 → alibuild-1.17.12}/tests/testdist/defaults-o2.sh +0 -0
  94. {alibuild-1.17.10 → alibuild-1.17.12}/tests/testdist/delete-etc.sh +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: alibuild
3
- Version: 1.17.10
3
+ Version: 1.17.12
4
4
  Summary: ALICE Build Tool
5
5
  Home-page: https://alisw.github.io/alibuild
6
6
  Author: Giulio Eulisse
@@ -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, warning, debug, logger, error
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
- try:
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, warning, debug, logger, error
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
- try:
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():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: alibuild
3
- Version: 1.17.10
3
+ Version: 1.17.12
4
4
  Summary: ALICE Build Tool
5
5
  Home-page: https://alisw.github.io/alibuild
6
6
  Author: Giulio Eulisse
@@ -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
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '1.17.10'
16
- __version_tuple__ = version_tuple = (1, 17, 10)
15
+ __version__ = version = '1.17.12'
16
+ __version_tuple__ = version_tuple = (1, 17, 12)
@@ -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
- # raw_input and input are different between python 2 and 3
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
- try:
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
@@ -377,6 +376,7 @@ On Linux, x86-64:
377
376
  RHEL9 / ALMA9 compatible: slc9_x86-64
378
377
  Ubuntu 20.04 compatible: ubuntu2004_x86-64
379
378
  Ubuntu 22.04 compatible: ubuntu2204_x86-64
379
+ Ubuntu 24.04 compatible: ubuntu2404_x86-64
380
380
  Fedora 33 compatible: fedora33_x86-64
381
381
  Fedora 34 compatible: fedora34_x86-64
382
382
 
@@ -391,8 +391,8 @@ On Mac, 1-2 latest supported OSX versions:
391
391
  Apple Silicon: osx_arm64
392
392
  """
393
393
 
394
- # When updating this variable, also update docs/user.markdown!
395
- S3_SUPPORTED_ARCHS = "slc7_x86-64", "slc8_x86-64", "ubuntu2004_x86-64", "ubuntu2204_x86-64", "slc9_x86-64", "slc9_aarch64"
394
+ # When updating this variable, also update docs/docs/user.md!
395
+ S3_SUPPORTED_ARCHS = "slc7_x86-64", "slc8_x86-64", "ubuntu2004_x86-64", "ubuntu2204_x86-64", "ubuntu2404_x86-64", "slc9_x86-64", "slc9_aarch64"
396
396
 
397
397
  def finaliseArgs(args, parser):
398
398
 
@@ -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
- try:
26
- from collections import OrderedDict
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 sys.version_info[0] < 3 and key in spec and isinstance(spec[key], OrderedDict):
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,17 +540,26 @@ def doBuild(args, parser):
550
540
  del develCandidates, develCandidatesUpper, develPkgsUpper
551
541
 
552
542
  if buildOrder:
553
- banner("Packages will be built in the following order:\n - %s",
554
- "\n - ".join(x+" (development package)" if x in develPkgs else "%s@%s" % (x, specs[x]["tag"])
555
- for x in buildOrder if x != "defaults-release"))
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
- banner("You have packages in development mode.\n"
556
+ banner("You have packages in development mode (%s).\n"
559
557
  "This means their source code can be freely modified under:\n\n"
560
558
  " %s/<package_name>\n\n"
561
559
  "aliBuild does not automatically update such packages to avoid work loss.\n"
562
560
  "In most cases this is achieved by doing in the package source directory:\n\n"
563
561
  " git pull --rebase\n",
562
+ ", ".join(develPkgs),
564
563
  os.getcwd())
565
564
 
566
565
  for pkg, spec in specs.items():
@@ -702,6 +701,12 @@ def doBuild(args, parser):
702
701
  deps=",".join(buildOrder[:-1]),
703
702
  ), args.architecture)
704
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
+
705
710
  while buildOrder:
706
711
  p = buildOrder[0]
707
712
  spec = specs[p]
@@ -1121,14 +1126,19 @@ def doBuild(args, parser):
1121
1126
  if not spec["revision"].startswith("local"):
1122
1127
  syncHelper.upload_symlinks_and_tarball(spec)
1123
1128
 
1124
- banner("Build of %s successfully completed on `%s'.\n"
1125
- "Your software installation is at:"
1126
- "\n\n %s\n\n"
1127
- "You can use this package by loading the environment:"
1128
- "\n\n alienv enter %s/latest-%s",
1129
- mainPackage, socket.gethostname(),
1130
- abspath(join(args.workDir, args.architecture)),
1131
- mainPackage, mainBuildFamily)
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
+ )
1132
1142
  for spec in specs.values():
1133
1143
  if spec["is_devel_pkg"]:
1134
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
- try:
8
- from subprocess import TimeoutExpired
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 sys.version_info[0] >= 3:
38
- if isinstance(data, bytes):
39
- try:
40
- return data.decode("utf-8")
41
- except UnicodeDecodeError:
42
- return data.decode("latin-1")
43
- else:
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=is_string(command), stdout=PIPE, stderr=PIPE)
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=is_string(command), stdout=PIPE, stderr=STDOUT)
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=is_string(command), stdout=PIPE, stderr=STDOUT)
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, source, referenceRepo, usePartialClone):
50
- cmd = ["clone", "--bare", source, referenceRepo]
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, ref):
68
- return ["checkout", "-f", ref]
67
+ def checkoutCmd(self, tag):
68
+ return ["checkout", "-f", tag]
69
69
 
70
- def fetchCmd(self, source, *refs):
71
- return ["fetch", "-f"] + clone_speedup_options() + [source, *refs]
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, spec, referenceRepo, usePartialClone):
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(self.writeStore, "CVMFS backend does not support uploading directly")
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
- try:
14
- from collections import OrderedDict
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
- try:
494
- replacement = spec["prefer_system_replacement_specs"][key]
495
- except KeyError:
496
- dieOnError(True, "Could not find named replacement spec for "
497
- "%s: %s" % (spec["package"], key))
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
- # 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
- 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
- try:
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
@@ -103,7 +103,7 @@ provides tarballs for the most common supported architectures.
103
103
  ## Using precompiled packages
104
104
 
105
105
  By running aliBuild with no special option on CentOS/Alma 7, 8 or 9, or on
106
- Ubuntu 20.04 or 22.04, it will automatically try to
106
+ Ubuntu 20.04, 22.04 or 24.04, it will automatically try to
107
107
  use as many precompiled packages as possible by downloading them from a default
108
108
  central server. By using precompiled packages you lose the ability to pick some
109
109
  of them from your system. If you do not want to use precompiled packages and you
@@ -30,6 +30,7 @@ markdown_extensions:
30
30
  permalink: "#"
31
31
 
32
32
  plugins:
33
+ - search
33
34
  - redirects:
34
35
  redirect_maps:
35
36
  'o2-tutorial.html': 'https://alice-doc.github.io/alice-analysis-tutorial/building/'
@@ -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
- try:
4
- from unittest import mock
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
- if (sys.version_info[0] >= 3):
20
- BUILD_MISSING_PKG_ERROR = "the following arguments are required: PACKAGE"
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))]