Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PATH issues when building from source #557

Closed
ott2 opened this issue Apr 10, 2023 · 0 comments
Closed

PATH issues when building from source #557

ott2 opened this issue Apr 10, 2023 · 0 comments
Assignees
Labels

Comments

@ott2
Copy link
Collaborator

ott2 commented Apr 10, 2023

The current build infrastructure at several points makes the assumption that stack will be in the path once it is installed during the build. This assumption is not generally true. In a sandboxed build like that by brew install -s the PATH is minimal and this causes the build to fail at several places. The earliest failure is the call to etc/build/install-stack.sh where in the second-last line of the script which stack returns an empty string, and the script then returns an error on the last line stack --version which terminates the build.

One solution is to replace in the Makefile each

@command

with

@env "PATH=${BIN_DIR}:${PATH}" command

I've tested this and it seems to work for brew install -s with a minimalist formula. This change would also remove the need to tell the user about setting PATH in the documentation.

Todo:

  • check the idiomatic way to implement this pattern (I suspect it is common)
  • check this change would not break builds on Windows and Linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant