Skip to content

Commit 967f80a

Browse files
committed
Standardize on CONDA_PLATFORM
1 parent 8a1a617 commit 967f80a

File tree

6 files changed

+29
-28
lines changed

6 files changed

+29
-28
lines changed

dev/conda/build-generic.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ set -o pipefail
44

55
# BUILD GENERIC SH
66
# Generic builder for all platforms
7-
# RECIPE_DIR is the PLATFORM directory
7+
# RECIPE_DIR is the CONDA_PLATFORM directory
88
# Called internally by
9-
# "conda build" -> PLATFORM/build.sh -> build-generic.sh
10-
# The Swift/T build output goes into PLATFORM/build-swift-t.log
11-
# Puts some metadata in PLATFORM/build-generic.log
9+
# "conda build" -> CONDA_PLATFORM/build.sh -> build-generic.sh
10+
# The Swift/T build output goes into CONDA_PLATFORM/build-swift-t.log
11+
# Puts some metadata in CONDA_PLATFORM/build-generic.log
1212
# link to work directory is important,
1313
# contains meta.yaml and Swift/T source
14-
# If PLATFORM-specific settings are needed, put them in
15-
# PLATFORM/build.sh
14+
# If CONDA_PLATFORM-specific settings are needed, put them in
15+
# CONDA_PLATFORM/deps.sh
1616

1717
# Environment notes:
1818
# Generally, environment variables are not inherited into here.
@@ -40,11 +40,11 @@ echo ENABLE_R=$ENABLE_R
4040
echo "ENABLE_R: $ENABLE_R"
4141
} > $RECIPE_DIR/build-generic.log
4242

43-
if [[ $PLATFORM =~ osx-* ]]
43+
if [[ $CONDA_PLATFORM =~ osx-* ]]
4444
then
4545
NULL=""
4646
ZT=""
47-
if [[ $PLATFORM =~ osx-arm64 ]]
47+
if [[ $CONDA_PLATFORM =~ osx-arm64 ]]
4848
then
4949
# These variables affect the mpicc/mpicxx wrappers
5050
export MPICH_CC=clang
@@ -121,7 +121,7 @@ then
121121
fi
122122

123123
set -x
124-
if [[ $PLATFORM =~ osx-* ]] && [[ ${GITHUB_ACTION:-0} == 0 ]]
124+
if [[ $CONDA_PLATFORM =~ osx-* ]] && [[ ${GITHUB_ACTION:-0} == 0 ]]
125125
then
126126
# Use this syntax on Mac, unless in GitHub,
127127
# where we install Homebrew gnu-sed

dev/conda/conda-build.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ set -eu
88
# Generates settings.sed for the Swift/T build
99
# Many exported environment variables here
1010
# are substituted into meta.yaml
11-
# This script runs in the PLATFORM subdirectory
11+
# This script runs in the CONDA_PLATFORM subdirectory
1212
# and should not change directories
1313
# A LOG is produced named platform/conda-build.log
14-
# You can only run 1 job concurrently
14+
# You can only run 1 job concurrently per Anaconda installation
1515
# because of the log and
1616
# because of meta.yaml
1717
# The Swift/T source must have already been put in $TMP/distro
@@ -52,14 +52,14 @@ source $DEV_CONDA/get-python-version.sh
5252
# Optionally set R_VERSION from user argument:
5353
if (( ${#R} )) export R_VERSION=${R[2]}
5454

55-
if (( ${#PLATFORM:-} == 0 )) {
56-
log "unset: PLATFORM"
55+
if (( ${#CONDA_PLATFORM:-} == 0 )) {
56+
log "unset: CONDA_PLATFORM"
5757
log " This script should be called by a conda-platform.sh"
5858
return 1
5959
}
6060

61-
log "VERSION: $SWIFT_T_VERSION"
62-
log "PLATFORM: $PLATFORM $*"
61+
log "SWIFT/T VERSION: $SWIFT_T_VERSION"
62+
log "CONDA_PLATFORM: $CONDA_PLATFORM $*"
6363

6464
# This is passed into meta.yaml:
6565
export DISTRO=$TMP/distro
@@ -115,7 +115,7 @@ export USE_ZLIB=0
115115
export USE_ZSH=1
116116

117117
# Allow platform to modify dependencies
118-
source $DEV_CONDA/$PLATFORM/deps.sh
118+
source $DEV_CONDA/$CONDA_PLATFORM/deps.sh
119119

120120
export DATE=${(%)DATE_FMT_S}
121121
m4 -P -I $DEV_CONDA $COMMON_M4 $META_TEMPLATE > meta.yaml
@@ -134,7 +134,7 @@ if [[ -f $LOG ]] {
134134
print
135135
}
136136

137-
if (( ENABLE_R )) && [[ $PLATFORM == "osx-arm64" ]] {
137+
if (( ENABLE_R )) && [[ $CONDA_PLATFORM == "osx-arm64" ]] {
138138
# This is just for our emews-rinside:
139139
CHANNEL_SWIFT=( -c swift-t )
140140
} else {

dev/conda/conda-platform.sh

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,30 @@
22
set -eu
33

44
# CONDA PLATFORM
5-
# Build conda for a given PLATFORM
6-
# Dependency files are in the PLATFORM directory
7-
# Generated scripts and log files are put in the PLATFORM directory
5+
# Build conda for a given CONDA_PLATFORM
6+
# Dependency files are in the CONDA_PLATFORM directory
7+
# Generated scripts and logs are put in the CONDA_PLATFORM directory
88
# Arguments:
99
# -C configure-only- generate meta.yaml and settings.sed, then stop
1010
# -r R_VERSION for the R version
11-
# PLATFORM: The PLATFORM directory
11+
# CONDA_PLATFORM: The PLATFORM directory
1212

1313
C="" R=""
1414
zparseopts -D -E -F h=HELP C=C r:=R
1515
if (( ${#*} != 1 )) {
16-
print "conda-platform.sh: Provide PLATFORM!"
16+
print "conda-platform.sh: Provide CONDA_PLATFORM!"
1717
return 1
1818
}
19-
export PLATFORM=$1
19+
# The PLATFORM under Anaconda naming conventions:
20+
export CONDA_PLATFORM=$1
2021

2122
# The Swift/T Conda script directory (absolute):
2223
DEV_CONDA=${0:A:h}
2324

24-
if [[ ! -d $DEV_CONDA/$PLATFORM ]] {
25-
printf "conda-platform.sh: No such platform: '%s'\n" $PLATFORM
25+
if [[ ! -d $DEV_CONDA/$CONDA_PLATFORM ]] {
26+
printf "conda-platform.sh: No such platform: '%s'\n" $CONDA_PLATFORM
2627
return 1
2728
}
2829

29-
cd $DEV_CONDA/$PLATFORM
30+
cd $DEV_CONDA/$CONDA_PLATFORM
3031
$DEV_CONDA/conda-build.sh $HELP $C $R

dev/conda/helpers.zsh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ checksum()
66
{
77
# Use redirection to suppress filename in program output
88
local PKG=$1
9-
print "checksum(CONDA_PLATFORM=$CONDA_PLATFORM)" $PKG
109
if [[ $CONDA_PLATFORM =~ osx-* ]] {
1110
md5 -r < $PKG
1211
} else {

dev/conda/meta-template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ build:
2222
# Environment variables for build.sh must be listed here,
2323
# normal environment inheritance does not happen!
2424
script_env:
25-
- PLATFORM=getenv(PLATFORM)
25+
- CONDA_PLATFORM=getenv(CONDA_PLATFORM)
2626
m4_ifelse(getenv(ENABLE_R),`1',m4_include(env-R.yaml))
2727

2828
# Remember to sync any dependency changes here with conda-install.sh

dev/conda/upload.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ print "TIME: ${A[mtime]}"
2626
printf "SIZE: %.1f MB\n" $(( float(${A[size]}) / (1024*1024) ))
2727
HASH=( $( md5sum $PKG ) )
2828
print "HASH: ${HASH[1]}"
29+
if (( ${#FORCE} )) print "FORCING!"
2930

3031
print
3132
printf "CONFIRM? "

0 commit comments

Comments
 (0)