alibuild 1.17.19__py3-none-any.whl → 1.17.33__py3-none-any.whl

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 (35) hide show
  1. {alibuild-1.17.19.dist-info → alibuild-1.17.33.dist-info}/METADATA +22 -3
  2. {alibuild-1.17.19.dist-info → alibuild-1.17.33.dist-info}/RECORD +34 -35
  3. alibuild_helpers/_version.py +16 -3
  4. alibuild_helpers/args.py +2 -0
  5. alibuild_helpers/build.py +5 -2
  6. alibuild_helpers/build_template.sh +14 -3
  7. alibuild_helpers/cmd.py +1 -1
  8. alibuild_helpers/deps.py +5 -1
  9. alibuild_helpers/doctor.py +15 -9
  10. alibuild_helpers/git.py +1 -1
  11. alibuild_helpers/init.py +2 -1
  12. alibuild_helpers/log.py +8 -1
  13. alibuild_helpers/sl.py +16 -3
  14. alibuild_helpers/sync.py +45 -12
  15. alibuild_helpers/utilities.py +2 -2
  16. docs/docs/reference.md +11 -1
  17. docs/docs/troubleshooting.md +5 -4
  18. docs/docs/user.md +80 -40
  19. tests/test_build.py +43 -32
  20. tests/test_cmd.py +22 -0
  21. tests/test_deps.py +2 -1
  22. tests/test_doctor.py +2 -1
  23. tests/test_init.py +4 -2
  24. tests/test_sync.py +3 -3
  25. tests/test_utilities.py +90 -0
  26. tests/test_workarea.py +1 -1
  27. docs/README.md +0 -1
  28. {alibuild-1.17.19.data → alibuild-1.17.33.data}/scripts/aliBuild +0 -0
  29. {alibuild-1.17.19.data → alibuild-1.17.33.data}/scripts/aliDeps +0 -0
  30. {alibuild-1.17.19.data → alibuild-1.17.33.data}/scripts/aliDoctor +0 -0
  31. {alibuild-1.17.19.data → alibuild-1.17.33.data}/scripts/alienv +0 -0
  32. {alibuild-1.17.19.data → alibuild-1.17.33.data}/scripts/pb +0 -0
  33. {alibuild-1.17.19.dist-info → alibuild-1.17.33.dist-info}/WHEEL +0 -0
  34. {alibuild-1.17.19.dist-info → alibuild-1.17.33.dist-info}/licenses/LICENSE.md +0 -0
  35. {alibuild-1.17.19.dist-info → alibuild-1.17.33.dist-info}/top_level.txt +0 -0
@@ -76,8 +76,9 @@ will tell you something like:
76
76
  We will build packages in the following order: defaults-release AliEn-CAs GMP UUID gSOAP ApMon-CPP GEANT4 boost MPFR MonALISA-gSOAP-client cgal XRootD fastjet xalienfs AliEn-Runtime ROOT vgm GEANT3 GEANT4_VMC AliRoot
77
77
 
78
78
  If you have a system package which you think should be used but it's not, you
79
- can run `aliDoctor <package-name>` to try to understand why that was the case
80
- (or you can [open a bug report](https://github.com/alisw/alidist/issues) with its output and we will look at it).
79
+ can run `aliBuild doctor <package-name>` to try to understand why that was the
80
+ case (or you can [open a bug report](https://github.com/alisw/alidist/issues)
81
+ with its output and we will look at it).
81
82
 
82
83
  ### What is PIP ? How do I install it?
83
84
 
@@ -155,7 +156,7 @@ it means that aliBuild does not consider you system tool good enough to
155
156
  be compatible with the one provided by the recipe. You can verify what
156
157
  happens during the system tool detection by running:
157
158
 
158
- aliDoctor <package name>
159
+ aliBuild doctor <package name>
159
160
 
160
161
 
161
162
  ### AliBuild fails with `cannot open file "AvailabilityMacros.h`
@@ -236,7 +237,7 @@ building unless one of the system dependencies is absolutely required
236
237
  tool, where simply installing them might be a better option. For this
237
238
  reason we suggest that users run:
238
239
 
239
- aliDoctor AliPhysics
240
+ aliBuild doctor AliPhysics
240
241
 
241
242
  in the same path where their `alidist` folder is, before actually
242
243
  starting to build, so that they can get an overview of what will be
docs/docs/user.md CHANGED
@@ -11,7 +11,9 @@ For a quick start introduction, please look [here](quick.md).
11
11
  aliBuild build [-h] [--defaults DEFAULT]
12
12
  [-a ARCH] [--force-unknown-architecture]
13
13
  [-z [DEVELPREFIX]] [-e ENVIRONMENT] [-j JOBS] [-u]
14
- [--no-local PKGLIST] [--disable PACKAGE]
14
+ [--no-local PKGLIST] [--force-tracked] [--disable PACKAGE]
15
+ [--force-rebuild PACKAGE] [--annotate PACKAGE=COMMENT]
16
+ [--only-deps] [--plugin PLUGIN]
15
17
  [--always-prefer-system | --no-system]
16
18
  [--docker] [--docker-image IMAGE] [--docker-extra-args ARGLIST] [-v VOLUMES]
17
19
  [--no-remote-store] [--remote-store STORE] [--write-store STORE] [--insecure]
@@ -39,7 +41,18 @@ aliBuild build [-h] [--defaults DEFAULT]
39
41
  given.
40
42
  - `--no-local PKGLIST`: Do not pick up the following packages from a local
41
43
  checkout. `PKGLIST` is a comma-separated list.
44
+ - `--force-tracked`: Do not pick up any packages from a local checkout.
42
45
  - `--disable PACKAGE`: Do not build `PACKAGE` and all its (unique) dependencies.
46
+ - `--force-rebuild PACKAGE`: Always rebuild the specified packages from scratch,
47
+ even if they were built before. Has the same effect as adding
48
+ `force_rebuild: true` to the recipe. May be specified multiple times or
49
+ separate multiple arguments with commas.
50
+ - `--annotate PACKAGE=COMMENT`: Store `COMMENT` in the build metadata for
51
+ `PACKAGE`. The comment will only be stored if the package is compiled or
52
+ downloaded during this run. May be specified multiple times.
53
+ - `--only-deps`: Only build dependencies, not the main package. Useful for
54
+ populating a build cache.
55
+ - `--plugin PLUGIN`: Plugin to use for the build. Default is `legacy`.
43
56
  - `--always-prefer-system`: Always use system packages when compatible.
44
57
  - `--no-system`: Never use system packages, even if compatible.
45
58
 
@@ -102,8 +115,8 @@ provides tarballs for the most common supported architectures.
102
115
 
103
116
  ## Using precompiled packages
104
117
 
105
- By running aliBuild with no special option on CentOS/Alma 7, 8 or 9, or on
106
- Ubuntu 20.04, 22.04 or 24.04, it will automatically try to
118
+ By running aliBuild with no special option on CentOS/Alma 7, 8 or 9 (x86-64 or ARM),
119
+ or on Ubuntu 20.04, 22.04 or 24.04 (x86-64), it will automatically try to
107
120
  use as many precompiled packages as possible by downloading them from a default
108
121
  central server. By using precompiled packages you lose the ability to pick some
109
122
  of them from your system. If you do not want to use precompiled packages and you
@@ -199,16 +212,30 @@ case the incremental recipe will always be executed.
199
212
 
200
213
  While alibuild does its best to find out which OS / distribution you are
201
214
  using, sometimes it might fail to do so, for example in the case you
202
- start using a new *buntu flavour or a bleeding edge version of Centos.
203
- In order to force the the correct architecture for the build you can use
215
+ start using a new *buntu flavour or a bleeding edge version of a distribution.
216
+ In order to force the correct architecture for the build you can use
204
217
  the `--architecture` (`-a`) flag with one of the supported options:
205
218
 
206
- - `slc5_x86-64`: Scientific Linux 5 and compatibles, on Intel / AMD x86-64.
207
- - `slc6_x86-64`: Scientific Linux 6 and compatibles, on Intel / AMD x86-64.
208
- - `slc7_x86-64`: CERN Centos 7 and compatibles, on Intel / AMD x86-64.
209
- - `ubuntu1404_x86-64`: Ubuntu 1404 and compatibles, on Intel / AMD x86-64.
210
- - `osx_x86-64`: OSX, on Intel / AMD x86-64.
211
- - `slc7_ppc64`: RHEL7 on POWER8 (LE only for now).
219
+ On Linux, x86-64:
220
+ - `slc6_x86-64`: RHEL6 / SLC6 compatible
221
+ - `slc7_x86-64`: RHEL7 / CC7 compatible
222
+ - `slc8_x86-64`: RHEL8 / CC8 compatible
223
+ - `slc9_x86-64`: RHEL9 / ALMA9 compatible
224
+ - `ubuntu2004_x86-64`: Ubuntu 20.04 compatible
225
+ - `ubuntu2204_x86-64`: Ubuntu 22.04 compatible
226
+ - `ubuntu2404_x86-64`: Ubuntu 24.04 compatible
227
+ - `fedora33_x86-64`: Fedora 33 compatible
228
+ - `fedora34_x86-64`: Fedora 34 compatible
229
+
230
+ On Linux, ARM:
231
+ - `slc9_aarch64`: RHEL9 / ALMA9 compatible
232
+
233
+ On Linux, POWER8 / PPC64 (little endian):
234
+ - `slc7_ppc64`: RHEL7 / CC7 compatible
235
+
236
+ On Mac:
237
+ - `osx_x86-64`: Intel
238
+ - `osx_arm64`: Apple Silicon
212
239
 
213
240
  ### Running in Docker
214
241
 
@@ -234,27 +261,33 @@ option using the same syntax used by Docker.
234
261
 
235
262
  ## Defaults
236
263
 
237
- By default `aliBuild` is tuned to build the production version of ALICE
238
- Offline software, as deployed on the Grid, so some of the choices in
239
- terms of version of the packages and compilation flags are tweaked for
240
- that. For example, ROOT5 is used because that's what is what has been
241
- validated for datataking and the choice will not change until the end of
242
- RUN2 of LHC. In order to change that and use, for example, a more recent
243
- version of ROOT you can use the `--default root6` option which will
244
- enable ROOT6 based builds. For a more complete description of how defaults
245
- works please look at [the reference manual](reference.md#defaults).
264
+ By default, `aliBuild` uses the `o2` defaults (`--defaults o2`), which are
265
+ optimized for building the ALICE O2 software stack. The defaults system
266
+ allows you to specify different sets of build configurations, compiler
267
+ flags, and package versions through the `--defaults` option.
268
+
269
+ Different defaults can be used to:
270
+ - Use different package versions (e.g., different ROOT versions)
271
+ - Apply specific compiler flags (e.g., debug builds, optimization levels)
272
+ - Enable or disable certain features or packages
273
+
274
+ To use a different set of defaults, use the `--defaults <name>` option,
275
+ which will load settings from `CONFIGDIR/defaults-<name>.sh`. For example,
276
+ `--defaults o2-epn` would use the `defaults-o2-epn.sh` file.
277
+
278
+ For a more complete description of how the defaults system works and how to
279
+ create custom defaults, please look at [the reference manual](reference.md#defaults).
246
280
 
247
281
  ## Disabling packages
248
282
 
249
283
  You can optionally disable certain packages by specifying them as a comma
250
284
  separated list with the `--disable` option.
251
285
 
252
- Moreover, starting from aliBuild 1.4.0, it will also be
253
- possible to disable packages by adding them to the `disable`
254
- keyword of your defaults file (see previous paragraph). See the
286
+ It's also possible to disable packages by adding them to the `disable` keyword
287
+ of your defaults file (see previous paragraph). See the
255
288
  [defaults-o2.sh](https://github.com/alisw/alidist/blob/master/defaults-o2.sh)
256
- file for an example of how to disable `AliEn-Runtime` and `AliRoot`
257
- when passing `--defaults o2`.
289
+ file for an example of how to disable `mesos` and `MySQL` when
290
+ passing `--defaults o2`.
258
291
 
259
292
  ## Controlling which system packages are picked up
260
293
 
@@ -294,15 +327,12 @@ installation area.
294
327
 
295
328
  ## Upgrading aliBuild
296
329
 
297
- aliBuild is installed via `pip`. In order to upgrade it on most laptops (in
298
- particular Macs) do:
330
+ aliBuild can be installed either via `pip`, or by your OS package manager (more info [here](https://alice-doc.github.io/alice-analysis-tutorial/building/custom.html).
299
331
 
300
- pip install --upgrade alibuild
332
+ The way to upgrade it depends on your installation method. If you installed it
333
+ via `pip`, you can upgrade it by running:
301
334
 
302
- or in case you need to be root (_e.g._ on Ubuntu and most Linux distributions
303
- for convenience):
304
-
305
- sudo pip install --upgrade alibuild
335
+ pip install --upgrade alibuild
306
336
 
307
337
  In general updating aliBuild is safe and it should never trigger a rebuild or
308
338
  break compilation of older versions of alidist (i.e. we do try to guarantee
@@ -315,10 +345,8 @@ when running the command.
315
345
  You can also upgrade / install a specific version of alibuild by specifying it on the
316
346
  command line. E.g.:
317
347
 
318
- pip install alibuild=1.5.5.rc1
348
+ pip install alibuild=1.17.23
319
349
 
320
- this is in particular required when you want to try out release candidates (rc) builds which
321
- are masked out by default.
322
350
 
323
351
  ## Rebuilding packages from branches instead of tags
324
352
 
@@ -339,11 +367,11 @@ server-side pull request checks).
339
367
 
340
368
  ## Generating a dependency graph
341
369
 
342
- It is possible to generating a PDF with a dependency graph using the `aliDeps`
370
+ It is possible to generating a PDF with a dependency graph using the `aliBuild deps`
343
371
  tool. Assuming you run it from a directory containing `alidist`, and you have
344
372
  Graphviz installed on your system, you can simply run:
345
373
 
346
- aliDeps O2 --outgraph graph.pdf
374
+ aliBuild deps O2 --outgraph graph.pdf
347
375
 
348
376
  The example above generates a dependency graph for the package `O2`, and saving
349
377
  the results to a PDF file named `graph.pdf`. This is what the graph looks like:
@@ -357,13 +385,25 @@ others (this can indicate an error in the recipes).
357
385
  Connections are color-coded as well: blue connections indicate a runtime
358
386
  dependency whereas a grey connection indicate a build dependency.
359
387
 
360
- By default, `aliDeps` runs the usual system checks to exclude packages that can
388
+ By default, `aliBuild deps` runs the usual system checks to exclude packages that can
361
389
  be taken from the system. If you want to display the full list of dependencies,
362
390
  you may want to use:
363
391
 
364
- aliDeps O2 --no-system --outgraph graph.pdf
392
+ aliBuild deps O2 --no-system --outgraph graph.pdf
393
+
394
+ Additional useful options for `aliBuild deps` include:
395
+
396
+ - `--neat`: Produce a graph with transitive reduction, removing edges that are
397
+ implied by other paths in the graph. This can make complex dependency graphs
398
+ easier to read.
399
+ - `--outdot FILE`: Keep the intermediate Graphviz dot file in `FILE`. Useful if
400
+ you want to manually modify the graph or generate output in different formats.
401
+
402
+ For example, to generate a simplified graph and keep the dot file:
403
+
404
+ aliBuild deps O2 --neat --outdot graph.dot --outgraph graph.pdf
365
405
 
366
- Please run `aliDeps --help` for further information.
406
+ Please run `aliBuild deps --help` for further information.
367
407
 
368
408
  ## Using the packages you have built
369
409
 
tests/test_build.py CHANGED
@@ -1,6 +1,7 @@
1
1
  from argparse import Namespace
2
2
  import os
3
3
  import os.path
4
+ import platform
4
5
  import re
5
6
  import sys
6
7
  import unittest
@@ -12,6 +13,19 @@ from collections import OrderedDict
12
13
  from alibuild_helpers.utilities import parseRecipe, resolve_tag
13
14
  from alibuild_helpers.build import doBuild, storeHashes, generate_initdotsh
14
15
 
16
+ # Determine architecture based on platform
17
+ def get_test_architecture():
18
+ if sys.platform == 'darwin':
19
+ machine = platform.machine()
20
+ if machine == 'arm64':
21
+ return 'osx_arm64'
22
+ else:
23
+ return 'osx_x86-64'
24
+ else:
25
+ return 'slc7_x86-64'
26
+
27
+ TEST_ARCHITECTURE = os.environ.get('ARCHITECTURE', get_test_architecture())
28
+
15
29
 
16
30
  TEST_DEFAULT_RELEASE = """\
17
31
  package: defaults-release
@@ -23,7 +37,7 @@ TEST_DEFAULT_RELEASE_BUILD_HASH = "27ce49698e818e8efb56b6eff6dd785e503df341"
23
37
 
24
38
  TEST_ZLIB_RECIPE = """\
25
39
  package: zlib
26
- version: v1.2.3
40
+ version: v1.3.1
27
41
  source: https://github.com/madler/zlib
28
42
  tag: master
29
43
  ---
@@ -32,7 +46,7 @@ make
32
46
  make install
33
47
  """
34
48
  TEST_ZLIB_GIT_REFS = "8822efa61f2a385e0bc83ca5819d608111b2168a\trefs/heads/master"
35
- TEST_ZLIB_BUILD_HASH = "8cd1f56c450f05ffbba3276bad08eae30f814999"
49
+ TEST_ZLIB_BUILD_HASH = "4d6a75f214dc7931a2a7d5ba82ea0568e652cd84"
36
50
 
37
51
  TEST_ROOT_RECIPE = """\
38
52
  package: ROOT
@@ -71,7 +85,7 @@ TEST_ROOT_GIT_REFS = """\
71
85
  87b87c4322d2a3fad315c919cb2e2dd73f2154dc\trefs/heads/master
72
86
  f7b336611753f1f4aaa94222b0d620748ae230c0\trefs/heads/v6-08-00-patches
73
87
  f7b336611753f1f4aaa94222b0d620748ae230c0\trefs/tags/test-tag"""
74
- TEST_ROOT_BUILD_HASH = ("8ec3f41b6b585ef86a02e9c595eed67f34d63f08")
88
+ TEST_ROOT_BUILD_HASH = ("1f3c771080f71b6c0d2e3d7a285698a20035da12")
75
89
 
76
90
 
77
91
  TEST_EXTRA_RECIPE = """\
@@ -88,20 +102,20 @@ f000\trefs/heads/master
88
102
  ba22\trefs/tags/v1
89
103
  ba22\trefs/tags/v2
90
104
  baad\trefs/tags/v3"""
91
- TEST_EXTRA_BUILD_HASH = ("5afae57bfc6a374e74c1c4427698ab5edebce0bc")
105
+ TEST_EXTRA_BUILD_HASH = ("6e7bc4976abf77b558cf7faf575ec51670f8d0e5")
92
106
 
93
107
 
94
108
  GIT_CLONE_REF_ZLIB_ARGS = ("clone", "--bare", "https://github.com/madler/zlib",
95
109
  "/sw/MIRROR/zlib", "--filter=blob:none"), ".", False
96
110
  GIT_CLONE_SRC_ZLIB_ARGS = ("clone", "-n", "https://github.com/madler/zlib",
97
- "/sw/SOURCES/zlib/v1.2.3/8822efa61f",
111
+ "/sw/SOURCES/zlib/v1.3.1/8822efa61f",
98
112
  "--dissociate", "--reference", "/sw/MIRROR/zlib", "--filter=blob:none"), ".", False
99
113
  GIT_SET_URL_ZLIB_ARGS = ("remote", "set-url", "--push", "origin", "https://github.com/madler/zlib"), \
100
- "/sw/SOURCES/zlib/v1.2.3/8822efa61f", False
114
+ "/sw/SOURCES/zlib/v1.3.1/8822efa61f", False
101
115
  GIT_CHECKOUT_ZLIB_ARGS = ("checkout", "-f", "master"), \
102
- "/sw/SOURCES/zlib/v1.2.3/8822efa61f", False
116
+ "/sw/SOURCES/zlib/v1.3.1/8822efa61f", False
103
117
 
104
- GIT_FETCH_REF_ROOT_ARGS = ("fetch", "-f", "--filter=blob:none", "https://github.com/root-mirror/root", "+refs/tags/*:refs/tags/*",
118
+ GIT_FETCH_REF_ROOT_ARGS = ("fetch", "-f", "--prune", "--filter=blob:none", "https://github.com/root-mirror/root", "+refs/tags/*:refs/tags/*",
105
119
  "+refs/heads/*:refs/heads/*"), "/sw/MIRROR/root", False
106
120
  GIT_CLONE_SRC_ROOT_ARGS = ("clone", "-n", "https://github.com/root-mirror/root",
107
121
  "/sw/SOURCES/ROOT/v6-08-30/f7b3366117",
@@ -143,9 +157,9 @@ def dummy_open(x, mode="r", encoding=None, errors=None):
143
157
  "/sw/BUILD/%s/defaults-release/.build_succeeded" % TEST_DEFAULT_RELEASE_BUILD_HASH: (0, StringIO("0")),
144
158
  "/sw/BUILD/%s/zlib/.build_succeeded" % TEST_ZLIB_BUILD_HASH: (0, StringIO("0")),
145
159
  "/sw/BUILD/%s/ROOT/.build_succeeded" % TEST_ROOT_BUILD_HASH: (0, StringIO("0")),
146
- "/sw/osx_x86-64/defaults-release/v1-1/.build-hash": (1, StringIO(TEST_DEFAULT_RELEASE_BUILD_HASH)),
147
- "/sw/osx_x86-64/zlib/v1.2.3-local1/.build-hash": (1, StringIO(TEST_ZLIB_BUILD_HASH)),
148
- "/sw/osx_x86-64/ROOT/v6-08-30-local1/.build-hash": (1, StringIO(TEST_ROOT_BUILD_HASH))
160
+ f"/sw/{TEST_ARCHITECTURE}/defaults-release/v1-1/.build-hash": (1, StringIO(TEST_DEFAULT_RELEASE_BUILD_HASH)),
161
+ f"/sw/{TEST_ARCHITECTURE}/zlib/v1.3.1-local1/.build-hash": (1, StringIO(TEST_ZLIB_BUILD_HASH)),
162
+ f"/sw/{TEST_ARCHITECTURE}/ROOT/v6-08-30-local1/.build-hash": (1, StringIO(TEST_ROOT_BUILD_HASH))
149
163
  }[x]
150
164
  except KeyError:
151
165
  return DEFAULT
@@ -163,17 +177,16 @@ def dummy_execute(x, **kwds):
163
177
  if re.match(".*ln -sfn.*TARS", s):
164
178
  return 0
165
179
  return {
166
- "/bin/bash -e -x /sw/SPECS/osx_x86-64/defaults-release/v1-1/build.sh 2>&1": 0,
167
- '/bin/bash -e -x /sw/SPECS/osx_x86-64/zlib/v1.2.3-local1/build.sh 2>&1': 0,
168
- '/bin/bash -e -x /sw/SPECS/osx_x86-64/ROOT/v6-08-30-local1/build.sh 2>&1': 0,
180
+ f"/bin/bash -e -x /sw/SPECS/{TEST_ARCHITECTURE}/defaults-release/v1-1/build.sh 2>&1": 0,
181
+ f'/bin/bash -e -x /sw/SPECS/{TEST_ARCHITECTURE}/zlib/v1.3.1-local1/build.sh 2>&1': 0,
182
+ f'/bin/bash -e -x /sw/SPECS/{TEST_ARCHITECTURE}/ROOT/v6-08-30-local1/build.sh 2>&1': 0,
169
183
  }[s]
170
184
 
171
185
 
172
186
  def dummy_readlink(x):
173
187
  return {
174
- "/sw/TARS/osx_x86-64/defaults-release/defaults-release-v1-1.osx_x86-64.tar.gz":
175
- "../../osx_x86-64/store/%s/%s/defaults-release-v1-1.osx_x86-64.tar.gz" %
176
- (TEST_DEFAULT_RELEASE_BUILD_HASH[:2], TEST_DEFAULT_RELEASE_BUILD_HASH)
188
+ f"/sw/TARS/{TEST_ARCHITECTURE}/defaults-release/defaults-release-v1-1.{TEST_ARCHITECTURE}.tar.gz":
189
+ f"../../{TEST_ARCHITECTURE}/store/{TEST_DEFAULT_RELEASE_BUILD_HASH[:2]}/{TEST_DEFAULT_RELEASE_BUILD_HASH}/defaults-release-v1-1.{TEST_ARCHITECTURE}.tar.gz"
177
190
  }[x]
178
191
 
179
192
 
@@ -224,13 +237,11 @@ class BuildTestCase(unittest.TestCase):
224
237
  @patch("os.listdir")
225
238
  @patch("alibuild_helpers.build.glob", new=lambda pattern: {
226
239
  "*": ["zlib"],
227
- "/sw/TARS/osx_x86-64/store/%s/%s/*gz" % (TEST_DEFAULT_RELEASE_BUILD_HASH[:2],
228
- TEST_DEFAULT_RELEASE_BUILD_HASH): [],
229
- "/sw/TARS/osx_x86-64/store/%s/%s/*gz" % (TEST_ZLIB_BUILD_HASH[:2], TEST_ZLIB_BUILD_HASH): [],
230
- "/sw/TARS/osx_x86-64/store/%s/%s/*gz" % (TEST_ROOT_BUILD_HASH[:2], TEST_ROOT_BUILD_HASH): [],
231
- "/sw/TARS/osx_x86-64/defaults-release/defaults-release-v1-1.osx_x86-64.tar.gz":
232
- ["../../osx_x86-64/store/%s/%s/defaults-release-v1-1.osx_x86-64.tar.gz" %
233
- (TEST_DEFAULT_RELEASE_BUILD_HASH[:2], TEST_DEFAULT_RELEASE_BUILD_HASH)],
240
+ f"/sw/TARS/{TEST_ARCHITECTURE}/store/{TEST_DEFAULT_RELEASE_BUILD_HASH[:2]}/{TEST_DEFAULT_RELEASE_BUILD_HASH}/*gz": [],
241
+ f"/sw/TARS/{TEST_ARCHITECTURE}/store/{TEST_ZLIB_BUILD_HASH[:2]}/{TEST_ZLIB_BUILD_HASH}/*gz": [],
242
+ f"/sw/TARS/{TEST_ARCHITECTURE}/store/{TEST_ROOT_BUILD_HASH[:2]}/{TEST_ROOT_BUILD_HASH}/*gz": [],
243
+ f"/sw/TARS/{TEST_ARCHITECTURE}/defaults-release/defaults-release-v1-1.{TEST_ARCHITECTURE}.tar.gz":
244
+ [f"../../{TEST_ARCHITECTURE}/store/{TEST_DEFAULT_RELEASE_BUILD_HASH[:2]}/{TEST_DEFAULT_RELEASE_BUILD_HASH}/defaults-release-v1-1.{TEST_ARCHITECTURE}.tar.gz"],
234
245
  }[pattern])
235
246
  @patch("alibuild_helpers.build.readlink", new=dummy_readlink)
236
247
  @patch("alibuild_helpers.build.banner", new=MagicMock(return_value=None))
@@ -243,9 +254,9 @@ class BuildTestCase(unittest.TestCase):
243
254
  mock_debug.side_effect = lambda *args: None
244
255
  mock_warning.side_effect = lambda *args: None
245
256
  mock_listdir.side_effect = lambda directory: {
246
- "/sw/TARS/osx_x86-64/defaults-release": ["defaults-release-v1-1.osx_x86-64.tar.gz"],
247
- "/sw/TARS/osx_x86-64/zlib": [],
248
- "/sw/TARS/osx_x86-64/ROOT": [],
257
+ f"/sw/TARS/{TEST_ARCHITECTURE}/defaults-release": [f"defaults-release-v1-1.{TEST_ARCHITECTURE}.tar.gz"],
258
+ f"/sw/TARS/{TEST_ARCHITECTURE}/zlib": [],
259
+ f"/sw/TARS/{TEST_ARCHITECTURE}/ROOT": [],
249
260
  }.get(directory, DEFAULT)
250
261
  os.environ["ALIBUILD_NO_ANALYTICS"] = "1"
251
262
 
@@ -257,7 +268,7 @@ class BuildTestCase(unittest.TestCase):
257
268
  docker=False,
258
269
  dockerImage=None,
259
270
  docker_extra_args=["--network=host"],
260
- architecture="osx_x86-64",
271
+ architecture=TEST_ARCHITECTURE,
261
272
  workDir="/sw",
262
273
  pkgname=["root"],
263
274
  configDir="/alidist",
@@ -271,7 +282,7 @@ class BuildTestCase(unittest.TestCase):
271
282
  debug=True,
272
283
  dryRun=False,
273
284
  aggressiveCleanup=False,
274
- environment={},
285
+ environment=[],
275
286
  autoCleanup=False,
276
287
  noDevel=[],
277
288
  onlyDeps=False,
@@ -319,7 +330,7 @@ class BuildTestCase(unittest.TestCase):
319
330
  doBuild(args, mock_parser)
320
331
  mock_warning.assert_called_with("%s.sh contains a recipe, which will be ignored", "defaults-release")
321
332
  mock_debug.assert_called_with("Everything done")
322
- mock_listdir.assert_called_with("/sw/TARS/osx_x86-64/ROOT")
333
+ mock_listdir.assert_called_with(f"/sw/TARS/{TEST_ARCHITECTURE}/ROOT")
323
334
  # We can't compare directly against the list of calls here as they
324
335
  # might happen in any order.
325
336
  mock_git_git.assert_has_calls(common_calls + [
@@ -406,8 +417,8 @@ class BuildTestCase(unittest.TestCase):
406
417
  self.assertNotIn("Extra", complete_initdotsh)
407
418
 
408
419
  # Dependencies must be loaded both for this build and for subsequent ones.
409
- self.assertIn('. "$WORK_DIR/$ALIBUILD_ARCH_PREFIX"/zlib/v1.2.3-1/etc/profile.d/init.sh', setup_initdotsh)
410
- self.assertIn('. "$WORK_DIR/$ALIBUILD_ARCH_PREFIX"/zlib/v1.2.3-1/etc/profile.d/init.sh', complete_initdotsh)
420
+ self.assertIn('. "$WORK_DIR/$ALIBUILD_ARCH_PREFIX"/zlib/v1.3.1-1/etc/profile.d/init.sh', setup_initdotsh)
421
+ self.assertIn('. "$WORK_DIR/$ALIBUILD_ARCH_PREFIX"/zlib/v1.3.1-1/etc/profile.d/init.sh', complete_initdotsh)
411
422
 
412
423
  # ROOT-specific variables must not be set during ROOT's build yet...
413
424
  self.assertNotIn("export ROOT_VERSION=", setup_initdotsh)
tests/test_cmd.py CHANGED
@@ -68,6 +68,28 @@ class CmdTestCase(unittest.TestCase):
68
68
  getstatusoutput_docker("echo test")
69
69
  mock_getstatusoutput.assert_called_with("env TEST_VAR=test_value ANOTHER_VAR=another_value /bin/bash -c 'echo test'", cwd=None)
70
70
 
71
+ @mock.patch("alibuild_helpers.cmd.getoutput")
72
+ @mock.patch("alibuild_helpers.cmd.getstatusoutput")
73
+ def test_DockerRunner_multiline_env_var(self, mock_getstatusoutput, mock_getoutput):
74
+ multiline_value = "line1\nline2\nline3"
75
+ extra_env = {"MULTILINE_VAR": multiline_value}
76
+
77
+ with DockerRunner("", extra_env=extra_env) as getstatusoutput_docker:
78
+ mock_getoutput.assert_not_called()
79
+ getstatusoutput_docker("echo test")
80
+ mock_getstatusoutput.assert_called_with("env MULTILINE_VAR='line1\nline2\nline3' /bin/bash -c 'echo test'", cwd=None)
81
+
82
+ @mock.patch("alibuild_helpers.cmd.getoutput")
83
+ @mock.patch("alibuild_helpers.cmd.getstatusoutput")
84
+ def test_DockerRunner_env_var_with_semicolon(self, mock_getstatusoutput, mock_getoutput):
85
+ semicolon_value = "value1;value2;value3"
86
+ extra_env = {"SEMICOLON_VAR": semicolon_value}
87
+
88
+ with DockerRunner("", extra_env=extra_env) as getstatusoutput_docker:
89
+ mock_getoutput.assert_not_called()
90
+ getstatusoutput_docker("echo test")
91
+ mock_getstatusoutput.assert_called_with("env SEMICOLON_VAR='value1;value2;value3' /bin/bash -c 'echo test'", cwd=None)
92
+
71
93
 
72
94
  if __name__ == '__main__':
73
95
  unittest.main()
tests/test_deps.py CHANGED
@@ -64,7 +64,8 @@ class DepsTestCase(unittest.TestCase):
64
64
  outdot="/tmp/out.dot",
65
65
  outgraph="/tmp/outgraph.pdf",
66
66
  package="AliRoot",
67
- defaults="release")
67
+ defaults="release",
68
+ environment=[])
68
69
  def fake_exists(n):
69
70
  return {"/alidist/aliroot.sh": True}
70
71
  with patch.object(os.path, "exists", fake_exists):
tests/test_doctor.py CHANGED
@@ -82,7 +82,8 @@ class DoctorTestCase(unittest.TestCase):
82
82
  noSystem="*",
83
83
  architecture="osx_x86-64",
84
84
  disable=[],
85
- defaults="release")
85
+ defaults="release",
86
+ environment=[])
86
87
 
87
88
  def fake_exists(n):
88
89
  return {"/alidist/aliroot.sh": True}
tests/test_init.py CHANGED
@@ -48,7 +48,8 @@ class InitTestCase(unittest.TestCase):
48
48
  defaults = "release",
49
49
  dryRun = True,
50
50
  fetchRepos = False,
51
- architecture = "slc7_x86-64"
51
+ architecture = "slc7_x86-64",
52
+ environment = {},
52
53
  )
53
54
  self.assertRaises(SystemExit, doInit, args)
54
55
  self.assertEqual(mock_info.mock_calls, [call('This will initialise local checkouts for %s\n--dry-run / -n specified. Doing nothing.', 'zlib,AliRoot')])
@@ -81,7 +82,8 @@ class InitTestCase(unittest.TestCase):
81
82
  defaults = "release",
82
83
  dryRun = False,
83
84
  fetchRepos = False,
84
- architecture = "slc7_x86-64"
85
+ architecture = "slc7_x86-64",
86
+ environment = {},
85
87
  )
86
88
  def fake_exists(n):
87
89
  return {"/alidist/aliroot.sh": True}
tests/test_sync.py CHANGED
@@ -16,19 +16,19 @@ GOOD_HASH = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"
16
16
  BAD_HASH = "baadf00dbaadf00dbaadf00dbaadf00dbaadf00d"
17
17
  NONEXISTENT_HASH = "TRIGGERS_A_404"
18
18
  GOOD_SPEC = { # fully present on the remote store
19
- "package": PACKAGE, "version": "v1.2.3", "revision": "1",
19
+ "package": PACKAGE, "version": "v1.3.1", "revision": "1",
20
20
  "hash": GOOD_HASH,
21
21
  "remote_revision_hash": GOOD_HASH,
22
22
  "remote_hashes": [GOOD_HASH],
23
23
  }
24
24
  BAD_SPEC = { # partially present on the remote store
25
- "package": PACKAGE, "version": "v1.2.3", "revision": "2",
25
+ "package": PACKAGE, "version": "v1.3.1", "revision": "2",
26
26
  "hash": BAD_HASH,
27
27
  "remote_revision_hash": BAD_HASH,
28
28
  "remote_hashes": [BAD_HASH],
29
29
  }
30
30
  MISSING_SPEC = { # completely absent from the remote store
31
- "package": PACKAGE, "version": "v1.2.3", "revision": "3",
31
+ "package": PACKAGE, "version": "v1.3.1", "revision": "3",
32
32
  "hash": NONEXISTENT_HASH,
33
33
  "remote_revision_hash": NONEXISTENT_HASH,
34
34
  "remote_hashes": [NONEXISTENT_HASH],
tests/test_utilities.py CHANGED
@@ -113,12 +113,102 @@ SUPPORT_URL="http://forum.sabayon.org/"
113
113
  BUG_REPORT_URL="https://bugs.sabayon.org/"
114
114
  """
115
115
 
116
+ ALMA_8_OS_RELEASE = """
117
+ NAME="AlmaLinux"
118
+ VERSION="8.10 (Cerulean Leopard)"
119
+ ID="almalinux"
120
+ ID_LIKE="rhel centos fedora"
121
+ VERSION_ID="8.10"
122
+ PLATFORM_ID="platform:el8"
123
+ PRETTY_NAME="AlmaLinux 8.10 (Cerulean Leopard)"
124
+ ANSI_COLOR="0;34"
125
+ LOGO="fedora-logo-icon"
126
+ CPE_NAME="cpe:/o:almalinux:almalinux:8::baseos"
127
+ HOME_URL="https://almalinux.org/"
128
+ DOCUMENTATION_URL="https://wiki.almalinux.org/"
129
+ BUG_REPORT_URL="https://bugs.almalinux.org/"
130
+
131
+ ALMALINUX_MANTISBT_PROJECT="AlmaLinux-8"
132
+ ALMALINUX_MANTISBT_PROJECT_VERSION="8.10"
133
+ REDHAT_SUPPORT_PRODUCT="AlmaLinux"
134
+ REDHAT_SUPPORT_PRODUCT_VERSION="8.10"
135
+ SUPPORT_END=2029-06-01
136
+ """
137
+
138
+ ALMA_9_OS_RELEASE = """
139
+ NAME="AlmaLinux"
140
+ VERSION="9.6 (Sage Margay)"
141
+ ID="almalinux"
142
+ ID_LIKE="rhel centos fedora"
143
+ VERSION_ID="9.6"
144
+ PLATFORM_ID="platform:el9"
145
+ PRETTY_NAME="AlmaLinux 9.6 (Sage Margay)"
146
+ ANSI_COLOR="0;34"
147
+ LOGO="fedora-logo-icon"
148
+ CPE_NAME="cpe:/o:almalinux:almalinux:9::baseos"
149
+ HOME_URL="https://almalinux.org/"
150
+ DOCUMENTATION_URL="https://wiki.almalinux.org/"
151
+ BUG_REPORT_URL="https://bugs.almalinux.org/"
152
+
153
+ ALMALINUX_MANTISBT_PROJECT="AlmaLinux-9"
154
+ ALMALINUX_MANTISBT_PROJECT_VERSION="9.6"
155
+ REDHAT_SUPPORT_PRODUCT="AlmaLinux"
156
+ REDHAT_SUPPORT_PRODUCT_VERSION="9.6"
157
+ SUPPORT_END=2032-06-01
158
+ """
159
+
160
+ ROCKY_8_OS_RELEASE = """
161
+ NAME="Rocky Linux"
162
+ VERSION="8.10 (Green Obsidian)"
163
+ ID="rocky"
164
+ ID_LIKE="rhel centos fedora"
165
+ VERSION_ID="8.10"
166
+ PLATFORM_ID="platform:el8"
167
+ PRETTY_NAME="Rocky Linux 8.10 (Green Obsidian)"
168
+ ANSI_COLOR="0;32"
169
+ LOGO="fedora-logo-icon"
170
+ CPE_NAME="cpe:/o:rocky:rocky:8:GA"
171
+ HOME_URL="https://rockylinux.org/"
172
+ BUG_REPORT_URL="https://bugs.rockylinux.org/"
173
+ SUPPORT_END="2029-05-31"
174
+ ROCKY_SUPPORT_PRODUCT="Rocky-Linux-8"
175
+ ROCKY_SUPPORT_PRODUCT_VERSION="8.10"
176
+ REDHAT_SUPPORT_PRODUCT="Rocky Linux"
177
+ REDHAT_SUPPORT_PRODUCT_VERSION="8.10"
178
+ """
179
+
180
+ ROCKY_9_OS_RELEASE = """
181
+ NAME="Rocky Linux"
182
+ VERSION="9.6 (Blue Onyx)"
183
+ ID="rocky"
184
+ ID_LIKE="rhel centos fedora"
185
+ VERSION_ID="9.6"
186
+ PLATFORM_ID="platform:el9"
187
+ PRETTY_NAME="Rocky Linux 9.6 (Blue Onyx)"
188
+ ANSI_COLOR="0;32"
189
+ LOGO="fedora-logo-icon"
190
+ CPE_NAME="cpe:/o:rocky:rocky:9::baseos"
191
+ HOME_URL="https://rockylinux.org/"
192
+ VENDOR_NAME="RESF"
193
+ VENDOR_URL="https://resf.org/"
194
+ BUG_REPORT_URL="https://bugs.rockylinux.org/"
195
+ SUPPORT_END="2032-05-31"
196
+ ROCKY_SUPPORT_PRODUCT="Rocky-Linux-9"
197
+ ROCKY_SUPPORT_PRODUCT_VERSION="9.6"
198
+ REDHAT_SUPPORT_PRODUCT="Rocky Linux"
199
+ REDHAT_SUPPORT_PRODUCT_VERSION="9.6"
200
+ """
201
+
116
202
  architecturePayloads = [
117
203
  ['osx_x86-64', False, [], ('','',''), 'Darwin', 'x86-64'],
118
204
  ['osx_arm64', False, [], ('','',''), 'Darwin', 'arm64'],
119
205
  ['slc5_x86-64', False, [], ('redhat', '5.XX', 'Boron'), 'Linux', 'x86-64'],
120
206
  ['slc6_x86-64', False, [], ('centos', '6.X', 'Carbon'), 'Linux', 'x86-64'],
121
207
  ['slc7_x86-64', False, [], ('centos', '7.X', 'Ptor'), 'Linux', 'x86-64'],
208
+ ['slc8_x86-64', True, ALMA_8_OS_RELEASE.split("\n"), ('AlmaLinux', '8.10', 'Cerulean Leopard'), 'Linux', 'x86_64'],
209
+ ['slc8_x86-64', True, ROCKY_8_OS_RELEASE.split("\n"), ('Rocky Linux', '8.10', 'Green Obsidian'), 'Linux', 'x86_64'],
210
+ ['slc9_x86-64', True, ALMA_9_OS_RELEASE.split("\n"), ('AlmaLinux', '9.6', 'Sage Margay'), 'Linux', 'x86_64'],
211
+ ['slc9_x86-64', True, ROCKY_9_OS_RELEASE.split("\n"), ('Rocky Linux', '9.6', 'Blue Onyx'), 'Linux', 'x86_64'],
122
212
  ['ubuntu1804_x86-64', True, UBUNTU_1804_OS_RELEASE.split("\n"), ('Ubuntu', '18.04', 'bionic'), 'Linux', 'x86-64'],
123
213
  ['ubuntu1604_x86-64', True, UBUNTU_1604_OS_RELEASE.split("\n"), ('Ubuntu', '16.04', 'xenial'), 'Linux', 'x86-64'],
124
214
  ['ubuntu1510_x86-64', False, [], ('Ubuntu', '15.10', 'wily'), 'Linux', 'x86-64'],
tests/test_workarea.py CHANGED
@@ -57,7 +57,7 @@ class WorkareaTestCase(unittest.TestCase):
57
57
  mock_exists.assert_has_calls([])
58
58
  mock_makedirs.assert_called_with("%s/sw/MIRROR" % getcwd(), exist_ok=True)
59
59
  mock_git.assert_called_once_with([
60
- "fetch", "-f", "--filter=blob:none", spec["source"], "+refs/tags/*:refs/tags/*", "+refs/heads/*:refs/heads/*",
60
+ "fetch", "-f", "--prune", "--filter=blob:none", spec["source"], "+refs/tags/*:refs/tags/*", "+refs/heads/*:refs/heads/*",
61
61
  ], directory="%s/sw/MIRROR/aliroot" % getcwd(), check=False, prompt=True)
62
62
  self.assertEqual(spec.get("reference"), "%s/sw/MIRROR/aliroot" % getcwd())
63
63
 
docs/README.md DELETED
@@ -1 +0,0 @@
1
- Read the documentation here: <http://alisw.github.io/alibuild/>