Skip to content

Commit

Permalink
Use STACK_YAML env var instead of relinking the file
Browse files Browse the repository at this point in the history
If STACK_YAML is set to "stack.yaml" itself then we remove the file and
link it to itelf. Which is obviously incorrect. So just avoid relinking
and use the envvar.
  • Loading branch information
harendra-kumar committed Jun 14, 2021
1 parent 4c08ca9 commit c79cdaf
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
4 changes: 0 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ preinstall: &preinstall
# required for outbound https for stack and for stack setup
apt-get install -y netbase xz-utils make
# If a custom stack-yaml is specified, replace the default with that
if test -e "$STACK_YAML"; then rm -f stack.yaml && ln -sv $STACK_YAML stack.yaml; else true; fi
unset STACK_YAML
# Get packcheck if needed
CURL=$(which curl)
PACKCHECK_URL=${PACKCHECK_GITHUB_URL}/${PACKCHECK_GITHUB_COMMIT}/packcheck.sh
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/packcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,6 @@ jobs:
sudo apt-get install -y curl
# required for outbound https for stack and for stack setup
sudo apt-get install -y netbase xz-utils make
# If a custom stack-yaml is specified, replace the default with that
if test -e "$STACK_YAML"; then rm -f stack.yaml && ln -sv $STACK_YAML stack.yaml; else true; fi
unset STACK_YAML
- name: Download packcheck
run: |
Expand Down
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,6 @@ install: true

script:
- |
# If a custom stack-yaml is specified, replace the default with that
if test -e "$STACK_YAML"; then rm -f stack.yaml && ln -sv $STACK_YAML stack.yaml; else true; fi
unset STACK_YAML
# Get packcheck if needed
CURL=$(which curl)
PACKCHECK_URL=${PACKCHECK_GITHUB_URL}/${PACKCHECK_GITHUB_COMMIT}/packcheck.sh
Expand Down
7 changes: 6 additions & 1 deletion packcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ show_help() {
#help_envvar ENABLE_INSTALL "[y] DESTRUCTIVE! Install the package after building"

show_step1 "stack options"
help_envvar STACK_YAML "Alternative stack config, cannot be a path, just the file name"
help_envvar STACK_YAML "Alternative stack config file path relative to project root"
help_envvar STACK_OPTIONS "ADDITIONAL stack global options (e.g. -v) to append"
help_envvar STACK_BUILD_OPTIONS "ADDITIONAL stack build command options to append"

Expand Down Expand Up @@ -667,6 +667,11 @@ ensure_stack() {
fi
require_cmd stack

# Empty STACK_YAML variable does not go well
if test -z "$STACK_YAML"
then
unset STACK_YAML
fi
if test -n "$STACK_UPGRADE"
then
echo "Upgrading stack to the required version"
Expand Down

0 comments on commit c79cdaf

Please sign in to comment.