Skip to content

Commit

Permalink
Merge branch 'master' into spdx-handle-number
Browse files Browse the repository at this point in the history
  • Loading branch information
ffaf1 authored Oct 8, 2024
2 parents 52b2082 + cc618ff commit ac064cf
Show file tree
Hide file tree
Showing 113 changed files with 2,805 additions and 1,084 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# See: https://editorconfig.org
root = true

[*]
charset = utf-8

[*.hs]
indent_style = space
indent_size = 2

[Makefile]
indent_style = tab
21 changes: 12 additions & 9 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,7 @@ pull_request_rules:
- label=merge+no rebase
- '#approved-reviews-by>=2'
- '#changes-requested-reviews-by=0'
# oy
# lifted these from branch protection imports
- check-success=fourmolu
- check-success=hlint
- check-success=Meta checks
- check-success=Doctest Cabal
- check-success=Validate post job
- check-success=Bootstrap post job
- 'check-success=docs/readthedocs.org:cabal'
- '#check-failure=0'

# rebase+merge strategy
- actions:
Expand All @@ -73,6 +65,7 @@ pull_request_rules:
- label=merge delay passed
- '#approved-reviews-by>=2'
- '-label~=^blocked:'
- '#check-failure=0'

# merge+squash strategy
- actions:
Expand All @@ -85,6 +78,7 @@ pull_request_rules:
- label=merge delay passed
- '#approved-reviews-by>=2'
- '-label~=^blocked:'
- '#check-failure=0'

# merge+no rebase strategy
- actions:
Expand All @@ -97,6 +91,11 @@ pull_request_rules:
- label=merge delay passed
- '#approved-reviews-by>=2'
- '-label~=^blocked:'
- '#check-failure=0'
# unlike the others, we need to force this one to be up to date
# because it's intended for when Mergify doesn't have permission
# to rebase
- '#commits-behind=0'

# merge strategy for release branches
- actions:
Expand All @@ -109,6 +108,7 @@ pull_request_rules:
- -body~=backport
- '#approved-reviews-by>=2'
- '-label~=^blocked:'
- '#check-failure=0'

# merge+squash strategy for release branches
- actions:
Expand All @@ -121,6 +121,7 @@ pull_request_rules:
- -body~=backport
- '#approved-reviews-by>=2'
- '-label~=^blocked:'
- '#check-failure=0'

# merge strategy for backports: require 1 approver instead of 2
- actions:
Expand All @@ -133,6 +134,7 @@ pull_request_rules:
- body~=backport
- '#approved-reviews-by>=1'
- '-label~=^blocked:'
- '#check-failure=0'

# merge+squash strategy for backports: require 1 approver instead of 2
- actions:
Expand All @@ -145,6 +147,7 @@ pull_request_rules:
- body~=backport
- '#approved-reviews-by>=1'
- '-label~=^blocked:'
- '#check-failure=0'

# backports should be labeled as such
- actions:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ jobs:
Cabal/**/*.hs
Cabal-syntax/**/*.hs
cabal-install/**/*.hs
cabal-validate/**/*.hs
106 changes: 40 additions & 66 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ jobs:
rm -rf ~/.config/cabal
rm -rf ~/.cache/cabal
- name: "WIN: Setup TMP environment variable"
if: runner.os == 'Windows'
run: |
echo "TMP=${{ runner.temp }}" >> "$GITHUB_ENV"
- uses: actions/checkout@v4

# See https://github.com/haskell/cabal/blob/master/CONTRIBUTING.md#hackage-revisions
Expand Down Expand Up @@ -236,29 +241,24 @@ jobs:
name: cabal-${{ runner.os }}-${{ env.CABAL_ARCH }}
path: ${{ env.CABAL_EXEC_TAR }}

- name: Validate lib-tests
- name: Validate tests
env:
# `rawSystemStdInOut reports text decoding errors`
# test does not find ghc without the full path in windows
GHCPATH: ${{ steps.setup-haskell.outputs.ghc-exe }}
run: sh validate.sh $FLAGS -s lib-tests

- name: Validate lib-suite
run: sh validate.sh $FLAGS -s lib-suite

- name: Validate cli-tests
run: sh validate.sh $FLAGS -s cli-tests

- name: Validate cli-suite
run: sh validate.sh $FLAGS -s cli-suite

- name: Validate solver-benchmarks-tests
if: matrix.ghc == env.GHC_FOR_SOLVER_BENCHMARKS
run: sh validate.sh $FLAGS -s solver-benchmarks-tests

- name: Validate solver-benchmarks-run
if: matrix.ghc == env.GHC_FOR_SOLVER_BENCHMARKS
run: sh validate.sh $FLAGS -s solver-benchmarks-run
run: |
set +e
rc=0
tests="lib-tests lib-suite cli-tests cli-suite"
if [ "${{ matrix.ghc }}" = "${{ env.GHC_FOR_SOLVER_BENCHMARKS }}" ]; then
tests="$tests solver-benchmarks-tests solver-benchmarks-run"
fi
for test in $tests; do
echo Validate "$test"
sh validate.sh $FLAGS -s "$test" || rc=1
echo End "$test"
done
exit $rc
validate-old-ghcs:
name: Validate old ghcs ${{ matrix.extra-ghc }}
Expand Down Expand Up @@ -312,11 +312,13 @@ jobs:
restore-keys: ${{ runner.os }}-${{ env.GHC_FOR_RELEASE }}-

- name: Validate build
id: build
run: sh validate.sh ${{ env.COMMON_FLAGS }} -s build

- name: "Validate lib-suite-extras --extra-hc ghc-${{ matrix.extra-ghc }}"
env:
EXTRA_GHC: ghc-${{ matrix.extra-ghc }}
continue-on-error: true
run: sh validate.sh ${{ env.COMMON_FLAGS }} --lib-only -s lib-suite-extras --extra-hc "${{ env.EXTRA_GHC }}"

build-alpine:
Expand Down Expand Up @@ -399,7 +401,6 @@ jobs:
# We need to build an array dynamically to inject the appropiate env var in a previous job,
# see https://docs.github.com/en/actions/learn-github-actions/expressions#fromjson
ghc: ${{ fromJSON (needs.validate.outputs.GHC_FOR_RELEASE) }}

defaults:
run:
shell: ${{ matrix.sys.shell }}
Expand All @@ -416,12 +417,17 @@ jobs:
esac
echo "CABAL_ARCH=$arch" >> "$GITHUB_ENV"
- name: Work around XDG directories existence (haskell-actions/setup#62)
- name: "MAC: Work around XDG directories existence (haskell-actions/setup#62)"
if: runner.os == 'macOS'
run: |
rm -rf ~/.config/cabal
rm -rf ~/.cache/cabal
- name: "WIN: Setup TMP environment variable"
if: runner.os == 'Windows'
run: |
echo "TMP=${{ runner.temp }}" >> "$GITHUB_ENV"
- uses: actions/checkout@v4

- uses: haskell-actions/setup@v2
Expand Down Expand Up @@ -451,6 +457,8 @@ jobs:
name: Create a GitHub prerelease with the binary artifacts
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
permissions:
contents: write

# IMPORTANT! Any job added to the workflow should be added here too
needs: [validate, validate-old-ghcs, build-alpine, dogfooding]
Expand All @@ -459,32 +467,15 @@ jobs:
# for now this is hardcoded. is there a better way?
- uses: actions/download-artifact@v4
with:
name: cabal-Windows-x86_64

- uses: actions/download-artifact@v4
with:
name: cabal-Linux-x86_64

- uses: actions/download-artifact@v4
with:
name: cabal-Linux-static-x86_64

- uses: actions/download-artifact@v4
with:
name: cabal-macOS-aarch64
pattern: cabal-*
path: binaries

- name: Create GitHub prerelease
uses: marvinpinto/action-automatic-releases@v1.2.1
uses: softprops/action-gh-release@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: cabal-head
tag_name: cabal-head
prerelease: true
title: cabal-head
files: |
cabal-head-Windows-x86_64.tar.gz
cabal-head-Linux-x86_64.tar.gz
cabal-head-Linux-static-x86_64.tar.gz
cabal-head-macOS-aarch64.tar.gz
files: binaries/cabal-*

prerelease-lts:
name: Create a GitHub LTS prerelease with the binary artifacts
Expand All @@ -498,39 +489,22 @@ jobs:
steps:
- uses: actions/download-artifact@v4
with:
name: cabal-Windows-x86_64

- uses: actions/download-artifact@v4
with:
name: cabal-Linux-x86_64

- uses: actions/download-artifact@v4
with:
name: cabal-Linux-static-x86_64

- uses: actions/download-artifact@v4
with:
name: cabal-macOS-x86_64
pattern: cabal-*
path: binaries

- run: |
# bash-ism, but we forced bash above
mv cabal-{,lts-}head-Windows-x86_64.tar.gz
mv cabal-{,lts-}head-Linux-x86_64.tar.gz
mv cabal-{,lts-}head-Linux-static-x86_64.tar.gz
mv cabal-{,lts-}head-macOS-x86_64.tar.gz
mv cabal-{,lts-}head-macOS-aarch64.tar.gz
- name: Create GitHub prerelease
uses: marvinpinto/action-automatic-releases@v1.2.1
uses: softprops/action-gh-release@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: cabal-lts-head
tag_name: cabal-lts-head
prerelease: true
title: cabal-lts-head
files: |
cabal-lts-head-Windows-x86_64.tar.gz
cabal-lts-head-Linux-x86_64.tar.gz
cabal-lts-head-Linux-static-x86_64.tar.gz
cabal-lts-head-macOS-x86_64.tar.gz
files: binaries/cabal-*

# We use this job as a summary of the workflow
# It will fail if any of the previous jobs does
Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/whitespace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,21 @@ on:

jobs:
whitespace:
defaults:
run:
shell: bash
runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v4
- uses: andreasabel/fix-whitespace-action@v1
with:
verbose: true

- run: |
# no longer using the action because apparently we're supposed to use the Makefile here
wget -q https://github.com/agda/fix-whitespace/releases/download/v0.1/fix-whitespace-0.1-linux.binary
mkdir -p "$HOME/.local/bin"
mv fix-whitespace-0.1-linux.binary "$HOME/.local/bin/fix-whitespace"
chmod +x "$HOME/.local/bin/fix-whitespace"
echo "$HOME/.local/bin" >> $GITHUB_PATH
- run: make whitespace
32 changes: 29 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ the code base.

We use automated whitespace convention checking. Violations can be fixed by
running [fix-whitespace](https://hackage.haskell.org/package/fix-whitespace). If
you push a fix of a whitespace violation, please do so in a _separate commit_.
you push a fix of a whitespace violation, please do so in a _separate commit_. For convenience,
`make whitespace` will show violations and `make fix-whitespace` will fix them, if the
`fix-whitespace` utility is installed.

## Other Conventions

Expand Down Expand Up @@ -346,13 +348,37 @@ description: {
}
```

Changelogs may also be written in "markdown-frontmatter" format. This is useful if your
description contains braces, which must be escaped with backslashes in `.cabal` file
format. The front matter is in YAML syntax, not `.cabal` file syntax, and the file
_must_ begin with a line containing only hyphens.

```markdown
---
synopsis: Add feature xyz
packages: [cabal-install]
prs: 0000
issues: [0000, 0000]
significance: significant
---

- Detail number 1
- Detail number 2

```
The package list must be enclosed in square brackets and comma-separated, but this
isn't needed for `prs` or `issues`; those are free-form and any YAML syntax will
be accepted. Note that the number signs on PR and issue numbers are required in
`.cabal` file syntax, but won't work in markdown-frontmatter syntax because they
signify comments in YAML.

Only the `synopsis` and `prs` fields are required, but you should also set the others where applicable.

| Field | Description |
| ----- | ----------- |
| `synopsis` | Brief description of the change. Often just the pr title. |
| `description` | Longer description, with a list of sub-changes. Not needed for small/atomic changes. |
| `packages` | Packages affected by the change (`cabal-install`, `Cabal`...). Omit if it's an overarching or non-package change. |
| `packages` | Packages affected by the change (`cabal-install`, `Cabal`...). Omit if it's a non-package change. |
| `prs` | Space-separated hash-prefixed pull request numbers containing the change (usually just one). |
| `issues` | Space-separated hash-prefixed issue numbers that the change fixes/closes/affects. |
| `significance` | Set to `significant` if the change is significant, that is if it warrants being put near the top of the changelog. |
Expand All @@ -377,7 +403,7 @@ There are a few main venues of communication:

* Many developers idle on `#hackage` on [`irc.libera.chat`](https://libera.chat). The `#ghc` channel is also a decently good bet.
* You can join the channel using a web client, even anonymously: https://web.libera.chat/#hackage
* Alternatively you can join it using [matrix](https://matrix.org/): https://matrix.to/#/#hackage:libera.chat
* Alternatively you can join it using [matrix](https://matrix.org/): https://matrix.to/#/#hackage:matrix.org

## Releases

Expand Down
3 changes: 3 additions & 0 deletions Cabal-syntax/Cabal-syntax.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ library
Distribution.Types.ConfVar
Distribution.Types.Dependency
Distribution.Types.DependencyMap
Distribution.Types.DependencySatisfaction
Distribution.Types.ExeDependency
Distribution.Types.Executable
Distribution.Types.Executable.Lens
Expand All @@ -158,6 +159,8 @@ library
Distribution.Types.Library.Lens
Distribution.Types.LibraryName
Distribution.Types.LibraryVisibility
Distribution.Types.MissingDependency
Distribution.Types.MissingDependencyReason
Distribution.Types.Mixin
Distribution.Types.Module
Distribution.Types.ModuleReexport
Expand Down
2 changes: 1 addition & 1 deletion Cabal-syntax/src/Distribution/Compat/Binary.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ decodeOrFailIO :: Binary a => ByteString -> IO (Either String a)
decodeOrFailIO bs =
catch (evaluate (decode bs) >>= return . Right) handler
where
handler (ErrorCallWithLocation str _) = return $ Left str
handler (ErrorCall str) = return $ Left str
Loading

0 comments on commit ac064cf

Please sign in to comment.