From 80ed5ca4e66d28a9e5e510a12e4d59e29ddc8df2 Mon Sep 17 00:00:00 2001 From: Hamish Mackenzie Date: Tue, 17 Oct 2023 17:24:48 +1300 Subject: [PATCH] Use short names --- .github/workflows/build-and-test.yml | 2 +- .github/workflows/hello.yml | 12 +++++----- .github/workflows/main.yml | 12 +++++----- .github/workflows/wait-and-upload.yml | 6 ++--- README.md | 32 +++++++++++++-------------- docs/direnv.md | 4 ++-- flake.nix | 20 ++++++++--------- 7 files changed, 44 insertions(+), 44 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index a9bc25b4..70d35a97 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -13,7 +13,7 @@ on: type: string compiler-nix-name: required: true - description: 'compiler name in nix format. e.g. ghc8107' + description: 'compiler name in nix format. e.g. ghc96' type: string minimal: description: 'without hls, hlint, ...' diff --git a/.github/workflows/hello.yml b/.github/workflows/hello.yml index d0c30480..59dc7e76 100644 --- a/.github/workflows/hello.yml +++ b/.github/workflows/hello.yml @@ -16,10 +16,10 @@ jobs: #- aarch64-darwin #- aarch64-linux compiler-nix-name: - - ghc8107 - - ghc928 - - ghc963 - - ghc981 + - ghc810 + - ghc92 + - ghc96 + - ghc98 target-platform: - "" - "-static" @@ -33,9 +33,9 @@ jobs: - true exclude: # Just cross compiling javascript with ghc 9.6 for now - - compiler-nix-name: ghc8107 + - compiler-nix-name: ghc810 target-platform: "-js" - - compiler-nix-name: ghc928 + - compiler-nix-name: ghc92 target-platform: "-js" # Static builds not working for darwin yet - platform: x86_64-darwin diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c07d68a9..865ef785 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -56,10 +56,10 @@ jobs: # Currently broken #- aarch64-linux compiler-nix-name: - - ghc8107 - - ghc928 - - ghc963 - - ghc981 + - ghc810 + - ghc92 + - ghc96 + - ghc98 - ghc99 target-platform: - "" @@ -74,9 +74,9 @@ jobs: - "-iog" exclude: # Just cross compiling javascript with ghc 9.6.2 for now - - compiler-nix-name: ghc8107 + - compiler-nix-name: ghc810 target-platform: "-js" - - compiler-nix-name: ghc928 + - compiler-nix-name: ghc92 target-platform: "-js" # Static builds not working for darwin yet - platform: x86_64-darwin diff --git a/.github/workflows/wait-and-upload.yml b/.github/workflows/wait-and-upload.yml index 3dc5c72e..24b3c1f8 100644 --- a/.github/workflows/wait-and-upload.yml +++ b/.github/workflows/wait-and-upload.yml @@ -13,7 +13,7 @@ on: type: string compiler-nix-name: required: true - description: 'compiler name in nix format. e.g. ghc8107' + description: 'compiler name in nix format. e.g. ghc96' type: string minimal: description: 'without hls, hlint, ...' @@ -112,8 +112,8 @@ jobs: # or the `-static` one (especially since the latter currently requires `-minimal` to work). # Likely, we consider using `-iog` as the default and do not generate other images. # Then the user choices left would be between native, `-windows` or `-js` target platforms, - # and the GHC version (currently `ghc8107` and `ghc962`). - if: ${{ contains(fromJSON('["x86_64-linux", "aarch64-linux"]'), inputs.platform) && contains(fromJson('["","-windows","-js"]'), inputs.target-platform) && contains(fromJson('["ghc8107","ghc962"]'), inputs.compiler-nix-name) && !inputs.minimal && inputs.iog }} + # and the GHC version (currently `ghc810` and `ghc96`). + if: ${{ contains(fromJSON('["x86_64-linux", "aarch64-linux"]'), inputs.platform) && contains(fromJson('["","-windows","-js"]'), inputs.target-platform) && contains(fromJson('["ghc810","ghc96"]'), inputs.compiler-nix-name) && !inputs.minimal && inputs.iog }} steps: - name: Checkout repository uses: actions/checkout@v3 diff --git a/README.md b/README.md index a6c9b32a..9a11113b 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Once you have `nix` installed you can check that everything is working correctly Once you have `nix`, (linux, macOS, windows WSL) you can use ```bash -nix develop github:input-output-hk/devx#ghc8107 --no-write-lock-file --refresh +nix develop github:input-output-hk/devx#ghc96 --no-write-lock-file --refresh ``` to obtain a haskell evelopment shell for GHC 8.10.7 including `cabal-install`, @@ -23,11 +23,11 @@ and want to switch between Intel (x86_64) and Apple Silicon (aarch64), you can d this by simply passing the corresponding `--system` argument: ```bash -nix develop github:input-output-hk/devx#ghc8107 --no-write-lock-file --refresh --system x86_64-darwin +nix develop github:input-output-hk/devx#ghc810 --no-write-lock-file --refresh --system x86_64-darwin ``` or ```bash -nix develop github:input-output-hk/devx#ghc8107 --no-write-lock-file --refresh --system aarch64-darwin +nix develop github:input-output-hk/devx#ghc810 --no-write-lock-file --refresh --system aarch64-darwin ``` ## `direnv` integration @@ -39,7 +39,7 @@ if ! has nix_direnv_version || ! nix_direnv_version 2.3.0; then source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.3.0/direnvrc" "sha256-Dmd+j63L84wuzgyjITIfSxSD57Tx7v51DMxVZOsiUD8=" fi # https://github.com/input-output-hk/devx Slightly opinionated shared GitHub Action for Cardano-Haskell projects -use flake "github:input-output-hk/devx#ghc8107-iog" +use flake "github:input-output-hk/devx#ghc810-iog" ``` Refer to [`direnv` and `devx`](./docs/direnv.md) guide for more information. @@ -49,7 +49,7 @@ Refer to [`direnv` and `devx`](./docs/direnv.md) guide for more information. To make this developer shell available in VSCode DevContainer or GitHub CodeSpace, simply add a file named `.devcontainer/devcontainer.json` with the following content: ```json { - "image":"ghcr.io/input-output-hk/devx-devcontainer:ghc8107-iog", + "image":"ghcr.io/input-output-hk/devx-devcontainer:ghc810-iog", "customizations":{ "vscode":{ "extensions":[ @@ -66,27 +66,27 @@ This configuration will work immediately in GitHub CodeSpace! For local VSCode D It's also advise to enable GitHub CodeSpace prebuilds in your repository settings, follow the instructions provided in the [GitHub documentation](https://docs.github.com/en/codespaces/prebuilding-your-codespaces/configuring-prebuilds). This will significantly enhance your development experience by reducing the setup time when opening a new CodeSpace. -List of images available: `ghc8107-iog`, `ghc962-iog`, `ghc8107-js-iog`, `ghc962-js-iog`, `ghc8107-windows-iog`, `ghc962-windows-iog` +List of images available: `ghc810-iog`, `ghc96-iog`, `ghc810-js-iog`, `ghc96-js-iog`, `ghc810-windows-iog`, `ghc96-windows-iog` ## Compilers and Flavours There are multiple compilers available, and usually the latest for each series from 8.10 to 9.6 (a slight delay between the official release announcement and the compiler showing up in the devx shell is expected due to integration work -necessary). The current available ones are: `ghc8107`, `ghc902`, `ghc928`,`ghc945`, and -`ghc962` (these are the same ones as in [haskell.nix](https://github.com/input-output-hk/haskell.nix) and may contain patches for defects in the official releases). +necessary). The current available ones are: `ghc810`, `ghc90`, `ghc92`,`ghc94`, and +`ghc96` (these are the same ones as in [haskell.nix](https://github.com/input-output-hk/haskell.nix) and may contain patches for defects in the official releases). ### Flavours -There are various flavours available as suffixes to the compiler names (e.g. `#ghc8107-minimal-iog`). +There are various flavours available as suffixes to the compiler names (e.g. `#ghc810-minimal-iog`). | Flavour | Description | Example | Included | | - | - | - | - | -| empty | General Haskell Dev | `#ghc8107` | `ghc`, `cabal-install`, `hls`, `hlint` | -| `-iog` | IOG Haskell Dev | `#ghc8107` | adds `sodium-vrf`, `blst`, `secp256k1`, `R`, `postgresql` | -| `-minimal` | Only GHC, and Cabal | `#ghc8107-minimal` | drops `hls`, `hlint` | -| `-static` | Building static binaries | `#ghc8107-static` | static haskell cross compiler | -| `-js` | JavaScript Cross Compiler | `#ghc8107-js` | javascript haskell cross compiler | -| `-windows` | Windows Cross Compiler | `#ghc8107-windows` | windows haskell cross compiler | +| empty | General Haskell Dev | `#ghc810` | `ghc`, `cabal-install`, `hls`, `hlint` | +| `-iog` | IOG Haskell Dev | `#ghc810` | adds `sodium-vrf`, `blst`, `secp256k1`, `R`, `postgresql` | +| `-minimal` | Only GHC, and Cabal | `#ghc810-minimal` | drops `hls`, `hlint` | +| `-static` | Building static binaries | `#ghc810-static` | static haskell cross compiler | +| `-js` | JavaScript Cross Compiler | `#ghc810-js` | javascript haskell cross compiler | +| `-windows` | Windows Cross Compiler | `#ghc810-windows` | windows haskell cross compiler | these can then be comined following this schema: ``` @@ -94,7 +94,7 @@ these can then be comined following this schema: ``` For example ```bash -nix develop github:input-output-hk/devx#ghc8107-windows-minimal-iog --no-write-lock-file --refresh +nix develop github:input-output-hk/devx#ghc810-windows-minimal-iog --no-write-lock-file --refresh ``` would provide a development shell with a windows cross compiler as well as cabal, and the IOG specific libraries, but no Haskell Language Server (hls), and no HLint. diff --git a/docs/direnv.md b/docs/direnv.md index ae28ef59..9d70e965 100644 --- a/docs/direnv.md +++ b/docs/direnv.md @@ -78,10 +78,10 @@ if ! has nix_direnv_version || ! nix_direnv_version 2.3.0; then source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.3.0/direnvrc" "sha256-Dmd+j63L84wuzgyjITIfSxSD57Tx7v51DMxVZOsiUD8=" fi # https://github.com/input-output-hk/devx Slightly opinionated shared GitHub Action for Cardano-Haskell projects -use flake "github:input-output-hk/devx#ghc8107-iog" +use flake "github:input-output-hk/devx#ghc96-iog" ``` -This will tell `direnv` to instantiate a shell with the same environment as `nix develop github:input-output-hk/devx#ghc8107-iog`, when changing into the folder where the `.envrc` resides. +This will tell `direnv` to instantiate a shell with the same environment as `nix develop github:input-output-hk/devx#ghc96-iog`, when changing into the folder where the `.envrc` resides. You can also pin the flake to a specific version. This is a good practice to ensure reproducibility across different machines and systems. Refer to the Nix Flakes documentation on how to do this. Then, allow Direnv to take effect: diff --git a/flake.nix b/flake.nix index d19458cd..5bc55043 100644 --- a/flake.nix +++ b/flake.nix @@ -59,7 +59,7 @@ # # Usage: # - # nix develop github:input-output-hk/devx#ghc924 --no-write-lock-file -c cabal build + # nix develop github:input-output-hk/devx#ghc96 --no-write-lock-file -c cabal build # static-pkgs = if pkgs.stdenv.hostPlatform.isLinux then if pkgs.stdenv.hostPlatform.isAarch64 @@ -72,12 +72,12 @@ # Map the compiler-nix-name to a final compiler-nix-name the way haskell.nix # projects do (that way we can use short names) let compilers = pkgs: pkgs.lib.genAttrs [ - "ghc8107" - "ghc902" - "ghc928" - "ghc947" - "ghc963" - "ghc981" + "ghc810" + "ghc90" + "ghc92" + "ghc94" + "ghc96" + "ghc98" "ghc99"] (short-name: rec { inherit pkgs self toolsModule; compiler-nix-name = pkgs.haskell-nix.resolve-compiler-name short-name; @@ -85,9 +85,9 @@ }); js-compilers = pkgs: builtins.removeAttrs (compilers pkgs) [ - "ghc902" - "ghc928" - "ghc947" + "ghc90" + "ghc92" + "ghc94" ]; windows-compilers = pkgs: pkgs.lib.optionalAttrs (__elem system ["x86_64-linux"])