diff --git a/.azure/linux-stack.bashrc b/.azure/linux-stack.bashrc deleted file mode 100644 index 61f790fa8..000000000 --- a/.azure/linux-stack.bashrc +++ /dev/null @@ -1 +0,0 @@ -export PATH=$HOME/.local/bin:$PATH diff --git a/.azure/linux-stack.yml b/.azure/linux-stack.yml deleted file mode 100644 index aad4722ef..000000000 --- a/.azure/linux-stack.yml +++ /dev/null @@ -1,76 +0,0 @@ -jobs: -- job: Linux_Stack - timeoutInMinutes: 0 - pool: - vmImage: ubuntu-16.04 - strategy: - matrix: - stack-8.8.2: - YAML_FILE: stack-8.8.2.yaml - stack-8.8.1: - YAML_FILE: stack-8.8.1.yaml - stack-8.6.5: - YAML_FILE: stack-8.6.5.yaml - stack-8.6.4: - YAML_FILE: stack-8.6.4.yaml - stack-8.4.4: - YAML_FILE: stack-8.4.4.yaml - stack-8.4.3: - YAML_FILE: stack-8.4.3.yaml - stack-8.4.2: - YAML_FILE: stack-8.4.2.yaml - stack-8.2.2: - YAML_FILE: stack-8.2.2.yaml - variables: - STACK_ROOT: /home/vsts/.stack - steps: - - task: Cache@2 - inputs: - key: '"stack" | "$(Agent.OS)" | $(Build.SourcesDirectory)/$(YAML_FILE)' - path: .azure-cache - cacheHitVar: CACHE_RESTORED - displayName: "Download cache" - - bash: | - mkdir -p $STACK_ROOT - tar -vxzf .azure-cache/stack-root.tar.gz -C / - mkdir -p .stack-work - tar -vxzf .azure-cache/stack-work.tar.gz - displayName: "Unpack cache" - condition: eq(variables.CACHE_RESTORED, 'true') - - bash: | - git submodule sync - git submodule update --init - - bash: | - mkdir -p ~/.local/bin - curl -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz | \ - tar vxz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' - displayName: Install stack - - bash: | - source .azure/linux-stack.bashrc - stack setup --stack-yaml $(YAML_FILE) - displayName: Install GHC - - bash: | - source .azure/linux-stack.bashrc - stack --stack-yaml $(YAML_FILE) --install-ghc build --only-dependencies - displayName: Build dependencies - - bash: | - source .azure/linux-stack.bashrc - stack build --stack-yaml $(YAML_FILE) - displayName: Build `haskell-lsp` - - bash: | - source .azure/linux-stack.bashrc - stack build --stack-yaml $(YAML_FILE) --flag haskell-lsp:demo - displayName: Build language server example - - bash: | - source .azure/linux-stack.bashrc - stack build --stack-yaml $(YAML_FILE) --test --bench --only-dependencies - displayName: Build Test-dependencies - - bash: | - source .azure/linux-stack.bashrc - stack test --stack-yaml $(YAML_FILE) --dump-logs - displayName: "Run Tests" - - bash: | - mkdir -p .azure-cache - tar -vczf .azure-cache/stack-root.tar.gz $STACK_ROOT - tar -vczf .azure-cache/stack-work.tar.gz .stack-work - displayName: "Pack cache" diff --git a/.azure/macos-stack.bashrc b/.azure/macos-stack.bashrc deleted file mode 100644 index 61f790fa8..000000000 --- a/.azure/macos-stack.bashrc +++ /dev/null @@ -1 +0,0 @@ -export PATH=$HOME/.local/bin:$PATH diff --git a/.azure/macos-stack.yml b/.azure/macos-stack.yml deleted file mode 100644 index 22a66c466..000000000 --- a/.azure/macos-stack.yml +++ /dev/null @@ -1,77 +0,0 @@ -jobs: -- job: MacOs_Stack - timeoutInMinutes: 0 - pool: - vmImage: macOS-10.14 - strategy: - matrix: - stack-8.8.2: - YAML_FILE: stack-8.8.2.yaml - stack-8.8.1: - YAML_FILE: stack-8.8.1.yaml - stack-8.6.5: - YAML_FILE: stack-8.6.5.yaml - stack-8.6.4: - YAML_FILE: stack-8.6.4.yaml - stack-8.4.4: - YAML_FILE: stack-8.4.4.yaml - stack-8.4.3: - YAML_FILE: stack-8.4.3.yaml - stack-8.4.2: - YAML_FILE: stack-8.4.2.yaml - stack-8.2.2: - YAML_FILE: stack-8.2.2.yaml - variables: - STACK_ROOT: $(Build.SourcesDirectory)/.stack - steps: - - task: Cache@2 - inputs: - key: '"stack" | "$(Agent.OS)" | $(Build.SourcesDirectory)/$(YAML_FILE)' - path: .azure-cache - cacheHitVar: CACHE_RESTORED - displayName: "Download cache" - - bash: | - mkdir -p $STACK_ROOT - tar -vxzf .azure-cache/stack-root.tar.gz -C / - mkdir -p .stack-work - tar -vxzf .azure-cache/stack-work.tar.gz - displayName: "Unpack cache" - condition: eq(variables.CACHE_RESTORED, 'true') - - bash: | - git submodule sync - git submodule update --init - displayName: Sync submodules - - bash: | - mkdir -p ~/.local/bin - curl -skL https://get.haskellstack.org/stable/osx-x86_64.tar.gz | \ - tar vxz --strip-components=1 --include '*/stack' -C ~/.local/bin; - displayName: Install stack - - bash: | - source .azure/macos-stack.bashrc - stack setup --stack-yaml $(YAML_FILE) - displayName: Install GHC - - bash: | - source .azure/macos-stack.bashrc - stack --stack-yaml $(YAML_FILE) --install-ghc build --only-dependencies - displayName: Build dependencies - - bash: | - source .azure/macos-stack.bashrc - stack build --stack-yaml $(YAML_FILE) - displayName: Build `haskell-lsp` - - bash: | - source .azure/macos-stack.bashrc - stack build --stack-yaml $(YAML_FILE) --flag haskell-lsp:demo - displayName: Build language server example - - bash: | - source .azure/macos-stack.bashrc - stack build --stack-yaml $(YAML_FILE) --test --bench --only-dependencies - displayName: Build Test-dependencies - - bash: | - source .azure/macos-stack.bashrc - stack test --stack-yaml $(YAML_FILE) --dump-logs - displayName: "Run Tests" - - bash: | - mkdir -p .azure-cache - tar -vczf .azure-cache/stack-root.tar.gz $STACK_ROOT - tar -vczf .azure-cache/stack-work.tar.gz .stack-work - displayName: "Pack cache" diff --git a/.azure/windows-stack.bashrc b/.azure/windows-stack.bashrc deleted file mode 100644 index f29288d14..000000000 --- a/.azure/windows-stack.bashrc +++ /dev/null @@ -1,2 +0,0 @@ -export LOCAL_BIN_PATH=$(cygpath $APPDATA\\local\\bin) -export PATH=$LOCAL_BIN_PATH:$PATH diff --git a/.azure/windows-stack.yml b/.azure/windows-stack.yml deleted file mode 100644 index 028182974..000000000 --- a/.azure/windows-stack.yml +++ /dev/null @@ -1,78 +0,0 @@ -jobs: -- job: Windows_Stack - timeoutInMinutes: 0 - pool: - vmImage: windows-2019 - strategy: - matrix: - stack-8.8.2: - YAML_FILE: stack-8.8.2.yaml - stack-8.8.1: - YAML_FILE: stack-8.8.1.yaml - stack-8.6.5: - YAML_FILE: stack-8.6.5.yaml - stack-8.6.4: - YAML_FILE: stack-8.6.4.yaml - stack-8.4.4: - YAML_FILE: stack-8.4.4.yaml - stack-8.4.3: - YAML_FILE: stack-8.4.3.yaml - stack-8.4.2: - YAML_FILE: stack-8.4.2.yaml - stack-8.2.2: - YAML_FILE: stack-8.2.2.yaml - variables: - STACK_ROOT: "C:\\sr" - - steps: - - task: Cache@2 - inputs: - key: '"stack" | "$(Agent.OS)" | $(Build.SourcesDirectory)/$(YAML_FILE)' - path: .azure-cache - cacheHitVar: CACHE_RESTORED - displayName: "Cache stack-root" - - bash: | - mkdir -p $STACK_ROOT - tar -vxzf .azure-cache/stack-root.tar.gz -C /c - mkdir -p .stack-work - tar -vxzf .azure-cache/stack-work.tar.gz - displayName: "Unpack cache" - condition: eq(variables.CACHE_RESTORED, 'true') - - bash: | - git submodule sync - git submodule update --init - displayName: Sync submodules - - bash: | - curl -sSkL http://www.stackage.org/stack/windows-x86_64 -o /usr/bin/stack.zip - unzip -o /usr/bin/stack.zip -d /usr/bin/ - mkdir -p "$STACK_ROOT" - displayName: Install stack - - bash: | - source .azure/windows-stack.bashrc - stack setup --stack-yaml $(YAML_FILE) - displayName: Install GHC - - bash: | - source .azure/windows-stack.bashrc - stack build --stack-yaml $(YAML_FILE) --only-dependencies - displayName: Build dependencies - - bash: | - source .azure/windows-stack.bashrc - stack build --stack-yaml $(YAML_FILE) - displayName: Build `haskell-lsp` - - bash: | - source .azure/windows-stack.bashrc - stack build --stack-yaml $(YAML_FILE) --flag haskell-lsp:demo - displayName: Build language server example - - bash: | - source .azure/windows-stack.bashrc - stack build --stack-yaml $(YAML_FILE) --test --bench --only-dependencies - displayName: Build Test-dependencies - - bash: | - source .azure/windows-stack.bashrc - stack test --stack-yaml $(YAML_FILE) --dump-logs - displayName: "Run Tests" - - bash: | - mkdir -p .azure-cache - tar -vczf .azure-cache/stack-root.tar.gz $(cygpath $STACK_ROOT) - tar -vczf .azure-cache/stack-work.tar.gz .stack-work - displayName: "Pack cache" diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index b1d945b4f..2357515fa 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -1,6 +1,11 @@ name: Haskell CI -on: [push, pull_request] +on: + push: + branches: + - master + pull_request: + jobs: build: @@ -9,27 +14,20 @@ jobs: strategy: fail-fast: false matrix: - ghc: ['9.2.4', '9.0.2', '8.10.7', '8.8.4', '8.6.5'] - os: [ubuntu-latest, macOS-latest, windows-latest] - ospath: [true, false] - exclude: - # newer 'entropy' doesn't work with old 'unix', and it doesn't have a correct version bound. - - ospath: true - ghc: 8.6.5 - # "cabal build" always timeout - - ospath: true - ghc: 8.8.4 - os: windows-latest + ghc: ['9.4.3', '9.2.5', '9.0.2', '8.10.7'] + # Unlikely that we'll succeed on windows and fail on macos, + # including it is just burning CI time. But windows could have + # path or IO issues, so worth including + os: [ubuntu-latest, windows-latest] steps: - - uses: actions/checkout@v2 - - uses: haskell/actions/setup@v1 + - uses: actions/checkout@v3 + - uses: haskell/actions/setup@v2 with: ghc-version: ${{ matrix.ghc }} - cabal-version: '3.6' - name: Cabal cache - uses: actions/cache@v1 + uses: actions/cache@v3 env: cache-name: cache-cabal with: @@ -38,32 +36,12 @@ jobs: restore-keys: | ${{ runner.os }}-build-${{ env.cache-name }}- - - name: Stack cache - uses: actions/cache@v1 - env: - cache-name: cache-stack - with: - path: ~/.stack - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/stack.yaml') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - - name: Cabal update run: cabal update - - name: Cabal configure - shell: bash - run: | - if [ ${{ matrix.ospath }} = "true" ]; then - cabal configure --flags="force-ospath" - fi - name: Build using cabal run: cabal build all - name: Test run: cabal test all - # stack build uses stack.yaml which actually uses ghc-8.10.7 - - if: matrix.ghc == '8.10.7' && runner.os == 'Linux' - name: Build using stack - run: stack build haskell_post_job: runs-on: ubuntu-latest diff --git a/.github/workflows/nix.yaml b/.github/workflows/nix.yaml index 94a394e42..1e10e5b5f 100644 --- a/.github/workflows/nix.yaml +++ b/.github/workflows/nix.yaml @@ -1,6 +1,10 @@ name: Nix -on: [push, pull_request] +on: + push: + branches: + - master + pull_request: jobs: nix: @@ -12,10 +16,10 @@ jobs: os: [ubuntu-latest, macOS-latest] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: true - - uses: cachix/install-nix-action@v16 + - uses: cachix/install-nix-action@v18 with: nix_path: nixpkgs=channel:nixos-unstable - run: nix-shell --run "cabal update && cabal build all" diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 6ab491a34..000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,31 +0,0 @@ -# Build master, branches starting with `azure` and tags commits -trigger: - branches: - include: - - master - - azure* - tags: - include: - - '*' - paths: - exclude: - - .circleci - - LICENSE - - '*.md' - -# Enable PR triggers that target the master branch -pr: - autoCancel: true # cancel previous builds on push - branches: - include: - - master - paths: - exclude: - - .circleci - - LICENSE - - '*.md' - -jobs: -- template: ./.azure/linux-stack.yml -- template: ./.azure/windows-stack.yml -- template: ./.azure/macos-stack.yml diff --git a/cabal.project b/cabal.project index 37b5d32fa..4ffb13028 100644 --- a/cabal.project +++ b/cabal.project @@ -6,7 +6,7 @@ packages: package lsp flags: +demo -index-state: 2022-08-25T22:25:05Z +index-state: 2023-01-01T00:00:00Z tests: True benchmarks: True diff --git a/nix/sources.json b/nix/sources.json index 55059fb80..50e880372 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -5,10 +5,10 @@ "homepage": "", "owner": "hercules-ci", "repo": "gitignore.nix", - "rev": "5b9e0ff9d3b551234b4f3eb3983744fa354b17f1", - "sha256": "01l4phiqgw9xgaxr6jr456qmww6kzghqrnbc7aiiww3h6db5vw53", + "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "sha256": "07vg2i9va38zbld9abs9lzqblz193vc5wvqd6h7amkmwf66ljcgh", "type": "tarball", - "url": "https://github.com/hercules-ci/gitignore.nix/archive/5b9e0ff9d3b551234b4f3eb3983744fa354b17f1.tar.gz", + "url": "https://github.com/hercules-ci/gitignore.nix/archive/a20de23b925fd8264fd7fad6454652e142fd7f73.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "niv": { @@ -17,10 +17,10 @@ "homepage": "https://github.com/nmattia/niv", "owner": "nmattia", "repo": "niv", - "rev": "5830a4dd348d77e39a0f3c4c762ff2663b602d4c", - "sha256": "1d3lsrqvci4qz2hwjrcnd8h5vfkg8aypq3sjd4g3izbc8frwz5sm", + "rev": "689d0e5539eddd0b0f566aee7bb18629eee7df74", + "sha256": "1rld3lk42l6b01f2gcrhq8qm9vry1awmfl29zmpiqda9dy89vbx0", "type": "tarball", - "url": "https://github.com/nmattia/niv/archive/5830a4dd348d77e39a0f3c4c762ff2663b602d4c.tar.gz", + "url": "https://github.com/nmattia/niv/archive/689d0e5539eddd0b0f566aee7bb18629eee7df74.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "nixpkgs": { @@ -29,10 +29,10 @@ "homepage": "", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5efc8ca954272c4376ac929f4c5ffefcc20551d5", - "sha256": "15xncc1afq8v78acrcv8xbfkd3ii147mv9a55823pdbqffzg0x54", + "rev": "293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847", + "sha256": "1m6smzjz3agkyc6dm83ffd8zr744m6jpjmffppvcdngk82mf3s3r", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/5efc8ca954272c4376ac929f4c5ffefcc20551d5.tar.gz", + "url": "https://github.com/NixOS/nixpkgs/archive/293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.tar.gz", "url_template": "https://github.com///archive/.tar.gz" } } diff --git a/nix/sources.nix b/nix/sources.nix index 1938409dd..9a01c8acf 100644 --- a/nix/sources.nix +++ b/nix/sources.nix @@ -31,8 +31,28 @@ let if spec ? branch then "refs/heads/${spec.branch}" else if spec ? tag then "refs/tags/${spec.tag}" else abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!"; + submodules = if spec ? submodules then spec.submodules else false; + submoduleArg = + let + nixSupportsSubmodules = builtins.compareVersions builtins.nixVersion "2.4" >= 0; + emptyArgWithWarning = + if submodules == true + then + builtins.trace + ( + "The niv input \"${name}\" uses submodules " + + "but your nix's (${builtins.nixVersion}) builtins.fetchGit " + + "does not support them" + ) + {} + else {}; + in + if nixSupportsSubmodules + then { inherit submodules; } + else emptyArgWithWarning; in - builtins.fetchGit { url = spec.repo; inherit (spec) rev; inherit ref; }; + builtins.fetchGit + ({ url = spec.repo; inherit (spec) rev; inherit ref; } // submoduleArg); fetch_local = spec: spec.path; diff --git a/stack.yaml b/stack.yaml deleted file mode 100644 index 2ca1055ee..000000000 --- a/stack.yaml +++ /dev/null @@ -1,14 +0,0 @@ -resolver: lts-18.18 # GHC 8.10.7 - -packages: -- ./lsp -- ./lsp-types -- ./lsp-test - -flags: {} -extra-package-dbs: [] -nix: - packages: [icu] -extra-deps: -- text-rope-0.1 -- co-log-core-0.3.1.0