forked from sagemath/sage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
1073 lines (1033 loc) · 58.7 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# SAGE_ROOT/tox.ini: Environments for testing the Sage distribution
#
# To run a specific environment:
#
# $ tox -e docker-fedora-31-standard
#
# This will do a complete build of the Sage distribution in a Docker container, which will take a while.
#
# To do an incremental build based on the latest build of a beta version on GitHub Actions:
#
# $ tox -e docker-fedora-31-standard-incremental
#
# This will download a large (multi-gigabyte) Docker image from GitHub Packages (ghcr.io).
#
# Specific 'make' targets can be given as additional arguments after "--".
# For example, to only run the configuration phase:
#
# $ tox -e docker-debian-bullseye-standard -- config.status
#
# To build a single package (and its dependencies):
#
# $ tox -e docker-manylinux-2_24-i686-standard -- ppl
#
# It can be useful to run several of the environments in parallel. For example:
#
# $ tox -p auto -- config.status
#
# with local squid:
#
# $ EXTRA_DOCKER_BUILD_ARGS="--build-arg http_proxy=http://host.docker.internal:3128 --build-arg https_proxy=http://host.docker.internal:3128" tox -p auto -- config.status
[tox]
envlist =
#####
##### Sage-the-distribution tests
#####
check_configure,
#####
##### Sage-the-distribution portability tests
#####
# See https://doc.sagemath.org/html/en/developer/portability_testing.html
### "docker" environments copy sources from the source tree subject to the exclusions in
### the file ".dockerignore". This should work out of non-clean source trees, and all
### "docker" toxenvs can be run in parallel.
### Package factors:
###
### - minimal # Install a minimal set of system packages that supports bootstrapping and compiling Sage.
### - standard # Install all known system packages equivalent to standard packages that have spkg-configure.m4
### - maximal # Install all known system packages equivalent to standard/optional packages that have spkg-configure.m4
docker-ubuntu-trusty-toolchain-gcc_9-minimal,
docker-debian-bullseye-standard,
docker-fedora-34-standard,
docker-archlinux-latest-maximal,
docker-manylinux-2_24-i686-standard,
docker-conda-forge-standard,
### "local" targets should be run from a source tree that is freshly checked out
### (for example, by 'git worktree add ...') or has been cleaned by 'make bdist-clean' --
### because they build within the source tree (because we have no VPATH support).
### Only one "local" target can be run at a time.
### However, "local" targets install in a separate prefix (SAGE_LOCAL=.tox/TOXENV/local)
### rather than "local/" and also place log files into .tox/TOXENV/log, where TOXENV
### is the name of the environment. (The prefix can be configured by passing the
### environment variable PREFIX.)
#
# The "local-homebrew" toxenvs create an "isolated" homebrew installation (not in /usr/local).
# (However, many configure scripts still look for stuff in /usr/local.)
#
# By default, it runs "make build" (after bootstrapping and configuring)
# with SAGE_CHECK=yes and SAGE_CHECK_PACKAGES set to a good default,
# and V=0 so that screen output is limited.
#
# $ tox -e local-homebrew-macos-standard
#
# The value of MAKE is picked up from the environment, so you can do:
#
# $ MAKE="make -j8" tox -e local-homebrew-macos-standard
#
# Build targets can be passed as positional arguments (separated from tox options by "--"):
#
# $ tox -e local-homebrew-macos-standard -- ppl
# $ tox -e local-homebrew-macos-standard -- build ptest
#
# Also make variables can be passed as positional arguments; for example, to run the
# test suite:
#
# $ tox -e local-homebrew-macos-standard -- SAGE_CHECK=no build ptest SAGE_NUM_THREADS=4
#
# Or to rebuild a package with verbose output:
#
# $ tox -e local-homebrew-macos-standard -- ppl-uninstall ppl V=1
#
# The variant "local-homebrew-macos-usrlocal" uses the global installation in /usr/local
# instead. It may install packages or update packages. It will not remove packages.
# Use at your own risk.
#
###
### The "local-direct" toxenv passes the whole environment on to the sage build.
### Whatever is in PATH etc. will be used.
###
#
# $ tox -e local-direct -- openblas
#####
##### Delegation to src/tox.ini
#####
# included with (cd src && tox -p auto):
#
# doctest,
# coverage,
# startuptime,
# pycodestyle-minimal,
# relint,
# codespell,
#
# Also available:
#
# pycodestyle
requires =
# For repaired numerical factors in tox 4:
tox>=4.2.7
skipsdist = true
[testenv]
passenv =
EXTRA_CONFIGURE_ARGS
EXTRA_SAGE_PACKAGES
TARGETS_PRE
TARGETS_OPTIONAL
docker: EXTRA_DOCKER_BUILD_ARGS
docker: EXTRA_DOCKER_TAGS
docker: DOCKER_TAG
# Use DOCKER_BUILDKIT=0 for legacy builder
docker: DOCKER_BUILDKIT
docker: BUILDKIT_INLINE_CACHE
# Set for example to "with-system-packages configured with-targets-pre with-targets"
# to tag intermediate images.
docker: DOCKER_TARGETS
# If set, we use this prefix and push to it
docker: DOCKER_PUSH_REPOSITORY
# If set, we symlink this file into {envdir}/.docker/; this can be used for providing credentials for pushing
docker: DOCKER_CONFIG_FILE
docker-incremental: FROM_DOCKER_REPOSITORY
docker-incremental: FROM_DOCKER_TARGET
docker-incremental: FROM_DOCKER_TAG
local: MAKE
local: PREFIX
local: SAGE_NUM_THREADS
# Set to 1 to skip preliminary install phases before make is invoked
local: SKIP_SYSTEM_PKG_INSTALL
local: SKIP_BOOTSTRAP
local: SKIP_CONFIGURE
local: OPENBLAS_CONFIGURE
local-direct: *
setenv =
# By default, we bootstrap using autotools and do not allow downloads of the configure tarball.
BOOTSTRAP=./bootstrap
# For https downloads from upstream_url listed in checksums.ini, do not
# check certificates, to avoid problems on Docker images with outdated
# certificates and with system python3 on macOS (#29418)
SAGE_DOWNLOAD_FILE_OPTIONS=--no-check-certificate
# Set this to 'force' instead of 'yes' to make it an error if an spkg with spkg-configure and system package
# is not recognized.
WITH_SYSTEM_SPKG=yes
# Set this to 'yes' instead of 'no' to ignore missing system packages - by installing them one by one
# and ignoring errors. We use that to take care of old versions of distributions.
# For -maximal environments, the default is 'yes' but later we override it for rolling distributions
# (but not for unstable distributions that often have intermittent issues).
IGNORE_MISSING_SYSTEM_PACKAGES=no
maximal: IGNORE_MISSING_SYSTEM_PACKAGES=yes
# What system packages should be installed. Default: All standard packages with spkg-configure.
SAGE_PACKAGE_LIST_ARGS=--has-file=spkg-configure.m4 :standard:
recommended: EXTRA_SAGE_PACKAGES_3=_recommended $(head -n 1 build/pkgs/_recommended/dependencies)
develop: EXTRA_SAGE_PACKAGES_4=_develop $(head -n 1 build/pkgs/_develop/dependencies)
minimal: SAGE_PACKAGE_LIST_ARGS=_prereq
maximal: SAGE_PACKAGE_LIST_ARGS=:standard: :optional:
sitepackages: ENABLE_SYSTEM_SITE_PACKAGES=yes
sitepackages: CONFIG_CONFIGURE_ARGS_SITEPACKAGES=--enable-system-site-packages
conda-environment: SAGE_PACKAGE_LIST_ARGS=_prereq
conda-environment-{src,dev}: CONFIG_CONFIGURE_ARGS_SITEPACKAGES=--enable-system-site-packages
# Whether to add the system packages needed for bootstrapping
EXTRA_SAGE_PACKAGES_0=_bootstrap
nobootstrap: EXTRA_SAGE_PACKAGES_0=
# local envs need HOME set, also Docker 19.03 needs HOME
{local,docker}: HOME={envdir}
# for local envs we can guess the package system if it is not provided as a factor
local: SYSTEM=auto
#
# default tag is "latest"
#
docker: BASE_TAG=latest
#
# https://hub.docker.com/_/ubuntu?tab=description
# as of 2023-05, latest=jammy=22.04, rolling=lunar=23.04, devel=mantic=23.10
# ubuntu-focal does not have libgap-dev
#
ubuntu: SYSTEM=debian
ubuntu: BASE_IMAGE=ubuntu
ubuntu-toolchain: EXTRA_REPOSITORY_1=ppa:ubuntu-toolchain-r/test
ubuntu-toolchain-trusty: EXTRA_SYSTEM_PACKAGES=binutils-2.26
ubuntu-toolchain-trusty: EXTRA_PATH=/usr/lib/binutils-2.26/bin
ubuntu-deadsnakes: EXTRA_REPOSITORY_2=ppa:deadsnakes/ppa
ubuntu: EXTRA_REPOSITORIES={env:EXTRA_REPOSITORY_1:} {env:EXTRA_REPOSITORY_2:}
ubuntu-trusty: BASE_TAG=trusty
ubuntu-trusty: IGNORE_MISSING_SYSTEM_PACKAGES=yes
ubuntu-xenial: BASE_TAG=xenial
ubuntu-xenial: IGNORE_MISSING_SYSTEM_PACKAGES=yes
ubuntu-bionic: BASE_TAG=bionic
ubuntu-bionic: IGNORE_MISSING_SYSTEM_PACKAGES=yes
ubuntu-focal: BASE_TAG=focal
ubuntu-focal: IGNORE_MISSING_SYSTEM_PACKAGES=yes
ubuntu-jammy: BASE_TAG=jammy
ubuntu-lunar: BASE_TAG=lunar
ubuntu-mantic: BASE_TAG=mantic
#
# https://hub.docker.com/_/debian
# debian-buster does not have libfreetype-dev (it only has libfreetype6-dev)
# debian-bullseye does not have libgiac-dev
# debian-trixie does not have libbrial-dev
#
debian: SYSTEM=debian
debian: BASE_IMAGE=debian
debian-jessie: BASE_TAG=jessie
debian-jessie: IGNORE_MISSING_SYSTEM_PACKAGES=yes
debian-stretch: BASE_TAG=stretch
debian-stretch: IGNORE_MISSING_SYSTEM_PACKAGES=yes
debian-buster: BASE_TAG=buster
debian-buster: IGNORE_MISSING_SYSTEM_PACKAGES=yes
debian-bullseye: BASE_TAG=bullseye
debian-bullseye: IGNORE_MISSING_SYSTEM_PACKAGES=yes
debian-bookworm: BASE_TAG=bookworm
debian-trixie: BASE_TAG=trixie
debian-trixie: IGNORE_MISSING_SYSTEM_PACKAGES=yes
debian-sid: BASE_TAG=sid
#
# https://hub.docker.com/u/linuxmintd
#
linuxmint: SYSTEM=debian
linuxmint: IGNORE_MISSING_SYSTEM_PACKAGES=yes
linuxmint-17: BASE_IMAGE=linuxmintd/mint17
linuxmint-18: BASE_IMAGE=linuxmintd/mint18
linuxmint-19: BASE_IMAGE=linuxmintd/mint19
linuxmint-19.1: BASE_IMAGE=linuxmintd/mint19.1
linuxmint-19.2: BASE_IMAGE=linuxmintd/mint19.2
linuxmint-19.3: BASE_IMAGE=linuxmintd/mint19.3
linuxmint-20: BASE_IMAGE=linuxmintd/mint20
linuxmint-20.1: BASE_IMAGE=linuxmintd/mint20.1
linuxmint-20.2: BASE_IMAGE=linuxmintd/mint20.2
linuxmint-20.3: BASE_IMAGE=linuxmintd/mint20.3
linuxmint-21: BASE_IMAGE=linuxmintd/mint21
linuxmint-21.1: BASE_IMAGE=linuxmintd/mint21.1
linuxmint-21.2: BASE_IMAGE=linuxmintd/mint21.2
#
# https://hub.docker.com/_/fedora
# as of 2024-01, latest=39, rawhide=40
fedora: SYSTEM=fedora
fedora: BASE_IMAGE=fedora
fedora-26: BASE_TAG=26
fedora-26: IGNORE_MISSING_SYSTEM_PACKAGES=yes
fedora-27: BASE_TAG=27
fedora-27: IGNORE_MISSING_SYSTEM_PACKAGES=yes
fedora-28: BASE_TAG=28
fedora-28: IGNORE_MISSING_SYSTEM_PACKAGES=yes
fedora-29: BASE_TAG=29
fedora-29: IGNORE_MISSING_SYSTEM_PACKAGES=yes
fedora-30: BASE_TAG=30
fedora-30: IGNORE_MISSING_SYSTEM_PACKAGES=yes
fedora-31: BASE_TAG=31
fedora-32: BASE_TAG=32
fedora-33: BASE_TAG=33
fedora-34: BASE_TAG=34
fedora-35: BASE_TAG=35
fedora-36: BASE_TAG=36
fedora-37: BASE_TAG=37
fedora-37: IGNORE_MISSING_SYSTEM_PACKAGES=yes
fedora-38: BASE_TAG=38
fedora-38: IGNORE_MISSING_SYSTEM_PACKAGES=yes
fedora-39: BASE_TAG=39
fedora-39: IGNORE_MISSING_SYSTEM_PACKAGES=yes
fedora-40: BASE_TAG=40
fedora-40: IGNORE_MISSING_SYSTEM_PACKAGES=yes
#
# https://hub.docker.com/r/scientificlinux/sl
#
scientificlinux: SYSTEM=fedora
scientificlinux: BASE_IMAGE=scientificlinux/sl
scientificlinux: IGNORE_MISSING_SYSTEM_PACKAGES=yes
scientificlinux-6: BASE_TAG=6
scientificlinux-7: BASE_TAG=7
#
# https://hub.docker.com/_/centos
# https://quay.io/repository/centos/centos?tab=tags
#
centos: SYSTEM=fedora
centos: BASE_IMAGE=centos
centos: IGNORE_MISSING_SYSTEM_PACKAGES=yes
centos-7: BASE_TAG=centos7
centos-7: BOOTSTRAP=sed -i.bak s/https/http/ .upstream.d/*mirror_list; ./bootstrap
centos-stream: BASE_IMAGE=quay.io/centos/centos
centos-stream: BASE_TAG=stream
centos-stream-8: BASE_TAG=stream8
centos-stream-9: BASE_TAG=stream9
#
# https://hub.docker.com/_/almalinux
#
almalinux: SYSTEM=fedora
almalinux: BASE_IMAGE=almalinux
almalinux: IGNORE_MISSING_SYSTEM_PACKAGES=yes
almalinux-8: BASE_TAG=8
almalinux-9: BASE_TAG=9
#
# https://hub.docker.com/r/sheerluck/sage-on-gentoo-stage4/tags
#
gentoo: SYSTEM=gentoo
gentoo: BASE_IMAGE=sheerluck/sage-on-gentoo-stage4
gentoo-python3.10: BASE_TAG=latest-py10
gentoo-python3.11: BASE_TAG=latest-py11
gentoo-python3.12: BASE_TAG=latest-py12
gentoo: IGNORE_MISSING_SYSTEM_PACKAGES=no
#
# https://hub.docker.com/_/archlinux/
# 2023-09: libgiac went missing, hence IGNORE_MISSING_SYSTEM_PACKAGES=yes
#
archlinux: SYSTEM=arch
archlinux: BASE_IMAGE=archlinux
archlinux: IGNORE_MISSING_SYSTEM_PACKAGES=yes
#
# https://hub.docker.com/r/vbatts/slackware
#
slackware: SYSTEM=slackware
slackware: BASE_IMAGE=vbatts/slackware
slackware-14.2: BASE_TAG=14.2
slackware-15.0: BASE_TAG=15.0
slackware-current: BASE_TAG=current
slackware: IGNORE_MISSING_SYSTEM_PACKAGES=no
#
# https://github.com/orgs/void-linux/packages?repo_name=void-containers
#
voidlinux: SYSTEM=void
voidlinux: BASE_IMAGE=ghcr.io/void-linux/void-glibc-full
voidlinux-musl: BASE_IMAGE=ghcr.io/void-linux/void-musl-full
voidlinux-minimal: BASE_IMAGE=ghcr.io/void-linux/void-glibc
voidlinux-musl-minimal: BASE_IMAGE=ghcr.io/void-linux/void-musl
voidlinux: IGNORE_MISSING_SYSTEM_PACKAGES=no
#
# https://hub.docker.com/_/alpine/
#
alpine: SYSTEM=alpine
alpine: BASE_IMAGE=alpine
alpine-edge: BASE_TAG=edge
alpine: IGNORE_MISSING_SYSTEM_PACKAGES=yes
#
# https://hub.docker.com/r/continuumio
#
conda: SYSTEM=conda
conda: USE_CONDARC=/dev/null
conda-forge: BASE_IMAGE=continuumio/miniconda3
conda-forge: USE_CONDARC=condarc.yml
conda-forge: IGNORE_MISSING_SYSTEM_PACKAGES=no
conda-anaconda3: BASE_IMAGE=continuumio/anaconda3
conda-anaconda3: IGNORE_MISSING_SYSTEM_PACKAGES=yes
#
# https://hub.docker.com/r/nixos/nix/
#
nixos: SYSTEM=nix
nixos: BASE_IMAGE=nixos/nix
#
# https://hub.docker.com/r/opensuse/leap
# - OpenSUSE Leap 42 was superseded by the Leap 15 series.
# - As of 2023-05, latest = 15 = 15.5
# https://hub.docker.com/r/opensuse/tumbleweed
# - Rolling distribution
#
opensuse: SYSTEM=opensuse
opensuse: BASE_IMAGE=opensuse/leap
opensuse: IGNORE_MISSING_SYSTEM_PACKAGES=yes
opensuse-42: BASE_TAG=42
opensuse-15.0: BASE_TAG=15.0
opensuse-15.1: BASE_TAG=15.1
opensuse-15.2: BASE_TAG=15.2
opensuse-15.3: BASE_TAG=15.3
opensuse-15.4: BASE_TAG=15.4
opensuse-15.5: BASE_TAG=15.5
opensuse-15: BASE_TAG=15
opensuse-tumbleweed: BASE_IMAGE=opensuse/tumbleweed
opensuse-tumbleweed: IGNORE_MISSING_SYSTEM_PACKAGES=no
#
# Other architectures:
#
# Many docker images for another architecture are named the same, in the arch prefix.
# All work for Docker on Mac; but only i386 works for Linux Docker.
#
# According to https://github.com/docker-library/official-images#architectures-other-than-amd64
# architectures officially supported by Docker, Inc. for running Docker:
# - amd64,arm32v6,arm32v7,arm64v8,
# - windows-amd64 # https://hub.docker.com/u/winamd64/
# Other architectures built by official images:
# (but not officially supported by Docker, Inc.)
# - arm32v5,ppc64le,s390x,i386
#
arm32v5: ARCH_IMAGE_PREFIX=arm32v5/
arm32v6: ARCH_IMAGE_PREFIX=arm32v6/
arm32v7: ARCH_IMAGE_PREFIX=arm32v7/
arm64v8: ARCH_IMAGE_PREFIX=arm64v8/
i386: ARCH_IMAGE_PREFIX=i386/
ppc64le: ARCH_IMAGE_PREFIX=ppc64le/
s390x: ARCH_IMAGE_PREFIX=s390x/
#
# For Linux Docker, we need to work with known multiarch images.
# https://www.ecliptik.com/Cross-Building-and-Running-Multi-Arch-Docker-Images/
# (or we would need to change our tests from "docker build" to "docker run")
#
# https://hub.docker.com/r/multiarch/ubuntu-core:
# multiarch/ubuntu-core:arm64-bionic, multiarch/ubuntu-core:armhf-bionic
ubuntu-arm64: BASE_IMAGE=ubuntu-core
ubuntu-arm64: ARCH_IMAGE_PREFIX=multiarch/
ubuntu-arm64: ARCH_TAG_PREFIX=arm64-
ubuntu-armhf: BASE_IMAGE=ubuntu-core
ubuntu-armhf: ARCH_IMAGE_PREFIX=multiarch/
ubuntu-armhf: ARCH_TAG_PREFIX=armhf-
#
# https://hub.docker.com/u/raspbian
#
raspbian: SYSTEM=debian
raspbian: ARCH_IMAGE_PREFIX=
raspbian: IGNORE_MISSING_SYSTEM_PACKAGES=yes
raspbian-jessie: BASE_IMAGE=raspbian/jessie
raspbian-stretch: BASE_IMAGE=raspbian/stretch
# As of 2020-06, there is no raspbian/buster image, so we dist-upgrade from stretch.
# https://www.raspberrypi.org/blog/buster-the-new-version-of-raspbian/
raspbian-buster: BASE_IMAGE=raspbian/stretch
raspbian-buster: DIST_UPGRADE=s/stretch/buster/g
#
# https://hub.docker.com/u/linuxmintd
#
linuxmint: ARCH_IMAGE_PREFIX=
linuxmint: ARCH_IMAGE_SUFFIX=-amd64
linuxmint-i386: ARCH_IMAGE_SUFFIX=-i386
#
# manylinux.
# https://github.com/pypa/manylinux
#
# There are manylinux-1, manylinux-2010, manylinux-2014, and manylinux_2_24.
# manylinux-1 is too old - it only has python2.4, which is not supported by
# sage_bootstrap; it will reach its EOL on Jan 1, 2022.
# Our default is manylinux-2014.
#
# Default arch is x86_64. Use -i686 (or our alias -i386) for 32-bit build.
# manylinux-2014 and newer support more archs.
#
manylinux: SYSTEM=fedora
manylinux: IGNORE_MISSING_SYSTEM_PACKAGES=yes
manylinux: BASE_IMAGE=quay.io/pypa/manylinux2014
manylinux-1: BASE_IMAGE=quay.io/pypa/manylinux1
manylinux-1: BOOTSTRAP=./bootstrap -D
manylinux-2010: BASE_IMAGE=quay.io/pypa/manylinux2010
manylinux-2014: BASE_IMAGE=quay.io/pypa/manylinux2014
manylinux-2_24: SYSTEM=debian
manylinux-2_24: BASE_IMAGE=quay.io/pypa/manylinux_2_24
manylinux-2_28: BASE_IMAGE=quay.io/pypa/manylinux_2_28
manylinux-{2_24,2_28}: BOOTSTRAP=ACLOCAL_PATH=/usr/share/aclocal ./bootstrap
manylinux: ARCH_IMAGE_PREFIX=
manylinux: ARCH_IMAGE_SUFFIX=_x86_64
manylinux-i686: ARCH_IMAGE_SUFFIX=_i686
manylinux-i386: ARCH_IMAGE_SUFFIX=_i686
manylinux-aarch64: ARCH_IMAGE_SUFFIX=_aarch64
manylinux-ppc64le: ARCH_IMAGE_SUFFIX=_ppc64le
manylinux-s390x: ARCH_IMAGE_SUFFIX=_s390x
#
# https://hub.docker.com/r/nvidia/cuda
#
ubuntu-nvidia-cuda: BASE_IMAGE=nvidia/cuda
centos-nvidia-cuda: BASE_IMAGE=nvidia/cuda
nvidia-cuda: ARCH_TAG_PREFIX=11.0-devel-
nvidia-cuda-11.0: ARCH_TAG_PREFIX=11.0-devel-
ubuntu-focal-nvidia-cuda: BASE_TAG=ubuntu20.04
ubuntu-bionic-nvidia-cuda: BASE_TAG=ubuntu18.04
ubuntu-xenial-nvidia-cuda: BASE_TAG=ubuntu16.04
#
# Resulting full image:tag name
#
docker: FULL_BASE_IMAGE_AND_TAG={env:ARCH_IMAGE_PREFIX:}{env:BASE_IMAGE}{env:ARCH_IMAGE_SUFFIX:}:{env:ARCH_TAG_PREFIX:}{env:BASE_TAG}{env:ARCH_TAG_SUFFIX:}
docker-incremental: FULL_BASE_IMAGE_AND_TAG={env:FROM_DOCKER_REPOSITORY:ghcr.io/sagemath/sage/}sage-$(echo {envname} | sed -E "s/(docker-|-incremental|-sitepackages)//g")-{env:FROM_DOCKER_TARGET:with-targets}:{env:FROM_DOCKER_TAG:dev}
docker-incremental: SKIP_SYSTEM_PKG_INSTALL=yes
docker-incremental-sitepackages: SKIP_SYSTEM_PKG_INSTALL=no
#
docker-nobootstrap: BOOTSTRAP=./bootstrap -D
###
### "local" envs
###
local: SHARED_CACHE_DIR={toxworkdir}/Caches
local: SETENV=:
local: SETENV_CONFIGURE=:
local-nobootstrap: BOOTSTRAP=:
local-!direct: PATH=/usr/bin:/bin:/usr/sbin:/sbin
local-sudo: __SUDO=--sudo
local-root: CONFIG_CONFIGURE_ARGS_ROOT=--enable-build-as-root
# brew caches downloaded files in ${HOME}/Library/Caches. We share it between different toxenvs.
homebrew: SYSTEM=homebrew
local-homebrew: HOMEBREW={envdir}/homebrew
# /opt/homebrew is the default install location on arm64 macOS
local-homebrew-opthomebrew: HOMEBREW=/opt/homebrew
# /usr/local is the default install location on x86_64 macOS
local-{homebrew-usrlocal,nohomebrew}: HOMEBREW=/usr/local
# local-macos-nohomebrew: "best effort" isolation to avoid using a homebrew installation in /usr/local
# We use liblzma from the macOS system - which is available but its headers are not (neither is the xz executable).
# So we use /usr/local/opt/xz/{bin,include} (but not lib!).
# This ensures that /usr/bin/python3 is accepted by configure - this is needed until #30948 is done.
local-macos-nohomebrew: PATH={env:HOMEBREW}/opt/xz/bin:{env:HOMEBREW}/opt/gpatch/bin:{env:HOMEBREW}/opt/cmake/bin:/usr/bin:/bin:/usr/sbin:/sbin
local-macos-nohomebrew: CPATH={env:HOMEBREW}/opt/xz/include
local-homebrew: PATH={env:HOMEBREW}/bin:/usr/bin:/bin:/usr/sbin:/sbin
local-{homebrew-nokegonly,nohomebrew}: BOOTSTRAP=ACLOCAL_PATH="$HOMEBREW/opt/gettext/share/aclocal:$ACLOCAL_PATH" PATH="$HOMEBREW/opt/gettext/bin/:$HOMEBREW/bin:$PATH" ./bootstrap
local-homebrew-!nokegonly: SETENV=. .homebrew-build-env
local-homebrew: IGNORE_MISSING_SYSTEM_PACKAGES=no
# macports
macports: SYSTEM=macports
local-macports: MP_PREFIX={envdir}/macports
local-macports-optlocal: MP_PREFIX=/opt/local
local-macports-optlocal: SUDO=sudo
local-macports-optlocal: __SUDO=--sudo
local-macports: PATH={env:MP_PREFIX}/bin:/usr/bin:/bin:/usr/sbin:/sbin
local-macports: CPATH={env:MP_PREFIX}/include
local-macports: LIBRARY_PATH={env:MP_PREFIX}/lib
local-macports: SETENV=eval $(build/bin/sage-print-system-package-command {env:SYSTEM} setup-build-env)
# conda
local-conda: CONDA_PREFIX={envdir}/conda
local-conda: PATH={env:CONDA_PREFIX}/bin:/usr/bin:/bin:/usr/sbin:/sbin
local-conda: CONDA_PKGS_DIRS={env:SHARED_CACHE_DIR}/conda_pkgs
local-conda: CONDA_OS=$(uname | sed 's/^Darwin/MacOSX/;')
local-conda: CONDA_ARCH=$(uname -m)
local-conda-forge: CONDA_INSTALLER_URL_BASE=https://github.com/conda-forge/miniforge/releases/latest/download/
local-conda-forge: CONDA_INSTALLER_FILE=Miniforge3-{env:CONDA_OS}-{env:CONDA_ARCH}.sh
local-conda-miniconda: CONDA_INSTALLER_URL_BASE=https://repo.anaconda.com/miniconda/
local-conda-miniconda: CONDA_INSTALLER_FILE=Miniconda3-latest-{env:CONDA_OS}-{env:CONDA_ARCH}.sh
local-conda: SETENV=. {env:CONDA_PREFIX}/bin/activate base
local-conda-environment: CONDA_SAGE_ENVIRONMENT=sage-build
local-conda-environment: CONDA_SAGE_ENVIRONMENT_DIR=
local-conda-environment-src: CONDA_SAGE_ENVIRONMENT=sage
local-conda-environment-src: CONDA_SAGE_ENVIRONMENT_DIR=src/
local-conda-environment: CONDA_SAGE_ENVIRONMENT_FILE=environment-{env:PYTHON_MAJOR}.{env:PYTHON_MINOR}.yml
local-conda-environment-optional: CONDA_SAGE_ENVIRONMENT_FILE=environment-optional-{env:PYTHON_MAJOR}.{env:PYTHON_MINOR}.yml
local-conda-environment-dev: CONDA_SAGE_ENVIRONMENT=sage-dev
local-conda-environment-dev: CONDA_SAGE_ENVIRONMENT_DIR=src/
local-conda-environment-dev: CONDA_SAGE_ENVIRONMENT_FILE=environment-dev-{env:PYTHON_MAJOR}.{env:PYTHON_MINOR}.yml
local-conda-environment: SETENV_CONFIGURE=( {env:CONDA_PREFIX}/bin/conda env create -n {env:CONDA_SAGE_ENVIRONMENT} --file {env:CONDA_SAGE_ENVIRONMENT_DIR:}{env:CONDA_SAGE_ENVIRONMENT_FILE} || {env:CONDA_PREFIX}/bin/conda env update -n {env:CONDA_SAGE_ENVIRONMENT} --file {env:CONDA_SAGE_ENVIRONMENT_DIR:}{env:CONDA_SAGE_ENVIRONMENT_FILE} ) && . {env:CONDA_PREFIX}/bin/activate {env:CONDA_SAGE_ENVIRONMENT}
#
# Configuration factors
#
# - python
#
# Setting "--with-system-python3=yes" explicitly in case we change the configure default
# to "--with-system-python3=force" as originally proposed in #32060.
#
# For all factors that set "--with-system-python3=force",
# we add "_bootstrap liblzma bzip2 libffi libpng zlib" to EXTRA_SAGE_PACKAGES_5
# so that the configured python3 can be accepted by configure.
PYTHON_MAJOR=3
PYTHON_MINOR=10
python3.9: PYTHON_MINOR=9
python3.10: PYTHON_MINOR=10
python3.11: PYTHON_MINOR=11
python3.12: PYTHON_MINOR=12
CONFIG_CONFIGURE_ARGS_1=--with-system-python3=yes
python3_spkg: CONFIG_CONFIGURE_ARGS_1=--without-system-python3
python3.9,python3.10,python3.11,python3.12: CONFIG_CONFIGURE_ARGS_1=--with-system-python3=force --with-python=python{env:PYTHON_MAJOR}.{env:PYTHON_MINOR}
# As of 2023-9, Xcode 15.0.0, this is Python 3.9.6.
macos-python3_xcode: CONFIG_CONFIGURE_ARGS_1=--with-system-python3=force --with-python=/usr/bin/python3
macos-{python3_xcode,nohomebrew}-{python3.9}: CONFIG_CONFIGURE_ARGS_1=--with-system-python3=force --with-python=/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/{env:PYTHON_MAJOR}.{env:PYTHON_MINOR}/bin/python3
# Homebrew keg installs
homebrew-{python3.9,python3.10,python3.11,python3.12}: CONFIG_CONFIGURE_ARGS_1=--with-system-python3=force --with-python={env:HOMEBREW}/opt/python@{env:PYTHON_MAJOR}.{env:PYTHON_MINOR}/bin/python3
# Installers from https://www.python.org/downloads/macos/ (must manually download and install)
macos-python3_pythonorg: CONFIG_CONFIGURE_ARGS_1=--with-system-python3=force --with-python=/Library/Frameworks/Python.framework/Versions/{env:PYTHON_MAJOR}.{env:PYTHON_MINOR}/bin/python3
# MacPorts
macports-{python3.8,python3.9,python3.10,python3.11,python3.12}: CONFIG_CONFIGURE_ARGS_1=--with-system-python3=force --with-python={env:MP_PREFIX}/bin/python{env:PYTHON_MAJOR}.{env:PYTHON_MINOR}
# https://github.com/pypa/manylinux
manylinux-standard: CONFIG_CONFIGURE_ARGS_1=--with-system-python3=force --with-python=/opt/python/cp{env:PYTHON_MAJOR}{env:PYTHON_MINOR}-cp{env:PYTHON_MAJOR}{env:PYTHON_MINOR}/bin/python3
conda: CONFIG_CONFIGURE_ARGS_1=--with-system-python3=force --with-python=python3
conda: EXTRA_SAGE_PACKAGES_5=_bootstrap liblzma bzip2 libffi libpng zlib
python3.9,python3.10,python3.11,python3.12: EXTRA_SAGE_PACKAGES_5=_python{env:PYTHON_MAJOR}.{env:PYTHON_MINOR} _bootstrap liblzma bzip2 libffi libpng zlib
manylinux-{python3.9,python3.10,python3.11,python3.12}: EXTRA_SAGE_PACKAGES_5=_bootstrap liblzma bzip2 libffi libpng
macos-python3_pythonorg: EXTRA_SAGE_PACKAGES_5=_bootstrap liblzma bzip2 libffi libpng zlib
macos-python3_xcode: EXTRA_SAGE_PACKAGES_5=_bootstrap liblzma bzip2 libffi libpng zlib
{centos-stream,almalinux}-8-python3.9: EXTRA_SYSTEM_PACKAGES=python39 python39-devel
#
# - toolchain
#
gcc_spkg: CONFIG_CONFIGURE_ARGS_2=--without-system-gcc
gcc_8: CONFIG_CONFIGURE_ARGS_2=--with-system-gcc=force CC=gcc-8 CXX=g++-8 FC=gfortran-8
gcc_8: EXTRA_SAGE_PACKAGES_2=_gcc8
gcc_9: CONFIG_CONFIGURE_ARGS_2=--with-system-gcc=force CC=gcc-9 CXX=g++-9 FC=gfortran-9
gcc_9: EXTRA_SAGE_PACKAGES_2=_gcc9
gcc_10: CONFIG_CONFIGURE_ARGS_2=--with-system-gcc=force CC=gcc-10 CXX=g++-10 FC=gfortran-10
gcc_10: EXTRA_SAGE_PACKAGES_2=_gcc10
gcc_11: CONFIG_CONFIGURE_ARGS_2=--with-system-gcc=force CC=gcc-11 CXX=g++-11 FC=gfortran-11
gcc_11: EXTRA_SAGE_PACKAGES_2=_gcc11
gcc_12: CONFIG_CONFIGURE_ARGS_2=--with-system-gcc=force CC=gcc-12 CXX=g++-12 FC=gfortran-12
gcc_12: EXTRA_SAGE_PACKAGES_2=_gcc12
gcc_13: CONFIG_CONFIGURE_ARGS_2=--with-system-gcc=force CC=gcc-13 CXX=g++-13 FC=gfortran-13
gcc_13: EXTRA_SAGE_PACKAGES_2=_gcc13
gcc_14: CONFIG_CONFIGURE_ARGS_2=--with-system-gcc=force CC=gcc-14 CXX=g++-14 FC=gfortran-14
gcc_14: EXTRA_SAGE_PACKAGES_2=_gcc14
centos-7-devtoolset: CONFIG_CONFIGURE_ARGS_2=--with-system-gcc=force
centos-7-devtoolset-gcc_9: DEVTOOLSET=9
centos-7-devtoolset-gcc_10: DEVTOOLSET=10
centos-7-devtoolset-gcc_11: DEVTOOLSET=11
centos-7-devtoolset-gcc_12: DEVTOOLSET=12
llvm: CONFIG_CONFIGURE_ARGS_2=--with-system-gcc=force CC=clang CXX=clang++
llvm: EXTRA_SAGE_PACKAGES_2=llvm
# LLVM is keg-only
homebrew-llvm: CONFIG_CONFIGURE_ARGS_2=--with-system-gcc=force CC={env:HOMEBREW}/opt/llvm/bin/clang CXX={env:HOMEBREW}/opt/llvm/bin/clang++
macos-nohomebrew: CONFIG_CONFIGURE_ARGS_2=--with-system-gcc=force CC="$CONFIGURED_CC" CXX="$CONFIGURED_CXX" --without-system-gmp --without-system-mpfr --without-system-readline --without-system-boost_cropped
macos-nohomebrew: CONFIGURED_CXX=g++ -isysroot {env:MACOS_SDK}
macos-nohomebrew: CONFIGURED_CC=gcc -isysroot {env:MACOS_SDK}
# Prevent /usr/local to leak in:
# - We use libgd only used in a very limited way, in {matrix,vector}_mod_2_dense. Disable search for other packages.
macos-nohomebrew: LIBGD_CONFIGURE=--without-freetype --without-raqm --without-fontconfig --without-jpeg --without-liq --without-xpm --without-tiff --without-webp --without-heif --without-avif
macos-nohomebrew: FREETYPE_CONFIGURE=--without-harfbuzz
macos-nohomebrew: PILLOW_BUILD_EXT=--disable-platform-guessing --disable-jpeg2000 --disable-imagequant --disable-tiff --disable-lcms --disable-webp --disable-webpmux --disable-xcb
macos-nohomebrew: ZLIB_ROOT={env:MACOS_SDK}/usr
macports: CONFIG_CONFIGURE_ARGS_2=--with-system-gcc=force CC="$CONFIGURED_CC" CXX="$CONFIGURED_CXX"
macports: CONFIGURED_CC=gcc -isysroot {env:MACOS_SDK}
macports: CONFIGURED_CXX=g++ -isysroot {env:MACOS_SDK}
macports-clang_13: CONFIGURED_CC=clang-mp-13 -isysroot {env:MACOS_SDK}
macports-clang_13: CONFIGURED_CXX=clang-mp-13 -isysroot {env:MACOS_SDK}
#
# macOS SDK/deployment target settings
#
{macos,macports}: MACOS_SDK=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
# python3 from XCode 12 has MACOSX_DEPLOYMENT_TARGET=10.14.6. Selecting a lower target would cause /usr/bin/python3 to be rejected by configure.
macos-10.14: MACOS_SDK=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk
macos-10.14: MACOSX_DEPLOYMENT_TARGET=10.14.6
macos-10.15: MACOS_SDK=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk
macos-10.15: MACOSX_DEPLOYMENT_TARGET=10.15
macos-11.1: MACOS_SDK=/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk
macos-11.1: MACOSX_DEPLOYMENT_TARGET=11.1
macos-11.3: MACOS_SDK=/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk
macos-11.3: MACOSX_DEPLOYMENT_TARGET=11.3
macos-12.1: MACOS_SDK=/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk
macos-12.1: MACOSX_DEPLOYMENT_TARGET=12.1
macos-12.3: MACOS_SDK=/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk
macos-12.3: MACOSX_DEPLOYMENT_TARGET=12.3
macos-13.3: MACOS_SDK=/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk
macos-13.3: MACOSX_DEPLOYMENT_TARGET=13.3
macos-14.0: MACOS_SDK=/Library/Developer/CommandLineTools/SDKs/MacOSX14.0.sdk
macos-14.0: MACOSX_DEPLOYMENT_TARGET=14.0
# XCode versions, as installed on GH Actions runners
# only in https://github.com/actions/runner-images/blob/main/images/macos/macos-11-Readme.md#xcode
xcode_11.7: XCODE_VERSION=11.7
xcode_12.4: XCODE_VERSION=12.4
xcode_12.5.1: XCODE_VERSION=12.5.1
xcode_13.0: XCODE_VERSION=13.0
# in above and also in https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#xcode
xcode_13.1: XCODE_VERSION=13.1
xcode_13.2.1: XCODE_VERSION=13.2.1
# only in https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#xcode
xcode_13.3.1: XCODE_VERSION=13.3.1
xcode_13.4.1: XCODE_VERSION=13.4.1
xcode_14.0.1: XCODE_VERSION=14.0.1
# in avove and also in https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#xcode
xcode_14.1: XCODE_VERSION=14.1
xcode_14.2: XCODE_VERSION=14.2
# only in https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#xcode
xcode_14.3.1: XCODE_VERSION=14.3.1
xcode_15.0: XCODE_VERSION=15.0
#
# Resulting full configuration args, including EXTRA_CONFIGURE_ARGS from the user environment
#
CONFIGURE_ARGS=--enable-experimental-packages --enable-download-from-upstream-url {env:CONFIG_CONFIGURE_ARGS_ROOT:} {env:CONFIG_CONFIGURE_ARGS_SITEPACKAGES:} {env:CONFIG_CONFIGURE_ARGS_1:} {env:CONFIG_CONFIGURE_ARGS_2:} {env:EXTRA_CONFIGURE_ARGS:}
#
# Resulting EXTRA_SAGE_PACKAGES
#
ALL_EXTRA_SAGE_PACKAGES={env:EXTRA_SAGE_PACKAGES_0:} {env:EXTRA_SAGE_PACKAGES_1:} {env:EXTRA_SAGE_PACKAGES_2:} {env:EXTRA_SAGE_PACKAGES_3:} {env:EXTRA_SAGE_PACKAGES_4:} {env:EXTRA_SAGE_PACKAGES_5:} {env:EXTRA_SAGE_PACKAGES:}
sitepackages: IGNORE_MISSING_SYSTEM_PACKAGES=yes
# https://docs.docker.com/engine/reference/commandline/buildx_build/#progress
docker: BUILDKIT_PROGRESS=plain
# environment will be skipped if regular expression does not match against the sys.platform string
platform =
local-macos: darwin
allowlist_externals =
bash
docker: docker
homebrew: brew
#commands_pre =
commands =
#
# All "local" environments
#
local: bash -c 'if [ ! -d {env:HOME}/Library/Caches ]; then mkdir -p {env:SHARED_CACHE_DIR} && mkdir -p {env:HOME}/Library && ln -sf {toxworkdir}/Caches {env:HOME}/Library/; fi'
#
# local-macos
#
local-macos: bash -c 'if [ -n "{env:XCODE_VERSION:}" ]; then sudo xcode-select -s /Applications/Xcode_{env:XCODE_VERSION:}.app; fi;'
#
# local-homebrew
#
# https://docs.brew.sh/Installation
homebrew: bash -c 'if [ ! -x {env:HOMEBREW}/bin/brew ]; then mkdir -p {env:HOMEBREW} && cd {env:HOMEBREW} && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 ; fi'
homebrew: bash -c 'case "{env:SKIP_SYSTEM_PKG_INSTALL:}" in 1|y*|Y*);; *) export PATH="build/bin:$PATH" && PACKAGES=$(sage-get-system-packages homebrew $(sage-package list {env:SAGE_PACKAGE_LIST_ARGS}) {env:ALL_EXTRA_SAGE_PACKAGES}); {env:HOMEBREW}/bin/brew install $PACKAGES; {env:HOMEBREW}/bin/brew upgrade $PACKAGES;; esac'
#
# local-macports
#
# https://guide.macports.org/#installing.macports.source.multiple
local-macports: bash -c 'if [ ! -x "{env:MP_PREFIX}/bin/port" ]; then (mkdir -p {envdir}/macports-src && cd {envdir}/macports-src && curl -L https://distfiles.macports.org/MacPorts/MacPorts-2.7.2.tar.gz | tar xz --strip 1 && ./configure --prefix="{env:MP_PREFIX}" --with-applications-dir=$MP_PREFIX/Applications --with-no-root-privileges --without-startupitems && make && {env:SUDO:} make install); fi'
local-macports: bash -c 'case "{env:SKIP_SYSTEM_PKG_INSTALL:}" in 1|y*|Y*);; *) {env:SUDO:} port selfupdate && {env:SUDO:} port upgrade outdated && PACKAGES=$(build/bin/sage-get-system-packages {env:SYSTEM} $(PATH=build/bin:$PATH build/bin/sage-package list {env:SAGE_PACKAGE_LIST_ARGS}) {env:ALL_EXTRA_SAGE_PACKAGES}); eval $(build/bin/sage-print-system-package-command {env:SYSTEM} {env:__SUDO:} --yes --no-install-recommends install $PACKAGES) || [ "$IGNORE_MISSING_SYSTEM_PACKAGES" = yes ] && echo "(ignoring errors)" ;; esac'
#
# local-conda
#
# https://docs.anaconda.com/anaconda/install/silent-mode/
# https://docs.anaconda.com/anaconda/user-guide/tasks/shared-pkg-cache/
# https://www.anaconda.com/conda-configuration-engine-power-users/
local-conda: bash -c 'mkdir -p {env:SHARED_CACHE_DIR}/conda_pkgs {env:CONDA_PREFIX}'
local-conda: bash -c 'echo > {env:CONDA_PREFIX}/.condarc "pkgs_dirs:"'
local-conda: bash -c 'echo >> {env:CONDA_PREFIX}/.condarc " - {env:SHARED_CACHE_DIR}/conda_pkgs"'
local-conda: bash -c 'cat {env:USE_CONDARC} >> {env:CONDA_PREFIX}/.condarc'
local-conda: bash -c 'if [ ! -x {env:CONDA_PREFIX}/bin/conda ]; then mkdir {env:CONDA_PREFIX}/conda-meta && curl -L {env:CONDA_INSTALLER_URL_BASE}{env:CONDA_INSTALLER_FILE} -C - -o {env:SHARED_CACHE_DIR}/{env:CONDA_INSTALLER_FILE} && bash {env:SHARED_CACHE_DIR}/{env:CONDA_INSTALLER_FILE} -b -f -p {env:CONDA_PREFIX}; fi'
local-conda: bash -c 'case "{env:SKIP_SYSTEM_PKG_INSTALL:}" in 1|y*|Y*);; *) {env:SETENV} && {env:CONDA_PREFIX}/bin/conda update -n base --yes conda;; esac'
local-conda: bash -c 'export PATH="build/bin:$PATH" && PACKAGES=$(sage-get-system-packages conda $(sage-package list {env:SAGE_PACKAGE_LIST_ARGS}) {env:ALL_EXTRA_SAGE_PACKAGES}); {env:SETENV} && {env:CONDA_PREFIX}/bin/conda install --yes --quiet $PACKAGES'
#
# local-root: Assume we are root, run the system package commands
# local-sudo: Use sudo to run the system package commands as root
#
local-{root,sudo}: bash -c 'case "{env:SKIP_SYSTEM_PKG_INSTALL:}" in 1|y*|Y*);; *) eval $(build/bin/sage-print-system-package-command {env:SYSTEM} {env:__SUDO:} update) ;; esac'
local-{root,sudo}: bash -c 'case "{env:SKIP_SYSTEM_PKG_INSTALL:}" in 1|y*|Y*);; *) export PATH="build/bin:$PATH" && eval $(sage-print-system-package-command {env:SYSTEM} {env:__SUDO:} --yes --no-install-recommends --spkg install $(sage-package list {env:SAGE_PACKAGE_LIST_ARGS}) {env:ALL_EXTRA_SAGE_PACKAGES}) || [ "$IGNORE_MISSING_SYSTEM_PACKAGES" = yes ] && echo "(ignoring errors)" ;; esac'
#
# All "local" environments
#
# Install symbolic links "config.log" and "logs" in SAGE_ROOT so that log files are written into the tox log directory.
local: bash -c 'touch {envlogdir}/config.log; ln -sf {envlogdir}/config.log .; if [ ! -d logs -o -L logs ]; then rm -f logs; ln -sf {envlogdir} logs; fi'
# Install a symbolic link "prefix" in SAGE_ROOT for convenient inspection; it is not used in the build.
local: bash -c 'if [ ! -d prefix -o -L prefix ]; then rm -f prefix; ln -sf {env:PREFIX:{envdir}/local} prefix; fi'
##commands =
docker: bash -c 'build/bin/write-dockerfile.sh {env:SYSTEM} "{env:SAGE_PACKAGE_LIST_ARGS:}" {env:WITH_SYSTEM_SPKG} {env:IGNORE_MISSING_SYSTEM_PACKAGES} "{env:ALL_EXTRA_SAGE_PACKAGES}" > {envdir}/Dockerfile'
# From https://hub.docker.com/r/multiarch/ubuntu-core/
# configure binfmt-support on the Docker host (works locally or remotely, i.e: using boot2docker)
docker-{arm64,armhf}: docker run --rm --privileged multiarch/qemu-user-static:register --reset
docker: bash -c 'if [ x"{env:DOCKER_CONFIG_FILE:}" != x ]; then mkdir -p {envdir}/.docker && ln -sf $(realpath "{env:DOCKER_CONFIG_FILE:}") {envdir}/.docker/; fi'
docker: bash -c 'for docker_target in {env:DOCKER_TARGETS:with-targets}; do \
docker: BUILD_IMAGE_STEM=sage-$(echo {envname} | sed "s/docker-//;s/-incremental//"); \
docker: BUILD_IMAGE=$DOCKER_PUSH_REPOSITORY$BUILD_IMAGE_STEM-$docker_target; \
docker: BUILD_TAG={env:DOCKER_TAG:$(git describe --dirty --always)}; \
docker: TAG_ARGS=$(for tag in $BUILD_TAG {env:EXTRA_DOCKER_TAGS:}; do echo --tag $BUILD_IMAGE:$tag; done); \
docker: DOCKER_BUILDKIT={env:DOCKER_BUILDKIT:1}; \
docker: docker build . -f {envdir}/Dockerfile \
docker: --target $docker_target \
docker: $TAG_ARGS \
docker: --build-arg EXTRA_CONFIGURE_ARGS="{env:CONFIGURE_ARGS}" \
docker: --build-arg BASE_IMAGE={env:FULL_BASE_IMAGE_AND_TAG} \
docker-conda: --build-arg USE_CONDARC="{env:USE_CONDARC}" \
docker: --build-arg BOOTSTRAP="{env:BOOTSTRAP}" \
docker: --build-arg TARGETS_PRE="$(if test -n "$TARGETS_PRE"; then echo $TARGETS_PRE; else echo {posargs:all-sage-local}; fi)" \
docker: --build-arg TARGETS="{posargs:build}" \
docker: --build-arg TARGETS_OPTIONAL="{env:TARGETS_OPTIONAL:ptest}" \
docker: {env:EXTRA_DOCKER_BUILD_ARGS:}; status=$?; \
docker: unset CONTAINER; \
docker: if [ $status != 0 ]; then \
docker: if [ $DOCKER_BUILDKIT = 0 ]; then \
docker: BUILD_TAG="$BUILD_TAG-failed"; CONTAINER=$(docker ps -l -q); docker commit $CONTAINER $BUILD_IMAGE:$BUILD_TAG; \
docker: else \
docker: unset BUILD_TAG; echo "DOCKER_BUILDKIT=1, so we cannot commit and tag the failed image"; \
docker: fi; \
docker: fi; \
docker: if [ -n "$BUILD_TAG" ]; then \
docker: echo "Copying logs from the container to {envdir}/sage/"; \
docker: rm -f {envdir}/sage/STATUS; \
docker: docker run $BUILD_IMAGE:$BUILD_TAG bash -c " \
docker: tar -c --ignore-failed-read -f - \
docker: /sage/STATUS /sage/logs /sage/{prefix,venv}/var/lib/sage/installed \
docker: ~/.sage/timings2.json /sage/pkgs/*/.tox/*/.sage/timings2.json \
docker: /sage/pkgs/*/.tox/*/logs 2> /dev/null" \
docker: | (cd {envdir} && tar xf -); \
docker: if [ -f {envdir}/sage/STATUS ]; then status=$(cat {envdir}/sage/STATUS); fi; \
docker: fi; \
docker: unset PUSH_TAGS; \
docker: if [ -n "$BUILD_TAG" ]; then \
docker: if [ $status != 0 ]; then \
docker: BUILD_TAG="${BUILD_TAG%-failed}-failed"; PUSH_TAGS=$BUILD_IMAGE:$BUILD_TAG; \
docker: else \
docker: PUSH_TAGS=$(echo $BUILD_IMAGE:$BUILD_TAG; for tag in {env:EXTRA_DOCKER_TAGS:}; do echo "$BUILD_IMAGE:$tag"; done); \
docker: fi; \
docker: echo $BUILD_IMAGE:$BUILD_TAG >> {envdir}/Dockertags; \
docker: fi; \
docker: if [ x"{env:DOCKER_PUSH_REPOSITORY:}" != x -a x"$PUSH_TAGS" != x ]; then \
docker: echo Pushing $PUSH_TAGS; \
docker: for tag in $PUSH_TAGS; do \
docker: if docker push $tag; then echo $tag >> {envdir}/Dockertags.pushed; else echo "(ignoring errors)"; fi; \
docker: done; \
docker: fi; \
docker: if [ $status != 0 ]; then exit $status; fi; \
docker: done'
# #28728: gap fails its test suite.
# linbox/cysignals testsuites fail. ppl takes very long.
local: bash -c 'export PATH={env:PATH} && {env:SETENV} && \
local: case "{env:SKIP_BOOTSTRAP:}" in 1|y*|Y*);; *) {env:BOOTSTRAP} ;; esac && \
local: {env:SETENV_CONFIGURE} && \
local: case "{env:SKIP_CONFIGURE:}" in 1|y*|Y*);; *) ./configure --prefix={env:PREFIX:{envdir}/local} {env:CONFIGURE_ARGS} ;; esac && \
local: case "{posargs:}" in \
local: bash) PS1="(tox -e {envname}) \w\$ " bash -i; exit ;; \
local: config*) ;; \
local: *) make -k V=0 base-toolchain ;; \
local: esac && \
local: make -k V=0 SAGE_CHECK=warn SAGE_CHECK_PACKAGES="!cython,!r,!python3,!gap,!cysignals,!linbox,!git,!ppl,!cmake,!rpy2,!sage_sws2rst" {env:TARGETS_PRE:} {posargs:build} && \
local: ( [ -z "{env:TARGETS_OPTIONAL:}" ] || make -k V=0 SAGE_CHECK=warn SAGE_CHECK_PACKAGES="!cython,!r,!python3,!gap,!cysignals,!linbox,!git,!ppl,!cmake,!rpy2,!sage_sws2rst" {env:TARGETS_OPTIONAL:} || echo "(error ignored)" ) '
[testenv:check_configure]
## Test that configure behaves properly
allowlist_externals =
bash
setenv =
HOME = {envdir}
commands =
./bootstrap
bash -c 'test -z "$(./configure --quiet 2>&1)" || (echo >&2 Error: "configure --quiet" is not quiet; exit 1)'
[testenv:update_docker_platforms]
description =
Update the platforms tested in CI Linux (.github/workflows/docker.yml),
create .devcontainer/portability-*/devcontainer.json files for all
these platforms, and generate a table with dev container links for
the developer guide.
passenv =
SYSTEM_FACTORS
PACKAGE_FACTORS
DOCKER_TARGETS
FROM_DOCKER_REPOSITORY
setenv =
#
# Master list of platforms tested in CI Linux
#
DEFAULT_SYSTEM_FACTORS=\
ubuntu-{trusty-toolchain-gcc_9,xenial-toolchain-gcc_9,bionic-gcc_8,focal,jammy,lunar,mantic} \
debian-{buster-gcc_spkg,bullseye,bookworm,trixie,sid} \
linuxmint-{20.1,20.2,20.3,21,21.1,21.2} \
fedora-{30,31,32,33,34,35,36,37,38,39} \
centos-7-devtoolset-gcc_11 \
centos-stream-{8,9}-python3.9 \
almalinux-{8-python3.9,9-python3.11} \
gentoo-python{3.10,3.11} \
archlinux-latest \
opensuse-{15.3-gcc_11-python3.9,15.4-gcc_11-python3.10,15.5-gcc_11-python3.11} \
opensuse-tumbleweed{-python3.10,} \
conda-forge-python3.11 \
ubuntu-bionic-gcc_8-i386 \
debian-bullseye-i386
#
# Container badges for the developer guide
#
# color gradient from dimgray to default green of https://github.com/eggplants/ghcr-badge
COLOR_with_system_packages = %23696969
COLOR_configured = %23696969
COLOR_with_targets_pre = %235d8a4c
COLOR_with_targets = %2350ab2e
COLOR_with_targets_optional = %2344cc11
# color gradient from dimgray to blue
COLOR_minimal_with_system_packages = %23696969
COLOR_minimal_configured = %23696969
COLOR_minimal_with_targets_pre = %23677895
COLOR_minimal_with_targets = %236686c1
COLOR_minimal_with_targets_optional = %236495ed
# color gradient from dimgray to purple
COLOR_maximal_with_system_packages = %23696969
COLOR_maximal_configured = %23696969
COLOR_maximal_with_targets_pre = %238f6b8d
COLOR_maximal_with_targets = %23b46eb2
COLOR_maximal_with_targets_optional = %23da70d6
commands =
bash -c 'DEFAULT_SYSTEM_FACTORS=$(echo {env:DEFAULT_SYSTEM_FACTORS}); \
for SYSTEM_FACTOR in {env:SYSTEM_FACTORS:$DEFAULT_SYSTEM_FACTORS}; do \
for PACKAGE_FACTOR in {env:PACKAGE_FACTORS:minimal standard}; do \
for DOCKER_TARGET in {env:DOCKER_TARGETS:with-targets}; do \
DIR=.devcontainer/portability-$SYSTEM_FACTOR-$PACKAGE_FACTOR; \
mkdir -p $DIR; \
ln -sf ../portability-Dockerfile $DIR/portability-Dockerfile; \
sed -e s/@SYSTEM_FACTOR@/$SYSTEM_FACTOR/ \
-e s/@PACKAGE_FACTOR@/$PACKAGE_FACTOR/ \
-e s/@DOCKER_TARGET@/$DOCKER_TARGET/ \
-e s/@DOCKER_TAG@/dev/ .devcontainer/portability-devcontainer.json.in \
> $DIR/devcontainer.json; \
done; \
echo "Wrote $DIR/"; \
done; \
done'
bash -c 'DEFAULT_SYSTEM_FACTORS=$(echo {env:DEFAULT_SYSTEM_FACTORS}); \
FILE=.github/workflows/docker.yml; \
(sed -n "1,/update_docker_platforms.*below/p" $FILE; \
echo " default: >-"; \
echo " ["; \
for SYSTEM_FACTOR in {env:SYSTEM_FACTORS:$DEFAULT_SYSTEM_FACTORS}; do \
echo " \"$SYSTEM_FACTOR\","; \
done; \
echo " ]"; \
sed -n "/update_docker_platforms.*above/,\$p" $FILE) \
> $FILE.new; \
mv $FILE.new $FILE; \
echo "Wrote $FILE"'
bash -c 'DEFAULT_SYSTEM_FACTORS=$(echo {env:DEFAULT_SYSTEM_FACTORS}); \
FILE=src/doc/en/developer/portability_platform_table.rst; \
(for SYSTEM_FACTOR in {env:SYSTEM_FACTORS:$DEFAULT_SYSTEM_FACTORS}; do \
for PACKAGE_FACTOR in {env:PACKAGE_FACTORS:minimal standard maximal}; do \
REPO="{env:FROM_DOCKER_REPOSITORY:ghcr.io/sagemath/sage/}sage-$SYSTEM_FACTOR-$PACKAGE_FACTOR"; \
for DOCKER_TARGET in {env:DOCKER_TARGETS:with-system-packages configured with-targets-pre with-targets with-targets-optional}; do \
eval COLOR=\$COLOR_${PACKAGE_FACTOR}_${DOCKER_TARGET//-/_}; \
if [ x$COLOR = x ]; then eval COLOR=\$COLOR_${DOCKER_TARGET//-/_}; fi; \
case $DOCKER_TARGET in \
with-system-packages) BADGE="size?tag=dev&label=$DOCKER_TARGET&color=$COLOR";; \
*) BADGE="latest_tag?ignore=latest,dev,*-failed&label=$DOCKER_TARGET&color=$COLOR";; \
esac; \
echo ".. |image-$SYSTEM_FACTOR-$PACKAGE_FACTOR-$DOCKER_TARGET| image:: https://ghcr-badge.egpl.dev/${REPO\#ghcr.io/}-$DOCKER_TARGET/$BADGE"; \
echo " :target: https://$REPO-$DOCKER_TARGET"; \
echo ""; \
done; \
echo ".. |codespace-$SYSTEM_FACTOR-$PACKAGE_FACTOR| image:: https://github.com/codespaces/badge.svg"; \
echo " :target: https://codespaces.new/sagemath/sage?devcontainer_path=.devcontainer%2Fportability-$SYSTEM_FACTOR-$PACKAGE_FACTOR%2Fdevcontainer.json"; \
echo ""; \
done; \
done; \
echo ".. list-table::"; \
echo " :widths: 50 50 40"; \
echo " :header-rows: 1"; \
echo " :stub-columns: 0"; \
echo ""; \
echo " * - Platform"; \
echo " - Images"; \
echo " - "; \
for SYSTEM_FACTOR in {env:SYSTEM_FACTORS:$DEFAULT_SYSTEM_FACTORS}; do \
SYSTEM_FACTOR_LABEL="**${SYSTEM_FACTOR/-/**-}"; \
for PACKAGE_FACTOR in {env:PACKAGE_FACTORS:minimal standard maximal}; do \
case $SYSTEM_FACTOR-$PACKAGE_FACTOR in \
conda*-minimal) continue;; \
esac; \
PACKAGE_FACTOR_LABEL="‑*$PACKAGE_FACTOR*"; \
for ROW_DOCKER_TARGETS in "{env:DOCKER_TARGETS:with-system-packages with-targets-pre with-targets with-targets-optional}"; do \
if [ -n "$SYSTEM_FACTOR_LABEL" ]; then \
echo " * - $SYSTEM_FACTOR_LABEL "; SYSTEM_FACTOR_LABEL=""; \
echo " "; \
echo " $PACKAGE_FACTOR_LABEL"; PACKAGE_FACTOR_LABEL=""; \
else \
echo " * - $PACKAGE_FACTOR_LABEL"; PACKAGE_FACTOR_LABEL=""; \
fi; \
echo -n " -"; \
for DOCKER_TARGET in $ROW_DOCKER_TARGETS; do \
echo -n " |image-$SYSTEM_FACTOR-$PACKAGE_FACTOR-$DOCKER_TARGET|"; \
case $PACKAGE_FACTOR:$DOCKER_TARGET in maximal:with-targets-pre) break;; esac; \
done; \
echo ""; \
if [ $PACKAGE_FACTOR != maximal ]; then \
echo " - |codespace-$SYSTEM_FACTOR-$PACKAGE_FACTOR|"; \
else \
echo " -"; \
fi; \
done; \
done; \
done) > $FILE; \
echo "Wrote $FILE"'
###### Delegation to src/tox.ini ######
[sage_src]
passenv =
HOME
envdir = {toxworkdir}/src
allowlist_externals = tox
commands = tox -c {toxinidir}/src/tox.ini -e {envname} -- {posargs}
[testenv:doctest]
description =
run the Sage doctester (same as "sage -t")
passenv = {[sage_src]passenv}
envdir = {[sage_src]envdir}
commands = {[sage_src]commands}
allowlist_externals = {[sage_src]allowlist_externals}
[testenv:coverage.py]
description =
run the Sage doctester with Coverage.py
(https://coverage.readthedocs.io/en/latest/index.html)
passenv = {[sage_src]passenv}
envdir = {[sage_src]envdir}
commands = {[sage_src]commands}
allowlist_externals = {[sage_src]allowlist_externals}