Compare commits

..

40 Commits

Author SHA1 Message Date
f084fbce43 Fix f*ckup in docker image creation 2023-03-14 20:56:03 +08:00
c20deceaa8 Improve wording around FreeBSD support 2023-03-11 21:26:16 +08:00
89e4145baf Merge remote-tracking branch 'origin/pr/805' 2023-03-11 21:23:31 +08:00
Alexey Vyskubov
f5f7c26d8a Adds some information about FreeBSD installation. 2023-03-07 13:01:20 +02:00
784942ca58 Update submodule 2023-02-24 20:03:25 +08:00
75de2a7bc1 Merge branch 'ghcup-0.1.19.2' 2023-02-24 20:03:14 +08:00
ea6c8d338c Bump ghcup in bootstrap script 2023-02-24 19:52:50 +08:00
ae625b181c Improve pull_release_artifacts 2023-02-24 19:52:41 +08:00
89ae54a083 Set release date 2023-02-24 00:00:29 +08:00
1bd73591ba Update data/metadata 2023-02-23 23:58:16 +08:00
f709f6e714 Update ChangeLog 2023-02-23 23:56:46 +08:00
3d7e07c371 Merge branch 'issue-796' 2023-02-23 23:52:38 +08:00
8bf17379ac Fix windows bootstrap, fixes #796 2023-02-23 23:41:25 +08:00
4b1225ad71 Merge branch 'issue-797' 2023-02-23 23:15:48 +08:00
d628848af6 Silence hlint 2023-02-23 23:15:08 +08:00
48381be001 Bump GHC 9.2.5 to 9.2.6 2023-02-23 23:07:46 +08:00
b547324253 Smarter variants for 'listDirectory', fixing #797 2023-02-23 21:47:50 +08:00
2b1599c234 Fix windows golden file 2023-02-23 20:57:40 +08:00
7ac8989dfc Bump to 0.1.19.2 2023-02-21 23:01:08 +08:00
cd6666ed30 Merge branch 'latest-prerelease' 2023-02-21 23:00:47 +08:00
5b7478438a Merge branch 'issue-787' 2023-02-21 23:00:31 +08:00
4a830d9fb7 Fix regression in JFS support, fixes #787 2023-02-21 22:48:22 +08:00
785fb895b4 Implement 'latest-prerelease' tag wrt #788 2023-02-21 22:22:11 +08:00
75e801e9e6 Merge branch 'ghcup-0.1.19.1' 2023-02-20 00:03:26 +08:00
6ffd5328a4 Improve sftp-symlink-artifacts.sh 2023-02-20 00:01:11 +08:00
ed509e482b Improve pull_release_artifacts 2023-02-19 23:58:25 +08:00
420323f43b Update bootstrap script to 0.1.19.1 2023-02-19 23:58:07 +08:00
432962792c Update ghcup-metadata 2023-02-19 22:56:33 +08:00
cb193f6069 Update ChangeLog for 0.1.19.1 2023-02-19 22:55:47 +08:00
2f268b6a25 Bump GHCup version 2023-02-19 22:44:28 +08:00
580606af14 Merge remote-tracking branch 'origin/pr/773' 2023-02-19 22:42:08 +08:00
faa1c3992b Merge branch 'issue-762' 2023-02-19 22:41:27 +08:00
d17efef853 Merge branch 'issue-784' 2023-02-19 21:38:41 +08:00
179d4dd493 Fixup 2023-02-19 19:33:01 +08:00
5fa10390a3 Fix CI 2023-02-19 19:15:09 +08:00
e1e6f579d5 Use debian:10 rather 2023-02-19 18:48:42 +08:00
6cf9967e7c Work around missing libtinfo.so.6 2023-02-12 18:41:40 +08:00
15a75d790a Build arm binaries in bionic images, fixes #762 2023-02-12 17:16:32 +08:00
988672ea75 Build arm images for bionic as well wrh #762 2023-02-12 17:16:27 +08:00
ksqsf
9baba88f75 Add a known mirror 2023-02-08 22:09:04 +08:00
29 changed files with 438 additions and 142 deletions

View File

@@ -129,6 +129,27 @@ build_with_cache() {
} }
install_ghcup() { install_ghcup() {
case "${RUNNER_OS}" in
"Linux")
case "${ARCH}" in
"ARM"*)
if command -v ghcup ; then
mkdir -p "$GHCUP_BIN"
cp "$(command -v ghcup)" "$GHCUP_BIN/ghcup${ext}"
else
install_ghcup_curl_sh
fi
;;
*) install_ghcup_curl_sh
;;
esac
;;
*) install_ghcup_curl_sh
;;
esac
}
install_ghcup_curl_sh() {
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_MINIMAL=1 BOOTSTRAP_HASKELL_INSTALL_NO_STACK=yes sh curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_MINIMAL=1 BOOTSTRAP_HASKELL_INSTALL_NO_STACK=yes sh
} }

View File

@@ -51,5 +51,8 @@ jobs:
- if: runner.os == 'Windows' - if: runner.os == 'Windows'
name: Run bootstrap name: Run bootstrap
run: ./scripts/bootstrap/bootstrap-haskell.ps1 -InstallDir ${GITHUB_WORKSPACE} -BootstrapUrl ${GITHUB_WORKSPACE}/bootstrap-haskell -InBash run: |
$curDir = Get-Location
Write-Host "Current Working Directory: $curDir"
./scripts/bootstrap/bootstrap-haskell.ps1 -InstallDir ${GITHUB_WORKSPACE} -BootstrapUrl ("{0}/scripts/bootstrap/bootstrap-haskell" -f $curDir) -InBash
shell: pwsh shell: pwsh

View File

@@ -53,7 +53,7 @@ jobs:
platforms: linux/amd64 platforms: linux/amd64
docker-arm32: docker-arm32:
runs-on: [self-hosted, Linux, ARM64, aarch32-linux] runs-on: [self-hosted, Linux, ARM64]
steps: steps:
- uses: docker://arm64v8/ubuntu:focal - uses: docker://arm64v8/ubuntu:focal
name: Cleanup (aarch64 linux) name: Cleanup (aarch64 linux)
@@ -72,10 +72,18 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push - name: Build and push (debian buster)
uses: docker/build-push-action@v3 uses: docker/build-push-action@v3
with: with:
context: ./docker/arm32v7 context: ./docker/arm32v7/buster
push: true
tags: hasufell/arm32v7-debian-haskell:10
platforms: linux/arm
- name: Build and push (ubuntu focal)
uses: docker/build-push-action@v3
with:
context: ./docker/arm32v7/focal
push: true push: true
tags: hasufell/arm32v7-ubuntu-haskell:focal tags: hasufell/arm32v7-ubuntu-haskell:focal
platforms: linux/arm platforms: linux/arm
@@ -100,10 +108,18 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push - name: Build and push (debian buster)
uses: docker/build-push-action@v3 uses: docker/build-push-action@v3
with: with:
context: ./docker/arm64v8/ context: ./docker/arm64v8/buster
push: true
tags: hasufell/arm64v8-debian-haskell:10
platforms: linux/arm64
- name: Build and push (ubuntu focal)
uses: docker/build-push-action@v3
with:
context: ./docker/arm64v8/focal
push: true push: true
tags: hasufell/arm64v8-ubuntu-haskell:focal tags: hasufell/arm64v8-ubuntu-haskell:focal
platforms: linux/arm64 platforms: linux/arm64

View File

@@ -96,10 +96,10 @@ jobs:
ARCH: ARM ARCH: ARM
- os: [self-hosted, Linux, ARM64] - os: [self-hosted, Linux, ARM64]
ARTIFACT: "aarch64-linux-ghcup" ARTIFACT: "aarch64-linux-ghcup"
GHC_VER: 9.2.5 GHC_VER: 9.2.6
ARCH: ARM64 ARCH: ARM64
steps: steps:
- uses: docker://arm64v8/ubuntu:focal - uses: docker://arm64v8/debian:10
name: Cleanup (aarch64 linux) name: Cleanup (aarch64 linux)
with: with:
args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +" args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +"
@@ -115,7 +115,7 @@ jobs:
submodules: 'true' submodules: 'true'
- if: matrix.ARCH == 'ARM' - if: matrix.ARCH == 'ARM'
uses: docker://hasufell/arm32v7-ubuntu-haskell:focal uses: docker://hasufell/arm32v7-debian-haskell:10
name: Run build (armv7 linux) name: Run build (armv7 linux)
with: with:
args: sh .github/scripts/build.sh args: sh .github/scripts/build.sh
@@ -129,7 +129,7 @@ jobs:
S3_HOST: ${{ env.S3_HOST }} S3_HOST: ${{ env.S3_HOST }}
- if: matrix.ARCH == 'ARM64' - if: matrix.ARCH == 'ARM64'
uses: docker://hasufell/arm64v8-ubuntu-haskell:focal uses: docker://hasufell/arm64v8-debian-haskell:10
name: Run build (aarch64 linux) name: Run build (aarch64 linux)
with: with:
args: sh .github/scripts/build.sh args: sh .github/scripts/build.sh
@@ -166,11 +166,11 @@ jobs:
include: include:
- os: [self-hosted, macOS, ARM64] - os: [self-hosted, macOS, ARM64]
ARTIFACT: "aarch64-apple-darwin-ghcup" ARTIFACT: "aarch64-apple-darwin-ghcup"
GHC_VER: 9.2.5 GHC_VER: 9.2.6
ARCH: ARM64 ARCH: ARM64
- os: macOS-10.15 - os: macOS-10.15
ARTIFACT: "x86_64-apple-darwin-ghcup" ARTIFACT: "x86_64-apple-darwin-ghcup"
GHC_VER: 9.2.5 GHC_VER: 9.2.6
ARCH: 64 ARCH: 64
- os: windows-latest - os: windows-latest
ARTIFACT: "x86_64-mingw64-ghcup" ARTIFACT: "x86_64-mingw64-ghcup"
@@ -337,12 +337,12 @@ jobs:
DISTRO: Ubuntu DISTRO: Ubuntu
- os: [self-hosted, Linux, ARM64] - os: [self-hosted, Linux, ARM64]
ARTIFACT: "aarch64-linux-ghcup" ARTIFACT: "aarch64-linux-ghcup"
GHC_VER: 9.2.5 GHC_VER: 9.2.6
ARCH: ARM64 ARCH: ARM64
DISTRO: Ubuntu DISTRO: Ubuntu
steps: steps:
- uses: docker://arm64v8/ubuntu:focal - uses: docker://arm64v8/debian:10
name: Cleanup (aarch64 linux) name: Cleanup (aarch64 linux)
with: with:
args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +" args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +"
@@ -358,7 +358,7 @@ jobs:
path: ./out path: ./out
- if: matrix.ARCH == 'ARM' - if: matrix.ARCH == 'ARM'
uses: docker://hasufell/arm32v7-ubuntu-haskell:focal uses: docker://hasufell/arm32v7-debian-haskell:10
name: Run test (armv7 linux) name: Run test (armv7 linux)
with: with:
args: sh .github/scripts/test.sh args: sh .github/scripts/test.sh
@@ -369,7 +369,7 @@ jobs:
DISTRO: Ubuntu DISTRO: Ubuntu
- if: matrix.ARCH == 'ARM64' - if: matrix.ARCH == 'ARM64'
uses: docker://hasufell/arm64v8-ubuntu-haskell:focal uses: docker://hasufell/arm64v8-debian-haskell:10
name: Run test (aarch64 linux) name: Run test (aarch64 linux)
with: with:
args: sh .github/scripts/test.sh args: sh .github/scripts/test.sh
@@ -400,12 +400,12 @@ jobs:
include: include:
- os: [self-hosted, macOS, ARM64] - os: [self-hosted, macOS, ARM64]
ARTIFACT: "aarch64-apple-darwin-ghcup" ARTIFACT: "aarch64-apple-darwin-ghcup"
GHC_VER: 9.2.5 GHC_VER: 9.2.6
ARCH: ARM64 ARCH: ARM64
DISTRO: na DISTRO: na
- os: macOS-10.15 - os: macOS-10.15
ARTIFACT: "x86_64-apple-darwin-ghcup" ARTIFACT: "x86_64-apple-darwin-ghcup"
GHC_VER: 9.2.5 GHC_VER: 9.2.6
ARCH: 64 ARCH: 64
DISTRO: na DISTRO: na
- os: windows-latest - os: windows-latest

View File

@@ -1,5 +1,22 @@
# Revision history for ghcup # Revision history for ghcup
## 0.1.19.2 -- 2023-2-24
* Follow-up fix for JFS/ReiserFS and other filesystem that don't support `d_type`, fixes [#787](https://github.com/haskell/ghcup-hs/issues/787)
- the previous release had a bug that invalidated that broke it
* Implement 'latest-prerelease' tag wrt [#788](https://github.com/haskell/ghcup-hs/issues/788)
* Fix 'Could not parse version of stray directory.DS_Store' warnings on macOs wrt [#797](https://github.com/haskell/ghcup-hs/issues/797)
## 0.1.19.1 -- 2023-2-19
* Fix GHCup on JFS/ReiserFS and other filesystem that don't support `d_type`, fixes [#766](https://github.com/haskell/ghcup-hs/issues/766)
* Don't fail on setModificationTime, fixes [#784](https://github.com/haskell/ghcup-hs/issues/784) and many GitHub actions issues
* Make armv7/aarch64 linux binaries more portable (built on Debian buster)
* Improve usability on 'ghcup config add-release-channel', fixes [#751](https://github.com/haskell/ghcup-hs/issues/751)
* Make version shortcuts work with 'ghcup set', fixes [#757](https://github.com/haskell/ghcup-hs/issues/757)
* Don't implicitly smuggle in config options in `ghcup config set` wrt [#775](https://github.com/haskell/ghcup-hs/issues/775)
* Fix build on unix with -ftui
## 0.1.19.0 -- 2023-1-13 ## 0.1.19.0 -- 2023-1-13
* restore proper support for FreeBSD and Linux armv7 * restore proper support for FreeBSD and Linux armv7

View File

@@ -4,6 +4,7 @@
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeApplications #-}
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ViewPatterns #-}
module BrickMain where module BrickMain where
@@ -154,8 +155,11 @@ ui dimAttrs BrickState{ appSettings = as@BrickSettings{}, ..}
<+> minHSize 15 (str "Version") <+> minHSize 15 (str "Version")
<+> padLeft (Pad 1) (minHSize 25 $ str "Tags") <+> padLeft (Pad 1) (minHSize 25 $ str "Tags")
<+> padLeft (Pad 5) (str "Notes") <+> padLeft (Pad 5) (str "Notes")
renderList' = withDefAttr listAttr . drawListElements renderItem True renderList' bis@BrickInternalState{..} =
renderItem _ b listResult@ListResult{..} = let getMinLength = length . intercalate "," . fmap tagToString
minLength = V.maximum $ V.map (getMinLength . lTag) clr
in withDefAttr listAttr . drawListElements (renderItem minLength) True $ bis
renderItem minTagSize _ b listResult@ListResult{lTag = lTag', ..} =
let marks = if let marks = if
| lSet -> (withAttr (attrName "set") $ str "✔✔") | lSet -> (withAttr (attrName "set") $ str "✔✔")
| lInstalled -> (withAttr (attrName "installed") $ str "") | lInstalled -> (withAttr (attrName "installed") $ str "")
@@ -170,7 +174,7 @@ ui dimAttrs BrickState{ appSettings = as@BrickSettings{}, ..}
= updateAttrMap (const dimAttrs) . withAttr (attrName "no-bindist") = updateAttrMap (const dimAttrs) . withAttr (attrName "no-bindist")
| otherwise = id | otherwise = id
hooray hooray
| elem Latest lTag && not lInstalled = | elem Latest lTag' && not lInstalled =
withAttr (attrName "hooray") withAttr (attrName "hooray")
| otherwise = id | otherwise = id
active = if b then putCursor "GHCup" (Location (0,0)) . forceAttr (attrName "active") else id active = if b then putCursor "GHCup" (Location (0,0)) . forceAttr (attrName "active") else id
@@ -181,8 +185,8 @@ ui dimAttrs BrickState{ appSettings = as@BrickSettings{}, ..}
(printTool lTool) (printTool lTool)
) )
<+> minHSize 15 (str ver) <+> minHSize 15 (str ver)
<+> (let l = catMaybes . fmap printTag $ sort lTag <+> (let l = catMaybes . fmap printTag $ sort lTag'
in padLeft (Pad 1) $ minHSize 25 $ if null l in padLeft (Pad 1) $ minHSize minTagSize $ if null l
then emptyWidget then emptyWidget
else foldr1 (\x y -> x <+> str "," <+> y) l else foldr1 (\x y -> x <+> str "," <+> y) l
) )
@@ -200,6 +204,7 @@ ui dimAttrs BrickState{ appSettings = as@BrickSettings{}, ..}
printTag Prerelease = Just $ withAttr (attrName "prerelease") $ str "prerelease" printTag Prerelease = Just $ withAttr (attrName "prerelease") $ str "prerelease"
printTag (Base pvp'') = Just $ str ("base-" ++ T.unpack (prettyPVP pvp'')) printTag (Base pvp'') = Just $ str ("base-" ++ T.unpack (prettyPVP pvp''))
printTag Old = Nothing printTag Old = Nothing
printTag LatestPrerelease = Just $ withAttr (attrName "latest-prerelease") $ str "latest-prerelease"
printTag (UnknownTag t) = Just $ str t printTag (UnknownTag t) = Just $ str t
printTool Cabal = str "cabal" printTool Cabal = str "cabal"
@@ -274,6 +279,7 @@ defaultAttributes no_color = attrMap
, (attrName "recommended" , Vty.defAttr `withForeColor` Vty.green) , (attrName "recommended" , Vty.defAttr `withForeColor` Vty.green)
, (attrName "hls-powered" , Vty.defAttr `withForeColor` Vty.green) , (attrName "hls-powered" , Vty.defAttr `withForeColor` Vty.green)
, (attrName "latest" , Vty.defAttr `withForeColor` Vty.yellow) , (attrName "latest" , Vty.defAttr `withForeColor` Vty.yellow)
, (attrName "latest-prerelease" , Vty.defAttr `withForeColor` Vty.red)
, (attrName "prerelease" , Vty.defAttr `withForeColor` Vty.red) , (attrName "prerelease" , Vty.defAttr `withForeColor` Vty.red)
, (attrName "compiled" , Vty.defAttr `withForeColor` Vty.blue) , (attrName "compiled" , Vty.defAttr `withForeColor` Vty.blue)
, (attrName "stray" , Vty.defAttr `withForeColor` Vty.blue) , (attrName "stray" , Vty.defAttr `withForeColor` Vty.blue)

View File

@@ -246,8 +246,9 @@ toolVersionTagEither s' =
tagEither :: String -> Either String Tag tagEither :: String -> Either String Tag
tagEither s' = case fmap toLower s' of tagEither s' = case fmap toLower s' of
"recommended" -> Right Recommended "recommended" -> Right Recommended
"latest" -> Right Latest "latest" -> Right Latest
"latest-prerelease" -> Right LatestPrerelease
('b':'a':'s':'e':'-':ver') -> case pvp (T.pack ver') of ('b':'a':'s':'e':'-':ver') -> case pvp (T.pack ver') of
Right x -> Right (Base x) Right x -> Right (Base x)
Left _ -> Left $ "Invalid PVP version for base " <> ver' Left _ -> Left $ "Invalid PVP version for base " <> ver'
@@ -452,7 +453,7 @@ tagCompleter tool add = listIOCompleter $ do
let allTags = filter (/= Old) let allTags = filter (/= Old)
$ _viTags =<< M.elems (availableToolVersions (_ghcupDownloads ghcupInfo) tool) $ _viTags =<< M.elems (availableToolVersions (_ghcupDownloads ghcupInfo) tool)
pure $ nub $ (add ++) $ fmap tagToString allTags pure $ nub $ (add ++) $ fmap tagToString allTags
VLeft _ -> pure (nub $ ["recommended", "latest"] ++ add) VLeft _ -> pure (nub $ ["recommended", "latest", "latest-prerelease"] ++ add)
versionCompleter :: Maybe ListCriteria -> Tool -> Completer versionCompleter :: Maybe ListCriteria -> Tool -> Completer
versionCompleter criteria tool = versionCompleter' criteria tool (const True) versionCompleter criteria tool = versionCompleter' criteria tool (const True)
@@ -706,6 +707,9 @@ fromVersion' (SetToolVersion v) tool = do
fromVersion' (SetToolTag Latest) tool = do fromVersion' (SetToolTag Latest) tool = do
GHCupInfo { _ghcupDownloads = dls } <- lift getGHCupInfo GHCupInfo { _ghcupDownloads = dls } <- lift getGHCupInfo
bimap mkTVer Just <$> getLatest dls tool ?? TagNotFound Latest tool bimap mkTVer Just <$> getLatest dls tool ?? TagNotFound Latest tool
fromVersion' (SetToolTag LatestPrerelease) tool = do
GHCupInfo { _ghcupDownloads = dls } <- lift getGHCupInfo
bimap mkTVer Just <$> getLatestPrerelease dls tool ?? TagNotFound LatestPrerelease tool
fromVersion' (SetToolTag Recommended) tool = do fromVersion' (SetToolTag Recommended) tool = do
GHCupInfo { _ghcupDownloads = dls } <- lift getGHCupInfo GHCupInfo { _ghcupDownloads = dls } <- lift getGHCupInfo
bimap mkTVer Just <$> getRecommended dls tool ?? TagNotFound Recommended tool bimap mkTVer Just <$> getRecommended dls tool ?? TagNotFound Recommended tool

View File

@@ -107,6 +107,7 @@ printListResult no_color raw lr = do
printTag Prerelease = color Red "prerelease" printTag Prerelease = color Red "prerelease"
printTag (Base pvp'') = "base-" ++ T.unpack (prettyPVP pvp'') printTag (Base pvp'') = "base-" ++ T.unpack (prettyPVP pvp'')
printTag (UnknownTag t ) = t printTag (UnknownTag t ) = t
printTag LatestPrerelease = color Red "latest-prerelease"
printTag Old = "" printTag Old = ""
let let

View File

@@ -0,0 +1,61 @@
FROM arm32v7/debian:10
ENV LANG C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Asia/Singapore
COPY update_opt.sh /usr/bin/update_opt.sh
RUN chmod +x /usr/bin/update_opt.sh
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
dirmngr \
g++ \
git \
gnupg \
libsqlite3-dev \
libtinfo-dev \
libgmp-dev \
make \
netbase \
openssh-client \
xz-utils \
zlib1g-dev \
libnuma-dev libgmp10 libssl-dev liblzma-dev libbz2-dev wget lsb-release software-properties-common apt-transport-https gcc autoconf automake build-essential gzip patchelf tree \
llvm-11 clang-11 && \
rm -rf /var/lib/apt/lists/*
RUN update_opt.sh 11 1
ARG GHCUP_VERSION=0.1.17.8
ARG GPG_KEY=7784930957807690A66EBDBE3786C5262ECB4A3F
# install ghcup
RUN gpg --batch --keyserver keys.openpgp.org --recv-keys $GPG_KEY && \
curl -sSfL -O https://downloads.haskell.org/~ghcup/$GHCUP_VERSION/armv7-linux-ghcup-$GHCUP_VERSION && \
curl -sSfL -O https://downloads.haskell.org/~ghcup/$GHCUP_VERSION/SHA256SUMS && \
curl -sSfL -O https://downloads.haskell.org/~ghcup/$GHCUP_VERSION/SHA256SUMS.sig && \
gpg --verify SHA256SUMS.sig SHA256SUMS && \
sha256sum -c --ignore-missing SHA256SUMS && \
mv armv7-linux-ghcup-$GHCUP_VERSION /usr/bin/ghcup && \
chmod +x /usr/bin/ghcup && \
rm -rf SHA256SUMS SHA256SUMS.sig
ARG GHC=8.10.7
ARG CABAL_INSTALL=3.6.2.0
ARG STACK=2.9.1
ENV GHCUP_CURL_OPTS="--silent"
ENV NO_COLOR=1
# install haskell toolchain
RUN ghcup config set gpg-setting GPGStrict && \
ghcup --verbose install ghc --isolate=/usr --force ${GHC} && \
ghcup --verbose install cabal --isolate=/usr/bin --force ${CABAL_INSTALL} && \
ghcup gc -s -c -t
ENV PATH /root/.cabal/bin:/root/.ghcup/bin:/root/.local/bin:$PATH
CMD ["ghci"]

View File

@@ -54,10 +54,7 @@ ENV NO_COLOR=1
RUN ghcup config set gpg-setting GPGStrict && \ RUN ghcup config set gpg-setting GPGStrict && \
ghcup --verbose install ghc --isolate=/usr --force ${GHC} && \ ghcup --verbose install ghc --isolate=/usr --force ${GHC} && \
ghcup --verbose install cabal --isolate=/usr/bin --force ${CABAL_INSTALL} && \ ghcup --verbose install cabal --isolate=/usr/bin --force ${CABAL_INSTALL} && \
find "/usr/lib/ghc-${GHC}/" \( -name "*_p.a" -o -name "*.p_hi" \) -type f -delete && \ ghcup gc -s -c -t
rm -r "/usr/share/doc/ghc-${GHC}" && \
rm -rf /tmp/ghcup* && \
ghcup gc -p -s -c -t
ENV PATH /root/.cabal/bin:/root/.ghcup/bin:/root/.local/bin:$PATH ENV PATH /root/.cabal/bin:/root/.ghcup/bin:/root/.local/bin:$PATH

View File

@@ -0,0 +1,61 @@
FROM arm64v8/debian:10
ENV LANG C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Asia/Singapore
COPY update_opt.sh /usr/bin/update_opt.sh
RUN chmod +x /usr/bin/update_opt.sh
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
dirmngr \
g++ \
git \
gnupg \
libsqlite3-dev \
libtinfo-dev \
libgmp-dev \
make \
netbase \
openssh-client \
xz-utils \
zlib1g-dev \
libnuma-dev libgmp10 libssl-dev liblzma-dev libbz2-dev wget lsb-release software-properties-common apt-transport-https gcc autoconf automake build-essential gzip patchelf tree \
llvm-11 clang-11 && \
rm -rf /var/lib/apt/lists/*
RUN update_opt.sh 11 1
ARG GHCUP_VERSION=0.1.18.0
ARG GPG_KEY=7784930957807690A66EBDBE3786C5262ECB4A3F
# install ghcup
RUN gpg --batch --keyserver keys.openpgp.org --recv-keys $GPG_KEY && \
curl -sSfL -O https://downloads.haskell.org/~ghcup/$GHCUP_VERSION/aarch64-linux-ghcup-$GHCUP_VERSION && \
curl -sSfL -O https://downloads.haskell.org/~ghcup/$GHCUP_VERSION/SHA256SUMS && \
curl -sSfL -O https://downloads.haskell.org/~ghcup/$GHCUP_VERSION/SHA256SUMS.sig && \
gpg --verify SHA256SUMS.sig SHA256SUMS && \
sha256sum -c --ignore-missing SHA256SUMS && \
mv aarch64-linux-ghcup-$GHCUP_VERSION /usr/bin/ghcup && \
chmod +x /usr/bin/ghcup && \
rm -rf SHA256SUMS SHA256SUMS.sig
ARG GHC=8.10.7
ARG CABAL_INSTALL=3.6.2.0
ARG STACK=2.9.1
ENV GHCUP_CURL_OPTS="--silent"
ENV NO_COLOR=1
# install haskell toolchain
RUN ghcup config set gpg-setting GPGStrict && \
ghcup --verbose install ghc --isolate=/usr --force ${GHC} && \
ghcup --verbose install cabal --isolate=/usr/bin --force ${CABAL_INSTALL} && \
ghcup gc -s -c -t
ENV PATH /root/.cabal/bin:/root/.ghcup/bin:/root/.local/bin:$PATH
CMD ["ghci"]

View File

@@ -0,0 +1,36 @@
#!/bin/bash
# update_alternatives.sh
update_alternatives() {
local version=${1}
local priority=${2}
local master=${3}
local slaves=${4}
local path=${5}
local cmdln
cmdln="--verbose --install ${path}${master} ${master} ${path}${master}-${version} ${priority}"
for slave in ${slaves}; do
cmdln="${cmdln} --slave ${path}${slave} ${slave} ${path}${slave}-${version}"
done
update-alternatives ${cmdln}
}
if [[ ${#} -ne 2 ]]; then
echo usage: "${0}" clang_version priority
exit 1
fi
version=${1}
priority=${2}
path="/usr/bin/"
master="llvm-config"
slaves="llvm-addr2line llvm-ar llvm-as llvm-bcanalyzer llvm-bitcode-strip llvm-cat llvm-cfi-verify llvm-cov llvm-c-test llvm-cvtres llvm-cxxdump llvm-cxxfilt llvm-cxxmap llvm-debuginfod llvm-debuginfod-find llvm-diff llvm-dis llvm-dlltool llvm-dwarfdump llvm-dwarfutil llvm-dwp llvm-exegesis llvm-extract llvm-gsymutil llvm-ifs llvm-install-name-tool llvm-jitlink llvm-jitlink-executor llvm-lib llvm-libtool-darwin llvm-link llvm-lipo llvm-lto llvm-lto2 llvm-mc llvm-mca llvm-ml llvm-modextract llvm-mt llvm-nm llvm-objcopy llvm-objdump llvm-omp-device-info llvm-opt-report llvm-otool llvm-pdbutil llvm-PerfectShuffle llvm-profdata llvm-profgen llvm-ranlib llvm-rc llvm-readelf llvm-readobj llvm-reduce llvm-remark-size-diff llvm-rtdyld llvm-sim llvm-size llvm-split llvm-stress llvm-strings llvm-strip llvm-symbolizer llvm-tapi-diff llvm-tblgen llvm-tli-checker llvm-undname llvm-windres llvm-xray"
update_alternatives "${version}" "${priority}" "${master}" "${slaves}" "${path}"
master="clang"
slaves="analyze-build asan_symbolize bugpoint c-index-test clang++ clang-apply-replacements clang-change-namespace clang-check clang-cl clang-cpp clangd clang-doc clang-extdef-mapping clang-format clang-format-diff clang-include-fixer clang-linker-wrapper clang-move clang-nvlink-wrapper clang-offload-bundler clang-offload-packager clang-offload-wrapper clang-pseudo clang-query clang-refactor clang-rename clang-reorder-fields clang-repl clang-scan-deps clang-tidy count diagtool dsymutil FileCheck find-all-symbols git-clang-format hmaptool hwasan_symbolize intercept-build ld64.lld ld.lld llc lld lldb lldb-argdumper lldb-instr lldb-server lldb-vscode lld-link lli lli-child-target modularize not obj2yaml opt pp-trace run-clang-tidy sancov sanstats scan-build scan-build-py scan-view split-file UnicodeNameMappingGenerator verify-uselistorder wasm-ld yaml2obj yaml-bench"
update_alternatives "${version}" "${priority}" "${master}" "${slaves}" "${path}"

View File

@@ -54,10 +54,7 @@ ENV NO_COLOR=1
RUN ghcup config set gpg-setting GPGStrict && \ RUN ghcup config set gpg-setting GPGStrict && \
ghcup --verbose install ghc --isolate=/usr --force ${GHC} && \ ghcup --verbose install ghc --isolate=/usr --force ${GHC} && \
ghcup --verbose install cabal --isolate=/usr/bin --force ${CABAL_INSTALL} && \ ghcup --verbose install cabal --isolate=/usr/bin --force ${CABAL_INSTALL} && \
find "/usr/lib/ghc-${GHC}/" \( -name "*_p.a" -o -name "*.p_hi" \) -type f -delete && \ ghcup gc -s -c -t
rm -r "/usr/share/doc/ghc-${GHC}" && \
rm -rf /tmp/ghcup* && \
ghcup gc -p -s -c -t
ENV PATH /root/.cabal/bin:/root/.ghcup/bin:/root/.local/bin:$PATH ENV PATH /root/.cabal/bin:/root/.ghcup/bin:/root/.local/bin:$PATH

View File

@@ -0,0 +1,36 @@
#!/bin/bash
# update_alternatives.sh
update_alternatives() {
local version=${1}
local priority=${2}
local master=${3}
local slaves=${4}
local path=${5}
local cmdln
cmdln="--verbose --install ${path}${master} ${master} ${path}${master}-${version} ${priority}"
for slave in ${slaves}; do
cmdln="${cmdln} --slave ${path}${slave} ${slave} ${path}${slave}-${version}"
done
update-alternatives ${cmdln}
}
if [[ ${#} -ne 2 ]]; then
echo usage: "${0}" clang_version priority
exit 1
fi
version=${1}
priority=${2}
path="/usr/bin/"
master="llvm-config"
slaves="llvm-addr2line llvm-ar llvm-as llvm-bcanalyzer llvm-bitcode-strip llvm-cat llvm-cfi-verify llvm-cov llvm-c-test llvm-cvtres llvm-cxxdump llvm-cxxfilt llvm-cxxmap llvm-debuginfod llvm-debuginfod-find llvm-diff llvm-dis llvm-dlltool llvm-dwarfdump llvm-dwarfutil llvm-dwp llvm-exegesis llvm-extract llvm-gsymutil llvm-ifs llvm-install-name-tool llvm-jitlink llvm-jitlink-executor llvm-lib llvm-libtool-darwin llvm-link llvm-lipo llvm-lto llvm-lto2 llvm-mc llvm-mca llvm-ml llvm-modextract llvm-mt llvm-nm llvm-objcopy llvm-objdump llvm-omp-device-info llvm-opt-report llvm-otool llvm-pdbutil llvm-PerfectShuffle llvm-profdata llvm-profgen llvm-ranlib llvm-rc llvm-readelf llvm-readobj llvm-reduce llvm-remark-size-diff llvm-rtdyld llvm-sim llvm-size llvm-split llvm-stress llvm-strings llvm-strip llvm-symbolizer llvm-tapi-diff llvm-tblgen llvm-tli-checker llvm-undname llvm-windres llvm-xray"
update_alternatives "${version}" "${priority}" "${master}" "${slaves}" "${path}"
master="clang"
slaves="analyze-build asan_symbolize bugpoint c-index-test clang++ clang-apply-replacements clang-change-namespace clang-check clang-cl clang-cpp clangd clang-doc clang-extdef-mapping clang-format clang-format-diff clang-include-fixer clang-linker-wrapper clang-move clang-nvlink-wrapper clang-offload-bundler clang-offload-packager clang-offload-wrapper clang-pseudo clang-query clang-refactor clang-rename clang-reorder-fields clang-repl clang-scan-deps clang-tidy count diagtool dsymutil FileCheck find-all-symbols git-clang-format hmaptool hwasan_symbolize intercept-build ld64.lld ld.lld llc lld lldb lldb-argdumper lldb-instr lldb-server lldb-vscode lld-link lli lli-child-target modularize not obj2yaml opt pp-trace run-clang-tidy sancov sanstats scan-build scan-build-py scan-view split-file UnicodeNameMappingGenerator verify-uselistorder wasm-ld yaml2obj yaml-bench"
update_alternatives "${version}" "${priority}" "${master}" "${slaves}" "${path}"

View File

@@ -163,6 +163,7 @@ ghcup --url-source=https://some-url/ghcup-0.0.6.yaml list
#### Known mirrors #### Known mirrors
1. [https://mirror.sjtu.edu.cn/docs/ghcup](https://mirror.sjtu.edu.cn/docs/ghcup) 1. [https://mirror.sjtu.edu.cn/docs/ghcup](https://mirror.sjtu.edu.cn/docs/ghcup)
2. [https://mirrors.ustc.edu.cn/help/ghcup.html](https://mirrors.ustc.edu.cn/help/ghcup.html)
### (Pre-)Release channels ### (Pre-)Release channels

View File

@@ -77,6 +77,8 @@ On Darwin M1 you might also need a working llvm installed (e.g. via brew) and ha
The following distro packages are required: `curl gcc gmp gmake ncurses perl5 libffi libiconv` The following distro packages are required: `curl gcc gmp gmake ncurses perl5 libffi libiconv`
Notice that only FreeBSD 13.x is supported. If the installation fails, complaining about `libncursesw.8.so`, you will need to install FreeBSD 12 compat package first, for example, `pkg install misc/compat12x`.
### Windows ### Windows
On Windows, msys2 should already have been set up during the installation, so most users should just proceed. If you are installing manually, make sure to have a working mingw64 toolchain and shell. On Windows, msys2 should already have been set up during the installation, so most users should just proceed. If you are installing manually, make sure to have a working mingw64 toolchain and shell.
@@ -231,8 +233,9 @@ There are various issues with GHC itself.
### FreeBSD ### FreeBSD
Lacks some upstream bindists and may need compat libs, since most bindists are built on FreeBSD-12. Lacks some upstream bindists and may need compat libs (such as `misc/compat12x`).
HLS bindists are experimental. HLS bindists are experimental.
Only latest FreeBSD is generally supported.
### Linux ARMv7/AARCH64 ### Linux ARMv7/AARCH64

View File

@@ -1,6 +1,6 @@
cabal-version: 2.4 cabal-version: 2.4
name: ghcup name: ghcup
version: 0.1.19.0 version: 0.1.19.2
license: LGPL-3.0-only license: LGPL-3.0-only
license-file: LICENSE license-file: LICENSE
copyright: Julian Ospald 2020 copyright: Julian Ospald 2020

View File

@@ -124,7 +124,6 @@ readDirEntPortable (DirStreamPortable (basedir, dirs)) = do
(DirType #{const DT_LNK}, _) -> pure (dt, fp) (DirType #{const DT_LNK}, _) -> pure (dt, fp)
(DirType #{const DT_REG}, _) -> pure (dt, fp) (DirType #{const DT_REG}, _) -> pure (dt, fp)
(DirType #{const DT_SOCK}, _) -> pure (dt, fp) (DirType #{const DT_SOCK}, _) -> pure (dt, fp)
(DirType #{const DT_UNKNOWN}, _) -> pure (dt, fp)
(_, _) (_, _)
| fp /= "" -> do | fp /= "" -> do
stat <- getSymbolicLinkStatus (basedir </> fp) stat <- getSymbolicLinkStatus (basedir </> fp)
@@ -136,4 +135,5 @@ readDirEntPortable (DirStreamPortable (basedir, dirs)) = do
| isRegularFile stat -> DirType #{const DT_REG} | isRegularFile stat -> DirType #{const DT_REG}
| isSocket stat -> DirType #{const DT_SOCK} | isSocket stat -> DirType #{const DT_SOCK}
| otherwise -> DirType #{const DT_UNKNOWN} | otherwise -> DirType #{const DT_UNKNOWN}
| otherwise -> pure (dt, fp)

View File

@@ -154,6 +154,7 @@ instance NFData VersionInfo
data Tag = Latest data Tag = Latest
| Recommended | Recommended
| Prerelease | Prerelease
| LatestPrerelease
| Base PVP | Base PVP
| Old -- ^ old versions are hidden by default in TUI | Old -- ^ old versions are hidden by default in TUI
| UnknownTag String -- ^ used for upwardscompat | UnknownTag String -- ^ used for upwardscompat
@@ -167,6 +168,7 @@ tagToString Latest = "latest"
tagToString Prerelease = "prerelease" tagToString Prerelease = "prerelease"
tagToString (Base pvp'') = "base-" ++ T.unpack (prettyPVP pvp'') tagToString (Base pvp'') = "base-" ++ T.unpack (prettyPVP pvp'')
tagToString (UnknownTag t ) = t tagToString (UnknownTag t ) = t
tagToString LatestPrerelease = "latest-prerelease"
tagToString Old = "" tagToString Old = ""
instance Pretty Tag where instance Pretty Tag where
@@ -175,6 +177,7 @@ instance Pretty Tag where
pPrint Prerelease = text "prerelease" pPrint Prerelease = text "prerelease"
pPrint (Base pvp'') = text ("base-" ++ T.unpack (prettyPVP pvp'')) pPrint (Base pvp'') = text ("base-" ++ T.unpack (prettyPVP pvp''))
pPrint (UnknownTag t ) = text t pPrint (UnknownTag t ) = text t
pPrint LatestPrerelease = text "latest-prerelease"
pPrint Old = mempty pPrint Old = mempty
data Architecture = A_64 data Architecture = A_64

View File

@@ -66,6 +66,7 @@ instance ToJSON Tag where
toJSON Prerelease = String "Prerelease" toJSON Prerelease = String "Prerelease"
toJSON Old = String "old" toJSON Old = String "old"
toJSON (Base pvp'') = String ("base-" <> prettyPVP pvp'') toJSON (Base pvp'') = String ("base-" <> prettyPVP pvp'')
toJSON LatestPrerelease = String "LatestPrerelease"
toJSON (UnknownTag x ) = String (T.pack x) toJSON (UnknownTag x ) = String (T.pack x)
instance FromJSON Tag where instance FromJSON Tag where
@@ -73,6 +74,7 @@ instance FromJSON Tag where
"Latest" -> pure Latest "Latest" -> pure Latest
"Recommended" -> pure Recommended "Recommended" -> pure Recommended
"Prerelease" -> pure Prerelease "Prerelease" -> pure Prerelease
"LatestPrerelease" -> pure LatestPrerelease
"old" -> pure Old "old" -> pure Old
('b' : 'a' : 's' : 'e' : '-' : ver') -> case pvp (T.pack ver') of ('b' : 'a' : 's' : 'e' : '-' : ver') -> case pvp (T.pack ver') of
Right x -> pure $ Base x Right x -> pure $ Base x

View File

@@ -335,7 +335,7 @@ ghcSet mtarget = do
getInstalledGHCs :: (MonadReader env m, HasDirs env, MonadIO m) => m [Either FilePath GHCTargetVersion] getInstalledGHCs :: (MonadReader env m, HasDirs env, MonadIO m) => m [Either FilePath GHCTargetVersion]
getInstalledGHCs = do getInstalledGHCs = do
ghcdir <- ghcupGHCBaseDir ghcdir <- ghcupGHCBaseDir
fs <- liftIO $ hideErrorDef [NoSuchThing] [] $ listDirectory (fromGHCupPath ghcdir) fs <- liftIO $ hideErrorDef [NoSuchThing] [] $ listDirectoryDirs (fromGHCupPath ghcdir)
forM fs $ \f -> case parseGHCupGHCDir f of forM fs $ \f -> case parseGHCupGHCDir f of
Right r -> pure $ Right r Right r -> pure $ Right r
Left _ -> pure $ Left f Left _ -> pure $ Left f
@@ -438,7 +438,7 @@ getInstalledHLSs = do
Nothing -> pure $ Left f Nothing -> pure $ Left f
hlsdir <- ghcupHLSBaseDir hlsdir <- ghcupHLSBaseDir
fs <- liftIO $ hideErrorDef [NoSuchThing] [] $ listDirectory (fromGHCupPath hlsdir) fs <- liftIO $ hideErrorDef [NoSuchThing] [] $ listDirectoryDirs (fromGHCupPath hlsdir)
new <- forM fs $ \f -> case parseGHCupHLSDir f of new <- forM fs $ \f -> case parseGHCupHLSDir f of
Right r -> pure $ Right r Right r -> pure $ Right r
Left _ -> pure $ Left f Left _ -> pure $ Left f
@@ -626,7 +626,7 @@ hlsInternalServerScripts ver mghcVer = do
dir <- ghcupHLSDir ver dir <- ghcupHLSDir ver
let bdir = fromGHCupPath dir </> "bin" let bdir = fromGHCupPath dir </> "bin"
fmap (bdir </>) . filter (\f -> maybe True (\gv -> ("-" <> T.unpack (prettyVer gv)) `isSuffixOf` f) mghcVer) fmap (bdir </>) . filter (\f -> maybe True (\gv -> ("-" <> T.unpack (prettyVer gv)) `isSuffixOf` f) mghcVer)
<$> liftIO (listDirectory bdir) <$> liftIO (listDirectoryFiles bdir)
-- | Get all binaries for a hls version from the ~/.ghcup/hls/<ver>/lib/haskell-language-server-<ver>/bin directory, if any. -- | Get all binaries for a hls version from the ~/.ghcup/hls/<ver>/lib/haskell-language-server-<ver>/bin directory, if any.
-- Returns the full path. -- Returns the full path.
@@ -639,7 +639,7 @@ hlsInternalServerBinaries ver mghcVer = do
let regex = makeRegexOpts compExtended execBlank ([s|^haskell-language-server-.*$|] :: ByteString) let regex = makeRegexOpts compExtended execBlank ([s|^haskell-language-server-.*$|] :: ByteString)
(Just bdir) <- fmap headMay $ liftIO $ expandFilePath [Left (dir </> "lib"), Right regex, Left "bin"] (Just bdir) <- fmap headMay $ liftIO $ expandFilePath [Left (dir </> "lib"), Right regex, Left "bin"]
fmap (bdir </>) . filter (\f -> maybe True (\gv -> ("-" <> T.unpack (prettyVer gv)) `isSuffixOf` f) mghcVer) fmap (bdir </>) . filter (\f -> maybe True (\gv -> ("-" <> T.unpack (prettyVer gv)) `isSuffixOf` f) mghcVer)
<$> liftIO (listDirectory bdir) <$> liftIO (listDirectoryFiles bdir)
-- | Get all libraries for a hls version from the ~/.ghcup/hls/<ver>/lib/haskell-language-server-<ver>/lib/<ghc-ver>/ -- | Get all libraries for a hls version from the ~/.ghcup/hls/<ver>/lib/haskell-language-server-<ver>/lib/<ghc-ver>/
-- directory, if any. -- directory, if any.
@@ -652,7 +652,7 @@ hlsInternalServerLibs ver ghcVer = do
dir <- fromGHCupPath <$> ghcupHLSDir ver dir <- fromGHCupPath <$> ghcupHLSDir ver
let regex = makeRegexOpts compExtended execBlank ([s|^haskell-language-server-.*$|] :: ByteString) let regex = makeRegexOpts compExtended execBlank ([s|^haskell-language-server-.*$|] :: ByteString)
(Just bdir) <- fmap headMay $ liftIO $ expandFilePath [Left (dir </> "lib"), Right regex, Left ("lib" </> T.unpack (prettyVer ghcVer))] (Just bdir) <- fmap headMay $ liftIO $ expandFilePath [Left (dir </> "lib"), Right regex, Left ("lib" </> T.unpack (prettyVer ghcVer))]
fmap (bdir </>) <$> liftIO (listDirectory bdir) fmap (bdir </>) <$> liftIO (listDirectoryFiles bdir)
-- | Get the wrapper binary for an hls version, if any. -- | Get the wrapper binary for an hls version, if any.
@@ -892,6 +892,9 @@ getTagged tag =
getLatest :: GHCupDownloads -> Tool -> Maybe (Version, VersionInfo) getLatest :: GHCupDownloads -> Tool -> Maybe (Version, VersionInfo)
getLatest av tool = headOf (ix tool % getTagged Latest) av getLatest av tool = headOf (ix tool % getTagged Latest) av
getLatestPrerelease :: GHCupDownloads -> Tool -> Maybe (Version, VersionInfo)
getLatestPrerelease av tool = headOf (ix tool % getTagged LatestPrerelease) av
getRecommended :: GHCupDownloads -> Tool -> Maybe (Version, VersionInfo) getRecommended :: GHCupDownloads -> Tool -> Maybe (Version, VersionInfo)
getRecommended av tool = headOf (ix tool % getTagged Recommended) av getRecommended av tool = headOf (ix tool % getTagged Recommended) av
@@ -933,7 +936,7 @@ ghcToolFiles ver = do
whenM (fmap not $ ghcInstalled ver) whenM (fmap not $ ghcInstalled ver)
(throwE (NotInstalled GHC ver)) (throwE (NotInstalled GHC ver))
files <- liftIO (listDirectory bindir >>= filterM (doesFileExist . (bindir </>))) files <- liftIO (listDirectoryFiles bindir >>= filterM (doesFileExist . (bindir </>)))
pure (getUniqueTools . groupToolFiles . fmap (dropSuffix exeExt) $ files) pure (getUniqueTools . groupToolFiles . fmap (dropSuffix exeExt) $ files)
where where

View File

@@ -42,6 +42,9 @@ module GHCup.Utils.Dirs
, removeDirectoryRecursive , removeDirectoryRecursive
, removePathForcibly , removePathForcibly
, listDirectoryFiles
, listDirectoryDirs
-- System.Directory re-exports -- System.Directory re-exports
, createDirectory , createDirectory
, createDirectoryIfMissing , createDirectoryIfMissing
@@ -130,7 +133,7 @@ import Data.Maybe
import Data.Versions import Data.Versions
import GHC.IO.Exception ( IOErrorType(NoSuchThing) ) import GHC.IO.Exception ( IOErrorType(NoSuchThing) )
import Haskus.Utils.Variant.Excepts import Haskus.Utils.Variant.Excepts
import Optics import Optics hiding ( uncons )
import Safe import Safe
import System.Directory hiding ( removeDirectory import System.Directory hiding ( removeDirectory
, removeDirectoryRecursive , removeDirectoryRecursive
@@ -529,6 +532,29 @@ cleanupTrash = do
) $ liftIO $ removePathForcibly (recycleDir `appendGHCupPath` fp)) ) $ liftIO $ removePathForcibly (recycleDir `appendGHCupPath` fp))
-- | List *actual files* in a directory, ignoring empty files and a couple
-- of blacklisted files, such as '.DS_Store' on mac.
listDirectoryFiles :: FilePath -> IO [FilePath]
listDirectoryFiles fp = do
listDirectory fp >>= filterM (doesFileExist . (fp </>)) <&> filter (\fp' -> not (isHidden fp') && not (isBlacklisted fp'))
-- | List *actual directories* in a directory, ignoring empty directories and a couple
-- of blacklisted files, such as '.DS_Store' on mac.
listDirectoryDirs :: FilePath -> IO [FilePath]
listDirectoryDirs fp = do
listDirectory fp >>= filterM (doesDirectoryExist . (fp </>)) <&> filter (\fp' -> not (isHidden fp') && not (isBlacklisted fp'))
isHidden :: FilePath -> Bool
isHidden fp'
| isWindows = False
| Just ('.', _) <- uncons fp' = True
| otherwise = False
isBlacklisted :: FilePath -> Bool
{- HLINT ignore "Use ==" -}
isBlacklisted fp' = fp' `elem` [".DS_Store"]
-- System.Directory re-exports with GHCupPath -- System.Directory re-exports with GHCupPath

View File

@@ -28,7 +28,7 @@
plat="$(uname -s)" plat="$(uname -s)"
arch=$(uname -m) arch=$(uname -m)
ghver="0.1.19.0" ghver="0.1.19.2"
: "${GHCUP_BASE_URL:=https://downloads.haskell.org/~ghcup}" : "${GHCUP_BASE_URL:=https://downloads.haskell.org/~ghcup}"
export GHCUP_SKIP_UPDATE_CHECK=yes export GHCUP_SKIP_UPDATE_CHECK=yes

View File

@@ -7,6 +7,7 @@ shopt -s extglob
RELEASE=$1 RELEASE=$1
SIGNER=$2 SIGNER=$2
TAG=${RELEASE/v/}
echo "RELEASE: $RELEASE" echo "RELEASE: $RELEASE"
echo "SIGNER: $SIGNER" echo "SIGNER: $SIGNER"
@@ -18,17 +19,19 @@ done
[ ! -e "gh-release-artifacts/${RELEASE}" ] [ ! -e "gh-release-artifacts/${RELEASE}" ]
mkdir -p "gh-release-artifacts/${RELEASE}" mkdir -p "gh-release-artifacts/${RELEASE}"
git archive --format=tar.gz -o "gh-release-artifacts/${RELEASE}/ghcup-${TAG}-src.tar.gz" --prefix="ghcup-${TAG}/" HEAD
cd "gh-release-artifacts/${RELEASE}" cd "gh-release-artifacts/${RELEASE}"
# github # github
gh release download $RELEASE gh release download "$RELEASE"
rm test-*
# cirrus # cirrus
curl -L -o x86_64-portbld-freebsd-ghcup-${RELEASE} \ curl -L -o "x86_64-portbld-freebsd-ghcup-${TAG}" \
"https://api.cirrus-ci.com/v1/artifact/github/haskell/ghcup-hs/build/binaries/out/x86_64-portbld-freebsd-ghcup-${RELEASE}?branch=${RELEASE}" "https://api.cirrus-ci.com/v1/artifact/github/haskell/ghcup-hs/build/binaries/out/x86_64-portbld-freebsd-ghcup-${RELEASE}?branch=${RELEASE}"
sha256sum *ghcup* > SHA256SUMS sha256sum ./*-ghcup-* > SHA256SUMS
gpg --detach-sign -u "${SIGNER}" SHA256SUMS gpg --detach-sign -u "${SIGNER}" SHA256SUMS
gh release upload "$RELEASE" "ghcup-${TAG}-src.tar.gz" "x86_64-portbld-freebsd-ghcup-${TAG}" SHA256SUMS SHA256SUMS.sig

View File

@@ -21,8 +21,7 @@ rm i386-linux-ghcup
rm x86_64-apple-darwin-ghcup rm x86_64-apple-darwin-ghcup
rm x86_64-linux-ghcup rm x86_64-linux-ghcup
rm x86_64-mingw64-ghcup.exe rm x86_64-mingw64-ghcup.exe
rm x86_64-freebsd12-ghcup rm x86_64-portbld-freebsd-ghcup
rm x86_64-freebsd13-ghcup
symlink ${ver}/aarch64-apple-darwin-ghcup-${ver} aarch64-apple-darwin-ghcup symlink ${ver}/aarch64-apple-darwin-ghcup-${ver} aarch64-apple-darwin-ghcup
symlink ${ver}/aarch64-linux-ghcup-${ver} aarch64-linux-ghcup symlink ${ver}/aarch64-linux-ghcup-${ver} aarch64-linux-ghcup

View File

@@ -195,8 +195,8 @@
"dlUri": "https:g" "dlUri": "https:g"
}, },
"viTags": [ "viTags": [
"base-3.2.2", "base-6.5.1",
"Prerelease", "base-2.2.5",
"𪔊\u0007\u0015" "𪔊\u0007\u0015"
], ],
"viTestDL": { "viTestDL": {
@@ -271,7 +271,7 @@
"viPreCompile": "thzbtjc", "viPreCompile": "thzbtjc",
"viSourceDL": null, "viSourceDL": null,
"viTags": [ "viTags": [
"old", "LatestPrerelease",
"old" "old"
], ],
"viTestDL": { "viTestDL": {
@@ -993,8 +993,8 @@
"Latest", "Latest",
"Recommended", "Recommended",
"Prerelease", "Prerelease",
"base-2.3.5", "base-6.3.2",
"\u0005EL" "base-6.3.1"
], ],
"viTestDL": null "viTestDL": null
}, },
@@ -1140,9 +1140,9 @@
"viSourceDL": null, "viSourceDL": null,
"viTags": [ "viTags": [
"Latest", "Latest",
"base-2.1.2", "LatestPrerelease",
"base-5.2.1", "base-5.6.5",
"old" "LatestPrerelease"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": -5, "dlCSize": -5,
@@ -1584,13 +1584,13 @@
"dlUri": "https:l" "dlUri": "https:l"
}, },
"viTags": [ "viTags": [
"base-1.1.6", "LatestPrerelease",
"Latest", "Latest",
"old", "old",
"base-4.6.2", "base-4.2.4",
"􀜶l􀻈𠹟󿴠F", "􀜶l􀻈𠹟󿴠F",
"old", "old",
"Recommended" "LatestPrerelease"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": 0, "dlCSize": 0,
@@ -1897,7 +1897,7 @@
"old", "old",
"Latest", "Latest",
"Recommended", "Recommended",
"Prerelease" "base-1.3.3"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": 5, "dlCSize": 5,
@@ -2348,10 +2348,10 @@
"dlUri": "http:" "dlUri": "http:"
}, },
"viTags": [ "viTags": [
"t\u001e\u001aB8", "base-5.5.1",
"old", "old",
"", "",
"old" "LatestPrerelease"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": -4, "dlCSize": -4,
@@ -3337,9 +3337,9 @@
}, },
"viTags": [ "viTags": [
"Prerelease", "Prerelease",
"base-5.6.1", "old",
"base-3.3.3", "*𭡕󼅇󰢑3i",
"base-3.2.1", "base-5.1.4",
"Latest", "Latest",
":ᄻ[" ":ᄻ["
], ],
@@ -3767,9 +3767,9 @@
}, },
"viTags": [ "viTags": [
"Prerelease", "Prerelease",
"base-2.4.6", "base-2.2.4",
"base-4.1.3", "\u0008",
"base-4.4.6" "LatestPrerelease"
], ],
"viTestDL": null "viTestDL": null
}, },
@@ -3901,8 +3901,8 @@
}, },
"viTags": [ "viTags": [
"Latest", "Latest",
"Latest", "base-3.3.5",
"base-3.1.4", "LatestPrerelease",
"Recommended", "Recommended",
"Prerelease", "Prerelease",
"old", "old",
@@ -4030,8 +4030,8 @@
"Recommended", "Recommended",
"Prerelease", "Prerelease",
"Recommended", "Recommended",
"Latest", "base-2.4.6",
"old" "LatestPrerelease"
], ],
"viTestDL": null "viTestDL": null
}, },
@@ -4212,7 +4212,7 @@
"viSourceDL": null, "viSourceDL": null,
"viTags": [ "viTags": [
"X\u001d^Y󶹬", "X\u001d^Y󶹬",
"base-2.3.5" "base-3.5.1"
], ],
"viTestDL": null "viTestDL": null
}, },
@@ -4497,10 +4497,10 @@
"viTags": [ "viTags": [
"old", "old",
"Latest", "Latest",
"base-5.6.4", "oj&,m",
"\u0019\u0007", "\u0019\u0007",
"Recommended", "Recommended",
"Latest" "LatestPrerelease"
], ],
"viTestDL": null "viTestDL": null
} }
@@ -4718,12 +4718,12 @@
"dlUri": "http:k" "dlUri": "http:k"
}, },
"viTags": [ "viTags": [
"base-5.3.4", "old",
"Recommended", "Recommended",
"Recommended", "Recommended",
"base-4.3.5", "base-3.5.1",
"Latest", "LatestPrerelease",
"󲨆Rs;h~" "base-3.3.3"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": -3, "dlCSize": -3,
@@ -4928,12 +4928,12 @@
"viPreCompile": null, "viPreCompile": null,
"viSourceDL": null, "viSourceDL": null,
"viTags": [ "viTags": [
"base-1.5.5", "LatestPrerelease",
"Latest", "Latest",
"Latest", "Latest",
"old", "old",
"Latest", "Latest",
"base-3.6.4", "LatestPrerelease",
"old" "old"
], ],
"viTestDL": { "viTestDL": {
@@ -5027,12 +5027,12 @@
}, },
"viTags": [ "viTags": [
"Latest", "Latest",
"base-3.6.5", "old",
"base-3.4.1", "base-1.6.1",
"𬰗𗛞Q#", "𬰗𗛞Q#",
"", "",
"Prerelease", "Prerelease",
"base-5.1.4" "base-6.6.2"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": 6, "dlCSize": 6,
@@ -5368,12 +5368,12 @@
"dlUri": "http:rjevxi" "dlUri": "http:rjevxi"
}, },
"viTags": [ "viTags": [
"base-1.6.1", "󿿁U:3\u000fd",
"S󶱩󳷐I🢐", "S󶱩󳷐I🢐",
"old", "old",
"󼗛𤔄\u001a~F", "󼗛𤔄\u001a~F",
"Latest", "Latest",
"base-4.5.4" "LatestPrerelease"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": null, "dlCSize": null,
@@ -5697,10 +5697,10 @@
"dlUri": "http:viiv" "dlUri": "http:viiv"
}, },
"viTags": [ "viTags": [
"base-3.1.6", "base-1.5.6",
"Prerelease", "Prerelease",
"Recommended", "Recommended",
")\u0005\u0015" "base-1.3.2"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": 5, "dlCSize": 5,
@@ -7482,7 +7482,7 @@
"Recommended", "Recommended",
"old", "old",
"old", "old",
"Latest" "(>"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": null, "dlCSize": null,
@@ -8175,11 +8175,11 @@
"dlUri": "http:ndqpk" "dlUri": "http:ndqpk"
}, },
"viTags": [ "viTags": [
"\"􁫳5\u0006F", "base-2.1.6",
"Recommended", "Recommended",
"Prerelease", "Prerelease",
"LatestPrerelease",
"old", "old",
"base-3.3.1",
"Recommended" "Recommended"
], ],
"viTestDL": null "viTestDL": null
@@ -8199,10 +8199,10 @@
"dlUri": "https:gqhlp" "dlUri": "https:gqhlp"
}, },
"viTags": [ "viTags": [
"base-4.3.4",
"Recommended",
"old", "old",
"base-4.1.4" "Recommended",
"LatestPrerelease",
"base-6.5.6"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": null, "dlCSize": null,
@@ -8400,7 +8400,7 @@
"\u0001", "\u0001",
"Prerelease", "Prerelease",
"Prerelease", "Prerelease",
"base-3.6.3", "1Aⳃ",
"Latest" "Latest"
], ],
"viTestDL": { "viTestDL": {
@@ -8427,13 +8427,13 @@
"dlUri": "http:pvmi" "dlUri": "http:pvmi"
}, },
"viTags": [ "viTags": [
"old", "LatestPrerelease",
"old", "LatestPrerelease",
"Latest", "LatestPrerelease",
"old", "old",
")", ")",
"Recommended", "Recommended",
"old" "LatestPrerelease"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": -2, "dlCSize": -2,
@@ -8941,9 +8941,9 @@
"dlUri": "http:oth" "dlUri": "http:oth"
}, },
"viTags": [ "viTags": [
"base-4.1.5", "􄖛\u001c\u001f",
"フ􍋦", "フ􍋦",
"base-1.4.5" "LatestPrerelease"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": -5, "dlCSize": -5,
@@ -10152,9 +10152,9 @@
"viPreCompile": "deajwn", "viPreCompile": "deajwn",
"viSourceDL": null, "viSourceDL": null,
"viTags": [ "viTags": [
"base-6.4.5", "base-1.4.3",
"base-5.1.1", "LatestPrerelease",
"base-4.4.6", "LatestPrerelease",
"Latest", "Latest",
"Latest", "Latest",
"Prerelease", "Prerelease",
@@ -10479,11 +10479,11 @@
"viPreCompile": "", "viPreCompile": "",
"viSourceDL": null, "viSourceDL": null,
"viTags": [ "viTags": [
"Prerelease", "󻦧s",
"Recommended", "Recommended",
"old", "old",
"N\u001b", "N\u001b",
"base-5.5.2", "LatestPrerelease",
"", "",
"Recommended" "Recommended"
], ],
@@ -10716,8 +10716,8 @@
"viSourceDL": null, "viSourceDL": null,
"viTags": [ "viTags": [
"Recommended", "Recommended",
"base-3.6.1", "base-4.3.2",
"base-4.3.3", "base-2.3.4",
"Recommended", "Recommended",
"Latest" "Latest"
], ],
@@ -11178,8 +11178,8 @@
"viTags": [ "viTags": [
"Prerelease", "Prerelease",
"Latest", "Latest",
"base-5.3.2", "5𨥶$𬰇",
"[3憥􋉞" "base-3.1.6"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": 1, "dlCSize": 1,
@@ -11698,7 +11698,7 @@
"viTags": [ "viTags": [
"𥭏}\u000e", "𥭏}\u000e",
"\u0007/", "\u0007/",
"base-6.5.3", "LatestPrerelease",
"Latest" "Latest"
], ],
"viTestDL": { "viTestDL": {
@@ -13992,7 +13992,7 @@
}, },
"viTags": [ "viTags": [
"Prerelease", "Prerelease",
"base-4.6.2", "base-7.5.2",
"3g7", "3g7",
"Recommended" "Recommended"
], ],
@@ -14463,10 +14463,10 @@
}, },
"viTags": [ "viTags": [
"Recommended", "Recommended",
"base-3.4.3", "LatestPrerelease",
"base-4.3.5", "base-1.2.2",
"Latest", "Latest",
"base-5.4.2" "LatestPrerelease"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": null, "dlCSize": null,
@@ -14650,8 +14650,8 @@
}, },
"viTags": [ "viTags": [
"Latest", "Latest",
"", "base-5.6.2",
"base-3.5.6" "old"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": -1, "dlCSize": -1,
@@ -14735,11 +14735,11 @@
"dlUri": "http:koxgqu" "dlUri": "http:koxgqu"
}, },
"viTags": [ "viTags": [
"base-6.3.3", "base-4.4.6",
"base-2.4.2", "B\u0004",
"Latest", "old",
"base-3.1.6", "LatestPrerelease",
"", "base-4.5.5",
"Latest" "Latest"
], ],
"viTestDL": { "viTestDL": {
@@ -15054,12 +15054,12 @@
"dlUri": "http:s" "dlUri": "http:s"
}, },
"viTags": [ "viTags": [
"Latest", "9􀦐or𰉒",
"base-5.1.1", "old",
"𫠼", "base-2.4.4",
"Recommended", "Recommended",
"OHk(\u0007󹌞", "OHk(\u0007󹌞",
"old" "LatestPrerelease"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": 1, "dlCSize": 1,
@@ -15251,10 +15251,10 @@
"viTags": [ "viTags": [
"Latest", "Latest",
"Latest", "Latest",
"Latest", "old",
"𮧬", "𮧬",
"old", "old",
"old", "LatestPrerelease",
"" ""
], ],
"viTestDL": { "viTestDL": {
@@ -15615,11 +15615,11 @@
"dlUri": "https:oat" "dlUri": "https:oat"
}, },
"viTags": [ "viTags": [
"base-6.6.4", "",
"Recommended", "old",
"Recommended", "Recommended",
"old", "old",
"Prerelease" "base-6.3.4"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": null, "dlCSize": null,
@@ -15904,13 +15904,13 @@
"dlUri": "https:rwxmrn" "dlUri": "https:rwxmrn"
}, },
"viTags": [ "viTags": [
"base-7.2.1",
"Prerelease",
"X",
"Latest",
"z 7\u0008N\u000e",
"old", "old",
"󱕠\u0006g" "Prerelease",
"base-2.5.3",
"Latest",
"base-5.3.3",
"old",
"base-7.2.1"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": 5, "dlCSize": 5,