Skip to content

Commit 9462dca

Browse files
committed
[ci skip] Apply cpp20 fixes from Xanthos to nightly build
1 parent f58bdcb commit 9462dca

File tree

2 files changed

+104
-0
lines changed

2 files changed

+104
-0
lines changed

.github/scripts/nightly/cpp20.patch

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
diff --git a/recipe/build-libtiledbsoma.sh b/recipe/build-libtiledbsoma.sh
2+
index 12d4f4f..5d50926 100644
3+
--- a/recipe/build-libtiledbsoma.sh
4+
+++ b/recipe/build-libtiledbsoma.sh
5+
@@ -2,6 +2,9 @@
6+
7+
set -exo pipefail
8+
9+
+# Clear default compiler flags
10+
+export CXXFLAGS=${CXXFLAGS//"-fvisibility-inlines-hidden"/}
11+
+
12+
mkdir libtiledbsoma-build && cd libtiledbsoma-build
13+
14+
cmake \
15+
diff --git a/recipe/build-r-tiledbsoma.sh b/recipe/build-r-tiledbsoma.sh
16+
index ffb435e..5a02821 100644
17+
--- a/recipe/build-r-tiledbsoma.sh
18+
+++ b/recipe/build-r-tiledbsoma.sh
19+
@@ -4,21 +4,28 @@ set -ex
20+
21+
cd apis/r
22+
23+
+# Clear default compiler flags
24+
+export CXXFLAGS=${CXXFLAGS//"-fvisibility-inlines-hidden"/}
25+
+
26+
export DISABLE_AUTOBREW=1
27+
28+
# https://github.com/conda-forge/r-tiledb-feedstock/commit/29cb6816636e7b5b58545e1407a8f0c29ff9dc39
29+
-if [[ $target_platform == osx-64 ]]; then
30+
+if [[ $target_platform == osx-* ]]; then
31+
export NN_CXX_ORIG=$CXX
32+
export NN_CC_ORIG=$CC
33+
export CXX=$RECIPE_DIR/cxx_wrap.sh
34+
export CC=$RECIPE_DIR/cc_wrap.sh
35+
- mkdir -p ~/.R
36+
- echo CC=$RECIPE_DIR/cc_wrap.sh > ~/.R/Makevars
37+
- echo CXX=$RECIPE_DIR/cxx_wrap.sh >> ~/.R/Makevars
38+
- echo CXX17=$RECIPE_DIR/cxx_wrap.sh >> ~/.R/Makevars
39+
fi
40+
41+
-export CXX17FLAGS="-Wno-deprecated-declarations -Wno-deprecated"
42+
+export CXX="$CXX -std=c++20 -fPIC"
43+
+export CXX20="$CXX"
44+
+
45+
+mkdir -p ~/.R
46+
+echo CC="$CC" > ~/.R/Makevars
47+
+echo CXX="$CXX" >> ~/.R/Makevars
48+
+echo CXX20="$CXX20" >> ~/.R/Makevars
49+
+
50+
+export CXX20FLAGS="-Wno-deprecated-declarations -Wno-deprecated"
51+
52+
# https://conda-forge.org/docs/maintainer/knowledge_base/#newer-c-features-with-old-sdk
53+
if [[ $target_platform == osx-* ]]; then
54+
diff --git a/recipe/build-tiledbsoma-py.sh b/recipe/build-tiledbsoma-py.sh
55+
index a55c068..1cb92ce 100644
56+
--- a/recipe/build-tiledbsoma-py.sh
57+
+++ b/recipe/build-tiledbsoma-py.sh
58+
@@ -4,6 +4,9 @@ set -ex
59+
60+
cd apis/python
61+
62+
+# Clear default compiler flags
63+
+export CXXFLAGS=${CXXFLAGS//"-fvisibility-inlines-hidden"/}
64+
+
65+
echo
66+
echo "PKG_VERSION IS <<$PKG_VERSION>>"
67+
echo
68+
diff --git a/recipe/cc_wrap.sh b/recipe/cc_wrap.sh
69+
index a2bfc0c..1589e33 100755
70+
--- a/recipe/cc_wrap.sh
71+
+++ b/recipe/cc_wrap.sh
72+
@@ -1,4 +1,3 @@
73+
#!/bin/sh
74+
75+
-args="${@##-mmacosx-version-min=10.9*}"
76+
-$NN_CC_ORIG $args -mmacosx-version-min=11.0
77+
+$NN_CC_ORIG "$@" -mmacosx-version-min=13.3
78+
diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml
79+
index 0c0129b..c4a9d77 100644
80+
--- a/recipe/conda_build_config.yaml
81+
+++ b/recipe/conda_build_config.yaml
82+
@@ -1,7 +1,7 @@
83+
# https://conda-forge.org/docs/maintainer/knowledge_base/#requiring-newer-macos-sdks
84+
# https://conda-forge.org/news/2024/03/24/stdlib-migration/
85+
MACOSX_SDK_VERSION: # [osx and x86_64]
86+
- - 11.0 # [osx and x86_64]
87+
+ - 13.3 # [osx and x86_64]
88+
c_stdlib_version: # [osx and x86_64]
89+
- 11.0 # [osx and x86_64]
90+
channel_sources:
91+
diff --git a/recipe/cxx_wrap.sh b/recipe/cxx_wrap.sh
92+
index 5d9def4..c8428cb 100755
93+
--- a/recipe/cxx_wrap.sh
94+
+++ b/recipe/cxx_wrap.sh
95+
@@ -1,4 +1,3 @@
96+
#!/bin/sh
97+
98+
-args="${@##-mmacosx-version-min=10.9*}"
99+
-$NN_CXX_ORIG $args -mmacosx-version-min=11.0
100+
+$NN_CXX_ORIG "$@" -mmacosx-version-min=13.3

.github/scripts/nightly/update-feedstock.sh

+4
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,9 @@ sed -i \
1616
s/"tiledb rc"/"tiledb nightlies"/ \
1717
recipe/conda_build_config.yaml
1818

19+
# Apply patch from Xanthos to support C++20
20+
# https://github.com/TileDB-Inc/tiledbsoma-feedstock/pull/246
21+
patch -p1 < .github/scripts/nightly/cpp20.patch
22+
1923
# Print differences
2024
git --no-pager diff conda-forge.yml recipe/conda_build_config.yaml

0 commit comments

Comments
 (0)