Skip to content

Fix ghcup-gen build with 0.1.40.0 #280

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

Merged
merged 3 commits into from
Jan 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
60 changes: 31 additions & 29 deletions .github/workflows/bindists.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -219,52 +219,54 @@ jobs:

validate:
name: ghcup-gen check
runs-on: ubuntu-latest
runs-on: [self-hosted, Linux, X64]
env:
GHC: 9.2.8
CABAL: 3.10.1.0
YAML_VER: 0.0.9
GHC_VER: 9.8.4
CABAL_VER: 3.12.1.0
CACHE_BUST: 1
container:
image: rockylinux:9
steps:
- name: create ~/.local/bin
run: mkdir -p "$HOME/.local/bin"
shell: bash
- name: Checkout code
uses: actions/checkout@v4

- name: Add ~/.local/bin to PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
shell: bash

- name: install yamllint
run: pip install yamllint

- name: Update cabal cache
run: cabal update
shell: bash
- name: Disable cabal XDG
run: |
echo "CABAL_DIR=${GITHUB_WORKSPACE}/.cabal" >> "$GITHUB_ENV"

- name: Install requirements
shell: sh
- name: Prerequisites
run: |
export DEBIAN_FRONTEND=noninteractive
export TZ=Asia/Singapore
sudo apt-get update && sudo apt-get install -y curl bash git gnupg libarchive-dev
dnf install -y --allowerasing which findutils gcc gcc-c++ gmp gmp-devel make ncurses xz perl curl bash git nodejs zstd pkg-config pip libarchive-devel zlib-devel
mkdir -p "$HOME/.local/bin"
echo "$HOME/.local/bin" >> $GITHUB_PATH
pip install yamllint
shell: bash

- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- uses: haskell/ghcup-setup@v1
with:
ghc: ${{ env.GHC_VER }}
cabal: ${{ env.CABAL_VER }}

- name: Cache Cabal
uses: actions/cache@v2
uses: actions/cache@v4
env:
cache-name: cache-cabal
with:
path: |
~/.cabal/store
~/.cabal/packages
key: v2-${{ runner.os }}-${{ env.GHC }}-${{ env.CABAL }}-build-${{ hashFiles('cabal.project') }}
.cabal/store
.cabal/packages
key: v${{ env.CACHE_BUST }}-${{ runner.os }}-${{ env.GHC_VER }}-${{ env.CABAL_VER }}-build-${{ hashFiles('cabal.project') }}
restore-keys: |
v2-${{ runner.os }}-${{ env.GHC }}-${{ env.CABAL }}-build-${{ hashFiles('cabal.project') }}
v2-${{ runner.os }}-${{ env.GHC }}-${{ env.CABAL }}-build-
v2-${{ runner.os }}-${{ env.GHC }}
v${{ env.CACHE_BUST }}-${{ runner.os }}-${{ env.GHC_VER }}-${{ env.CABAL_VER }}-build-${{ hashFiles('cabal.project') }}
v${{ env.CACHE_BUST }}-${{ runner.os }}-${{ env.GHC_VER }}-${{ env.CABAL_VER }}-build-
v${{ env.CACHE_BUST }}-${{ runner.os }}-${{ env.GHC_VER }}

- name: Install ghcup-gen
run: |
ghcup run --cabal 3.10.1.0 --ghc 9.2.8 --install -- cabal install --installdir="$HOME/.local/bin" --overwrite-policy=always --install-method=copy ghcup-gen
cabal update
cabal install --installdir="$HOME/.local/bin" --overwrite-policy=always --install-method=copy ghcup-gen
shell: bash

- name: Check yaml
Expand Down
73 changes: 31 additions & 42 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,64 +9,53 @@ on:
jobs:
test:
name: Test metadata
runs-on: ${{ matrix.os }}
runs-on: [self-hosted, Linux, X64]
env:
YAML_VER: 0.0.9
strategy:
matrix:
ghc:
- '9.8.4'
cabal:
- '3.12.1.0'
os:
- ubuntu-22.04
GHC_VER: 9.8.4
CABAL_VER: 3.12.1.0
CACHE_BUST: 1
container:
image: rockylinux:9
steps:
- name: Checkout code
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2
uses: actions/checkout@v4

- uses: haskell-actions/setup@ec49483bfc012387b227434aba94f59a6ecd0900 # v2.7.5
- name: Disable cabal XDG
run: |
echo "CABAL_DIR=${GITHUB_WORKSPACE}/.cabal" >> "$GITHUB_ENV"

- name: Prerequisites
run: |
export TZ=Asia/Singapore
dnf install -y --allowerasing which findutils gcc gcc-c++ gmp gmp-devel make ncurses xz perl curl bash git nodejs zstd pkg-config pip libarchive-devel zlib-devel
mkdir -p "$HOME/.local/bin"
echo "$HOME/.local/bin" >> $GITHUB_PATH
pip install yamllint
shell: bash

- uses: haskell/ghcup-setup@v1
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
ghc: ${{ env.GHC_VER }}
cabal: ${{ env.CABAL_VER }}

- name: Cache Cabal
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed # v2.1.7
uses: actions/cache@v4
env:
cache-name: cache-cabal
with:
path: |
~/.cabal/store
~/.cabal/packages
key: v2-${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-build-${{ hashFiles('cabal.project') }}
.cabal/store
.cabal/packages
key: v${{ env.CACHE_BUST }}-${{ runner.os }}-${{ env.GHC_VER }}-${{ env.CABAL_VER }}-build-${{ hashFiles('cabal.project') }}
restore-keys: |
v2-${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-build-${{ hashFiles('cabal.project') }}
v2-${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-build-
v2-${{ runner.os }}-${{ matrix.ghc }}

- name: create ~/.local/bin
run: mkdir -p "$HOME/.local/bin"
shell: bash

- name: Add ~/.local/bin to PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
shell: bash

- name: install yamllint
run: pip install yamllint

- name: Update cabal cache
run: cabal update
shell: bash

- name: Install some deps
run: |
export DEBIAN_FRONTEND=noninteractive
export TZ=Asia/Singapore
sudo apt install -y libarchive-dev
shell: bash
v${{ env.CACHE_BUST }}-${{ runner.os }}-${{ env.GHC_VER }}-${{ env.CABAL_VER }}-build-${{ hashFiles('cabal.project') }}
v${{ env.CACHE_BUST }}-${{ runner.os }}-${{ env.GHC_VER }}-${{ env.CABAL_VER }}-build-
v${{ env.CACHE_BUST }}-${{ runner.os }}-${{ env.GHC_VER }}

- name: Install ghcup-gen
run: |
cabal update
cabal install --installdir="$HOME/.local/bin" --overwrite-policy=always --install-method=copy ghcup-gen
shell: bash

Expand Down
4 changes: 2 additions & 2 deletions ghcup-gen/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ main = do
, fancyColors = not no_color
}
dirs <- liftIO getAllDirs
let leanAppstate = LeanAppState (Settings True 0 Lax False Never Curl True GHCupURL False GPGNone True Nothing (DM mempty) [] defaultPagerConfig) dirs defaultKeyBindings loggerConfig
let leanAppstate = LeanAppState (Settings True 0 Lax False Never Curl True [NewGHCupURL] False GPGNone True Nothing (DM mempty) [] defaultPagerConfig) dirs defaultKeyBindings loggerConfig

pfreq <- (
flip runReaderT leanAppstate . runE @'[NoCompatiblePlatform, NoCompatibleArch, DistroNotFound] $ platformRequest
Expand All @@ -204,7 +204,7 @@ main = do
flip runReaderT leanAppstate $ logError $ T.pack $ prettyShow e
liftIO $ exitWith (ExitFailure 2)

let appstate = AppState (Settings True 0 Lax False Never Curl True GHCupURL False GPGNone True Nothing (DM mempty) [] defaultPagerConfig) dirs defaultKeyBindings (GHCupInfo mempty mempty Nothing) pfreq loggerConfig
let appstate = AppState (Settings True 0 Lax False Never Curl True [NewGHCupURL] False GPGNone True Nothing (DM mempty) [] defaultPagerConfig) dirs defaultKeyBindings (GHCupInfo mempty mempty Nothing) pfreq loggerConfig

let withValidateYamlOpts vopts f = case vopts of
ValidateYAMLOpts { vInput = Nothing } ->
Expand Down
10 changes: 5 additions & 5 deletions ghcup-gen/ghcup-gen.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ executable ghcup-gen
build-depends:
, aeson-pretty ^>=0.8.9
, base >=4.13 && <5
, bytestring ^>=0.11
, bytestring ^>=0.11 || ^>=0.12
, containers ^>=0.6
, deepseq ^>=1.4
, deepseq ^>=1.4 || ^>=1.5
, filepath >=1.4.101.0
, ghcup ^>=0.1.19.0
, ghcup >=0.1.40.0
, variant ^>=1.0
, libarchive ^>=3.0.3.0
, megaparsec >=8.0.0 && <9.3
, megaparsec >=8.0.0 && <9.8
, mtl ^>=2.2 || ^>=2.3
, optics ^>=0.4
, optparse-applicative >=0.15.1.0 && <0.18
Expand All @@ -63,7 +63,7 @@ executable ghcup-gen
, regex-posix ^>=0.96
, resourcet ^>=1.2.2 || ^>=1.3
, safe-exceptions ^>=0.1
, text ^>=2.0
, text ^>=2.0 || ^>=2.1
, transformers ^>=0.5 || ^>=0.6
, versions >=6.0.5 && <6.1
, yaml ^>=0.11.11.2
Loading