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

[sc-39654] Add ghciwatch #10

Merged
merged 2 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ ARG BOOTSTRAP_HASKELL_MINIMAL=1
ARG BOOTSTRAP_HASKELL_NONINTERACTIVE=1
ENV GHCUP_INSTALL_BASE_PREFIX=/usr/local

ADD install-tools.sh /install-tools.sh

RUN apt-get update \
&& apt-get install -qq -y --no-install-recommends \
curl build-essential git-all libffi-dev libffi8 libgmp-dev \
Expand Down Expand Up @@ -45,4 +43,6 @@ ARG CABAL_VERSION
RUN ghcup install cabal $CABAL_VERSION --set

ADD stack.yaml /stack.yaml
RUN /bin/sh /install-tools.sh

ADD install-tools.sh /install-tools.sh
RUN bash /install-tools.sh
Copy link

@telser telser Oct 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't use bash. We don't need it for the tests in the install-tools.sh anyway

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 66763f3

11 changes: 11 additions & 0 deletions install-tools.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
set -o errexit

arch=$(uname -m)
if [[ $arch == x86_64 ]]; then
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be able to do this with a normal call to test in bourne shell. ShellCheck is a big help for this kind of thing.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 66763f3

curl -Lo /usr/local/bin/ghciwatch "https://github.com/MercuryTechnologies/ghciwatch/releases/download/v1.0.1/ghciwatch-x86_64-linux"
elif [[ $arch == aarch64 ]]; then
curl -Lo /usr/local/bin/ghciwatch "https://github.com/MercuryTechnologies/ghciwatch/releases/download/v1.0.1/ghciwatch-aarch64-linux"
else
echo "install-tools.sh: Unknown architecture $arch"
exit 1
fi
chmod +x /usr/local/bin/ghciwatch

stack install \
--local-bin-path /usr/local/bin \
weeder \
Expand Down
Loading