Skip to content

Commit 5f52444

Browse files
committedOct 20, 2022
[DAPHNE-#abc] Release script feature parameter
This commit adds the --feature parameter to the release scripts which enables packaging a release with a specified feature compiled. This is a workaround for release 0.1 to fix a binary dependency on CUDA libraries.
1 parent 24411b0 commit 5f52444

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed
 

‎pack.sh

+16-6
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ set -e
1919

2020
function exit_with_usage {
2121
cat << EOF
22-
usage: $0 --version VERSION
23-
22+
usage: pack.sh --version VERSION --feature FEATURE
23+
--feature FEATURE......a feature flag like --cuda, --arrow, etc ("none" for plain Daphne)
2424
EOF
2525
exit 1
2626
}
@@ -29,8 +29,8 @@ if [ $# -eq 0 ]; then
2929
exit_with_usage
3030
fi
3131

32-
DAPHNE_FEATURES=("--arrow" "--cuda")
3332
DAPHNE_VERSION=-1
33+
FEATURE=""
3434

3535
while [[ $# -gt 0 ]]; do
3636
key=$1
@@ -43,6 +43,10 @@ while [[ $# -gt 0 ]]; do
4343
DAPHNE_VERSION=$1
4444
shift
4545
;;
46+
--feature)
47+
FEATURE=$1
48+
shift
49+
;;
4650
*)
4751
unknown_options="${unknown_options} ${key}"
4852
;;
@@ -59,9 +63,14 @@ if [[ "$DAPHNE_VERSION" == "-1" ]]; then
5963
exit_with_usage
6064
fi
6165

62-
export PACK_ROOT=daphne-$DAPHNE_VERSION-bin
66+
if [[ "$FEATURE" == "none" ]]; then
67+
FEATURE=
68+
fi
69+
70+
export PACK_ROOT=daphne$FEATURE-$DAPHNE_VERSION-bin
71+
rm -rf bin build lib
6372

64-
source build.sh ${DAPHNE_FEATURES[@]} --target all
73+
source build.sh $FEATURE --target all
6574

6675
# shellcheck disable=SC2154
6776
if [ -d "$daphneBuildDir"/venv ]; then
@@ -81,7 +90,8 @@ fi
8190

8291
# shellcheck disable=SC2154
8392
cd "$projectRoot"
84-
source test.sh ${DAPHNE_FEATURES[@]}
93+
94+
source test.sh ${FEATURE}
8595

8696
# shellcheck disable=SC2181
8797
if [[ $? == 0 ]];then

‎release.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ ARTIFACT_PATH=""
4747
DAPHNE_REPO_URL="git@github.com:corepointer/daphne.git"
4848
#real URL:
4949
#DAPHNE_REPO_URL="git@github.com:daphne-eu/daphne.git"
50-
50+
FEATURE=""
5151
while [[ $# -gt 0 ]]; do
5252
key=$1
5353
shift
@@ -59,6 +59,10 @@ while [[ $# -gt 0 ]]; do
5959
DAPHNE_VERSION=$1
6060
shift
6161
;;
62+
--feature)
63+
FEATURE=$1
64+
shift
65+
;;
6266
--githash)
6367
GIT_HASH=$1
6468
shift
@@ -99,7 +103,7 @@ if [ $BUILD -eq 1 ]; then
99103

100104
# set the requested commit to build Daphne
101105
git checkout "$GIT_HASH"
102-
source pack.sh --version "$DAPHNE_VERSION"
106+
source pack.sh --version "$DAPHNE_VERSION" --feature $FEATURE
103107
# return to the previous branch
104108
git checkout -
105109

0 commit comments

Comments
 (0)