Skip to content

Commit 12ea6ad

Browse files
committed
Merge branch 'master' into release
2 parents 0507bba + 43e96d7 commit 12ea6ad

File tree

861 files changed

+6044
-4469
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

861 files changed

+6044
-4469
lines changed

.devcontainer/.gitignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
*
2+
3+
!/assets/
4+
!/assets/cradles/
5+
!/assets/cradles/cabal/
6+
!/assets/cradles/stack/
7+
!/backups/
8+
!/bind-mounts/
9+
!/conf/
10+
!/conf/etc/
11+
!/conf/etc/stack/
12+
!/ghc-*/
13+
!/scripts/
14+
!/scripts/usr/
15+
!/scripts/usr/local/
16+
!/scripts/usr/local/bin/
17+
18+
!/assets/cradles/cabal/hie.yaml
19+
!/assets/cradles/stack/hie.yaml
20+
!/conf/etc/stack/config.yaml
21+
!/ghc-*/devcontainer.json
22+
!/scripts/usr/local/bin/*.sh
23+
24+
!/devcontainer.json
25+
!/GHC.Dockerfile
26+
!/LICENSE
27+
!/README.md
28+
29+
!.gitignore
30+
!.keep

.devcontainer/GHC.Dockerfile

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
ARG BUILD_ON_IMAGE=glcr.b-data.ch/ghc/ghc-musl
2+
ARG GHC_VERSION=latest
3+
ARG HLS_VERSION
4+
ARG STACK_VERSION
5+
6+
ARG HLS_GHC_VERSION=${HLS_VERSION:+$GHC_VERSION}
7+
ARG HLS_SFX=/${HLS_GHC_VERSION:-all}/hls:${HLS_VERSION:-none}
8+
9+
ARG STACK_VERSION_OVERRIDE=${STACK_VERSION:-none}
10+
11+
FROM ${BUILD_ON_IMAGE}:${GHC_VERSION} as files
12+
13+
RUN mkdir /files
14+
15+
COPY conf /files
16+
COPY scripts /files
17+
18+
## Ensure file modes are correct
19+
RUN find /files -type d -exec chmod 755 {} \; \
20+
&& find /files -type f -exec chmod 644 {} \; \
21+
&& find /files/usr/local/bin -type f -exec chmod 755 {} \;
22+
23+
FROM glcr.b-data.ch/commercialhaskell/ssi:${STACK_VERSION_OVERRIDE} as ssi
24+
25+
FROM ${BUILD_ON_IMAGE}${HLS_SFX} as hls
26+
27+
FROM glcr.b-data.ch/ndmitchell/hlsi:latest as hlsi
28+
29+
FROM docker.io/koalaman/shellcheck:stable as sci
30+
31+
FROM ${BUILD_ON_IMAGE}:${GHC_VERSION}
32+
33+
COPY --from=files /files /
34+
35+
RUN sysArch="$(uname -m)" \
36+
## Ensure that common CA certificates
37+
## and OpenSSL libraries are up to date
38+
&& apk upgrade --no-cache ca-certificates openssl-dev \
39+
## Install pip
40+
&& apk add --no-cache py3-pip \
41+
## Install terminal multiplexers
42+
&& apk add --no-cache screen tmux \
43+
## Install yamllint
44+
&& apk add --no-cache yamllint \
45+
## Install hadolint
46+
&& case "$sysArch" in \
47+
x86_64) tarArch="x86_64" ;; \
48+
aarch64) tarArch="arm64" ;; \
49+
*) echo "error: Architecture $sysArch unsupported"; exit 1 ;; \
50+
esac \
51+
&& apiResponse="$(curl -sSL \
52+
https://api.github.com/repos/hadolint/hadolint/releases/latest)" \
53+
&& downloadUrl="$(echo "$apiResponse" | grep -e \
54+
"browser_download_url.*Linux-$tarArch\"" | cut -d : -f 2,3 | tr -d \")" \
55+
&& echo "$downloadUrl" | xargs curl -sSLo /usr/local/bin/hadolint \
56+
&& chmod 755 /usr/local/bin/hadolint
57+
58+
## Update environment
59+
ARG USE_ZSH_FOR_ROOT
60+
ARG SET_LANG
61+
ARG SET_TZ
62+
63+
ENV TZ=${SET_TZ:-$TZ} \
64+
LANG=${SET_LANG:-$LANG}
65+
66+
## Change root's shell to ZSH
67+
RUN if [ -n "$USE_ZSH_FOR_ROOT" ]; then \
68+
apk add --no-cache zsh shadow; \
69+
fix-chsh.sh; \
70+
chsh -s /bin/zsh; \
71+
fi \
72+
## Update timezone if needed
73+
&& if [ "$TZ" != "" ]; then \
74+
apk add --no-cache tzdata; \
75+
echo "Setting TZ to $TZ"; \
76+
ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime \
77+
&& echo "$TZ" > /etc/timezone; \
78+
fi \
79+
## Add/Update locale if needed
80+
&& if [ "$LANG" != "C.UTF-8" ]; then \
81+
if [ -n "$LANG" ]; then \
82+
apk add --no-cache musl-locales musl-locales-lang; \
83+
fi; \
84+
sed -i "s/LANG=C.UTF-8/LANG=$LANG/" /etc/profile.d/*locale.sh; \
85+
sed -i "s/LANG:-C.UTF-8/LANG:-$LANG/" /etc/profile.d/*locale.sh; \
86+
sed -i "s/LC_COLLATE=C/LC_COLLATE=$LANG/" /etc/profile.d/*locale.sh; \
87+
sed -i "s/LC_COLLATE:-C/LC_COLLATE:-$LANG/" /etc/profile.d/*locale.sh; \
88+
fi
89+
90+
## Copy binaries as late as possible to avoid cache busting
91+
## Install Stack
92+
COPY --from=ssi /usr/local /usr/local
93+
## Install HLS
94+
COPY --from=hls /usr/local /usr/local
95+
## Install HLint
96+
COPY --from=hlsi /usr/local /usr/local
97+
## Install ShellCheck
98+
COPY --from=sci --chown=root:root /bin/shellcheck /usr/local/bin
99+
100+
ARG HLS_VERSION
101+
ARG STACK_VERSION
102+
103+
ARG STACK_VERSION_OVERRIDE=${STACK_VERSION}
104+
105+
ENV HLS_VERSION=${HLS_VERSION} \
106+
STACK_VERSION=${STACK_VERSION_OVERRIDE:-$STACK_VERSION}
107+
108+
RUN if [ "${GHC_VERSION%.*}" = "9.2" ]; then \
109+
if [ -f /usr/local/bin/stack ]; then \
110+
mv -f /usr/local/bin/stack /usr/bin/; \
111+
fi \
112+
fi

.devcontainer/LICENSE

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Copyright (c) 2023 Olivier Benz
2+
3+
The code in this directory is not part of Stack (the software) and, with the
4+
exceptions noted below, is distributed under the terms of the MIT License:
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.
23+
24+
This directory also contains code with other copyrights. The affected files,
25+
their copyrights and license statements are listed below.
26+
27+
--------------------------------------------------------------------------------
28+
scripts/fix-chsh.sh
29+
Copyright (c) Microsoft Corporation. All rights reserved.
30+
31+
Licensed under the MIT License. See
32+
https://github.com/devcontainers/features/blob/main/LICENSE for
33+
license information.
34+
35+
--------------------------------------------------------------------------------

.devcontainer/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Dev Containers
2+
3+
For further information, see
4+
[haskellstack.org](https://docs.haskellstack.org): Stack's code (advanced) \>
5+
Contributors \> Dev Containers or
6+
[../doc/dev_containers.md](../doc/dev_containers.md).
7+
8+
## License
9+
10+
The code in this directory is not part of Stack (the software) and, with the
11+
exceptions noted in [LICENSE](LICENSE), is distributed under the terms of the
12+
MIT License.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
cradle:
2+
multi:
3+
- path: "./Setup.hs"
4+
config:
5+
cradle:
6+
direct:
7+
arguments: []
8+
- path: "./"
9+
config:
10+
cradle:
11+
cabal:
12+
- path: "./src"
13+
component: "lib:stack"
14+
- path: "./app"
15+
component: "stack:exe:stack"
16+
- path: "./tests/integration"
17+
component: "stack:exe:stack-integration-test"
18+
- path: "./tests/unit"
19+
component: "stack:test:stack-unit-test"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
cradle:
2+
multi:
3+
- path: "./Setup.hs"
4+
config:
5+
cradle:
6+
direct:
7+
arguments: []
8+
- path: "./"
9+
config:
10+
cradle:
11+
stack:
12+
- path: "./src"
13+
component: "stack:lib"
14+
- path: "./app"
15+
component: "stack:exe:stack"
16+
- path: "./tests/integration"
17+
component: "stack:exe:stack-integration-test"
18+
- path: "./tests/unit"
19+
component: "stack:test:stack-unit-test"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Use only the GHC available on the PATH
2+
system-ghc: true
3+
# Do not automatically install GHC when necessary
4+
install-ghc: false

.devcontainer/devcontainer.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"name": "Default",
3+
"build": {
4+
"dockerfile": "GHC.Dockerfile",
5+
"args": {
6+
"GHC_VERSION": "9.4.7",
7+
"HLS_VERSION": "2.2.0.0",
8+
"USE_ZSH_FOR_ROOT": "unset-to-use-ash",
9+
"SET_LANG": "C.UTF-8",
10+
"SET_TZ": ""
11+
}
12+
},
13+
14+
"onCreateCommand": "onCreateCommand.sh",
15+
"postCreateCommand": "cabal update",
16+
17+
"features": {
18+
"ghcr.io/devcontainers/features/common-utils:2": {
19+
"configureZshAsDefaultShell": true,
20+
"upgradePackages": false,
21+
"username": "vscode",
22+
"userUid": "automatic",
23+
"userGid": "automatic"
24+
}
25+
},
26+
27+
"customizations": {
28+
"vscode": {
29+
"extensions": [
30+
31+
"exiasr.hadolint",
32+
"GitHub.vscode-pull-request-github",
33+
"haskell.haskell",
34+
"mhutchie.git-graph",
35+
"mutantdino.resourcemonitor",
36+
"timonwong.shellcheck"
37+
],
38+
"settings": {
39+
"gitlens.showWelcomeOnInstall": false,
40+
"gitlens.showWhatsNewAfterUpgrades": false,
41+
"haskell.manageHLS": "PATH",
42+
"resmon.show.battery": false,
43+
"resmon.show.cpufreq": false
44+
}
45+
}
46+
},
47+
48+
// Set 'remoteUser' to 'root' to connect as root instead.
49+
"remoteUser": "vscode",
50+
"mounts": [
51+
"source=stack-default-home-vscode,target=/home/vscode,type=volume"
52+
// "source=${localWorkspaceFolder}/.devcontainer/bind-mounts/stack-default-home-vscode,target=/home/vscode,type=bind"
53+
],
54+
55+
// "remoteUser": "root",
56+
// "mounts": [
57+
// "source=stack-default-root,target=/root,type=volume"
58+
// // "source=${localWorkspaceFolder}/.devcontainer/bind-mounts/stack-default-root,target=/root,type=bind"
59+
// ],
60+
61+
// Pip: Install packages to the user site
62+
"remoteEnv": {
63+
"PIP_USER": "1"
64+
}
65+
}

0 commit comments

Comments
 (0)