Skip to content

Commit

Permalink
Merge pull request #1592 from jdlrobson/osx
Browse files Browse the repository at this point in the history
Improve OSX setup flow based on experience
  • Loading branch information
cfm authored Dec 20, 2022
2 parents e7681ef + ca94914 commit 270806d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ RANDOM_SEED ?= $(shell bash -c 'echo $$RANDOM')
.PHONY: test
test: ## Run the application tests in parallel (for rapid development)
@TEST_CMD="python -m pytest -v -n 4 --ignore=$(FTESTS) --ignore=$(ITESTS) $(TESTOPTS) $(TESTS)" ; \
source scripts/setup-tmp-directories.sh; \
if command -v xvfb-run > /dev/null; then \
xvfb-run -a $$TEST_CMD ; else \
$$TEST_CMD ; fi
Expand Down
4 changes: 1 addition & 3 deletions requirements/dev-mac-requirements.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
-r dev-bullseye-requirements.in
pyobjc-core
pyobjc
rubicon-objc
rubicon-objc==0.4.2
13 changes: 1 addition & 12 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,7 @@ while [ -n "$1" ]; do
shift
done

if [[ $OSTYPE == 'darwin'* ]]; then
# Override tempfile behavior in OS X as /var symlink conflicts with path traversal checks
TMP_BASE=$HOME/.sdc_tmp
[ -d $TMP_BASE ] && rm -rf $TMP_BASE
mkdir $TMP_BASE
export TMPDIR=$TMP_BASE
SDC_HOME=${SDC_HOME:-$(mktemp -d $TMP_BASE/sd_client.XXXX)}
else
SDC_HOME=${SDC_HOME:-$(mktemp -d)}
fi
export SDC_HOME

source scripts/setup-tmp-directories.sh

GNUPGHOME="$SDC_HOME/gpg"
export GNUPGHOME
Expand Down
11 changes: 11 additions & 0 deletions scripts/setup-tmp-directories.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
if [[ $OSTYPE == 'darwin'* ]]; then
# Override tempfile behavior in OS X as /var symlink conflicts with path traversal checks
TMP_BASE=$HOME/.sdc_tmp
[ -d $TMP_BASE ] && rm -rf $TMP_BASE
mkdir $TMP_BASE
export TMPDIR=$TMP_BASE
SDC_HOME=${SDC_HOME:-$(mktemp -d $TMP_BASE/sd_client.XXXX)}
else
SDC_HOME=${SDC_HOME:-$(mktemp -d)}
fi
export SDC_HOME

0 comments on commit 270806d

Please sign in to comment.