Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
20489a7
feat(Cabal,Cabal-syntax): add per-file options to extra source files
andreabedini Mar 6, 2025
5c83c48
feat(Cabal): do not wrap logging by default
andreabedini Jun 5, 2025
dfcc65f
feat(Cabal, Cabal-syntax): support generated cmm-sources
andreabedini Mar 13, 2025
97f7aff
refactor(cabal-install-solver)!: remove base shim
andreabedini Mar 20, 2025
91fe71a
refactor(cabal-install,Cabal): move programDbSignature to Cabal
andreabedini Mar 19, 2025
777bad8
refactor(cabal-install): separate GenericReadyPackage from ReadyPackage
andreabedini May 8, 2025
bad3d9f
refactor(cabal-install): simplify the logic behind pkgsUseSharedLibr…
andreabedini Mar 21, 2025
07476fd
refactor(cabal-install): remove independent goals
andreabedini Mar 19, 2025
c4fedf7
refactor(cabal-install): remove base-on-base trick
andreabedini Apr 23, 2025
cba2d8c
refactor(cabal-install): remove storePackageDBStack
andreabedini Apr 9, 2025
03e053e
refactor(cabal-install): resolve package dbs during planning
andreabedini Apr 8, 2025
5f86ec8
refactor(cabal-install): remove workaround for build tools listed as …
andreabedini May 5, 2025
ac5fd6f
refactor(cabal-install): move elabInstantiatedWith and elabLinkedInst…
andreabedini May 5, 2025
5cf82bd
feat(cabal-install-solver): introduce Stage and Toolchain
andreabedini Mar 20, 2025
a4a7497
feat(cabal-install): introduce ProjectConfigToolchain
andreabedini Apr 2, 2025
d203004
feat(cabal-install-solver): all of it, second part
andreabedini Mar 21, 2025
c621fb6
refactor(cabal-install): don't check for compiler support before usi…
andreabedini Jul 24, 2025
5800c21
feat(cabal-install): add build compiler option
andreabedini Mar 20, 2025
33e995c
feat(cabal-install): all of it
andreabedini Mar 21, 2025
834ac3a
feat(cabal-install): add stage to ConstraintScope and UserConstraint
andreabedini Apr 2, 2025
10dec27
refactor(cabal-install-solver): improve messages
andreabedini Apr 23, 2025
1f218e5
refactor(cabal-install): use a pretty printer in showDepResolverParams
andreabedini Apr 23, 2025
ded3751
feat(cabal-install-solver): add null to ComponentDeps
andreabedini Apr 23, 2025
823f2f7
feat(cabal-install-solver): add Pretty instance for SolverId
andreabedini Apr 23, 2025
0658a0e
refactor(cabal-install): merge two almost identical functions
andreabedini Apr 28, 2025
04f7f38
chore(cabal-install-solver): add comments and improve readability
andreabedini Apr 29, 2025
30ce81d
feat(cabal-install, cabal-install-solver): track stage in SolverId
andreabedini Jul 2, 2025
c6fe9d0
fix(cabal-install): rewrite dependencyInconsistencies
andreabedini May 1, 2025
9936f55
refactor(cabal-install-solver): refactor modularResolver
andreabedini Jun 23, 2025
7579565
refactor(cabal-install): generalise GenericInstallPlan to arbitrary n…
andreabedini Aug 7, 2025
d6cceff
chore(Cabal): update reference to backpack-include field, now called …
andreabedini May 6, 2025
a4d641a
feat: add a bunch of HasCallStack
andreabedini Jun 25, 2025
7258a09
fix: use nodeKey in fromSolverInstallPlanWithProgress
andreabedini May 19, 2025
fa7d943
propagate stage trough elaborateProjectPlanning
andreabedini May 5, 2025
81b922a
fix(cabal-install): rewrite instantiateInstallPlan
andreabedini Aug 7, 2025
cbd4ee3
refactor(cabal-install): reduce scope in ProjectPlanning
andreabedini Jul 14, 2025
dcc3a40
refactor(cabal-install): readability improvements
andreabedini May 20, 2025
5b8e06b
fix(cabal-install): use the correct stage for setup deps
andreabedini May 27, 2025
bd63c2b
refactor(cabal-install): rebuildTargets
andreabedini May 27, 2025
1fbe93f
feat(cabal-install): more logging in buildAndRegisterUnpackedPackage
andreabedini May 27, 2025
e9dc00d
fix(cabal-install): use the correct packagedb for setup
andreabedini Jun 25, 2025
7a3a772
fix(cabal-install): fix pkgsToBuildInPlaceOnly
andreabedini May 28, 2025
4413cf0
refactor(cabal-install): seprate build directories and drop -inplace
andreabedini Jul 26, 2025
72f79fc
fix(Cabal): do not use GHC to configure LD
angerman May 22, 2025
eba3a61
feat(cabal-install): add parser for UserQualExe
andreabedini Jul 10, 2025
da951b8
feat(cabal-install): add ScopeAnyExeQualifier and UserAnyExeQualifier
andreabedini Jul 10, 2025
4be303f
feature(cabal-install): automatically copy executables into build dir…
andreabedini Jun 5, 2025
070731e
refactor(cabal-install): refactor InstallPlan.problems
andreabedini Jul 28, 2025
e955292
refactor(cabal-install): use LogProgress in InstallPlan
andreabedini Aug 1, 2025
6c35ee4
feat(cabal-install): implicilty monitor our own executable to burst s…
andreabedini Aug 1, 2025
861e292
refactor(Cabal-syntax): Improve Graph.broken
andreabedini Aug 4, 2025
a052ff4
refactor(cabal-install): harmonise various dependency functions
andreabedini Aug 4, 2025
6a603fa
refactor(cabal-install): rename, format and comment
andreabedini Aug 5, 2025
89c5019
refactor(cabal-install): pkgDependsOnSelfLib should not hide failures
andreabedini Aug 5, 2025
d326ad4
fix(Cabal): do not print finalized package description, it loops
andreabedini Aug 6, 2025
7a53354
feature(cabal-install): improve logging of setup arguments
andreabedini Aug 6, 2025
ed6d144
fix(Cabal): fix abi tag in case ghc's unit-id is the same as the comp…
andreabedini Aug 7, 2025
70576b3
fix(Cabal): disable logging of the response file
andreabedini Jul 30, 2025
ffda137
fixup! fix(Cabal): do not use GHC to configure LD
angerman Aug 26, 2025
acd159d
fix: add platform-specific executable extension to build output paths
andreabedini Nov 14, 2025
74ff1c3
Fix compilation with TH
hasufell Dec 10, 2025
37aba60
CI: build portable binaries
hasufell Dec 8, 2025
26579bb
Disable tests in release CI
hasufell Dec 10, 2025
38ac7ce
Bump mac x86_64
hasufell Dec 10, 2025
601bd23
Fix release creation
hasufell Dec 10, 2025
82d4c8f
Fix stdout tidiness
hasufell Dec 11, 2025
fdbfbbe
Bump to 3.17.0.1
hasufell Dec 11, 2025
eb375e8
refactor(cabal-install): add more HasCallstack
andreabedini Aug 7, 2025
9e7b9a9
refactor(Cabal): add a stack trace to dieProgress
andreabedini Aug 7, 2025
f0a8223
debug: log why not registering
andreabedini Aug 5, 2025
7823e30
Fix statically linking executables wrt #11224
hasufell Sep 25, 2025
d923caf
refactor: remove support for UHC
andreabedini Sep 1, 2022
3cec6f0
refactor: remove behaviour specific to GHC 8.4
andreabedini Nov 20, 2025
c449c6d
small change in logging
andreabedini Nov 20, 2025
188bd33
use package.conf.d as GHC does
andreabedini Nov 20, 2025
9989878
refactor: remove support for GHCJS
andreabedini Nov 19, 2025
9d458f8
refactor: remove support for JHC
andreabedini Nov 19, 2025
c917825
refactor: remove support for NHC, YHC, Hugs, HBC, Helium, Eta
andreabedini Nov 19, 2025
c45f2b6
refactor: remove support for LHC
andreabedini Sep 1, 2022
25a4cd7
merge
andreabedini Dec 16, 2025
56b5dfc
remove libraryDynDirSupported
andreabedini Nov 21, 2025
8b581ae
refactor: remove sanityCheckElaboratedConfiguredPackage
andreabedini Dec 3, 2025
33fb149
make createDirectoryIfMissingVerbose spam less
andreabedini Dec 3, 2025
33a1385
remove some useless asserts
andreabedini Dec 8, 2025
7cf0896
remove lukko
andreabedini Dec 3, 2025
8e72738
refactor withIncomingUnitIdLock
andreabedini Dec 3, 2025
754971b
elabToolchain
andreabedini Dec 1, 2025
43832a4
use toolchain in StoreDirLayout
andreabedini Dec 3, 2025
8f1a5b7
use toolchain in DistDirParams
andreabedini Dec 3, 2025
1df99bd
formatting
andreabedini Dec 9, 2025
eb5ea4d
remove workaround for ancient GHCs
andreabedini Dec 10, 2025
7e6f086
small refactor in Link.hs
andreabedini Dec 10, 2025
d6c3ed2
remove inplace builds, use project local store
andreabedini Dec 3, 2025
1cf47fa
use compilers "Target platform" string
andreabedini Dec 15, 2025
37774f9
Remove configFlagError
andreabedini Dec 22, 2025
6c6a117
elabAbsoluteInstallDirs
andreabedini Dec 23, 2025
0ff7eb0
Replace store copy mechanistm with a simple install into registration…
andreabedini Dec 23, 2025
602728d
Improve logging for program invocations with response file
andreabedini Jan 27, 2026
795e048
improve logging
andreabedini Jan 28, 2026
6bfa8ae
Make sense of ./configure script invocation
andreabedini Jan 28, 2026
0364e21
move log files
andreabedini Jan 28, 2026
8c0c0e7
style changes
andreabedini Jan 28, 2026
ade97ae
fixup! Make sense of ./configure script invocation
andreabedini Jan 29, 2026
2c789b3
fixup! Make sense of ./configure script invocation
hasufell Feb 3, 2026
1cf2820
Fix platformToTriple
hasufell Feb 5, 2026
6a36bb7
Revert "move log files"
hasufell Feb 5, 2026
23b685d
Revert "improve logging"
hasufell Feb 5, 2026
e953b13
Revert "Improve logging for program invocations with response file"
hasufell Feb 5, 2026
9b0cab4
Revert fixes
hasufell Feb 5, 2026
a3759bb
Fix default dynlibdir
hasufell Feb 11, 2026
7045a18
Fix build on windows
hasufell Feb 13, 2026
935788c
move log files
andreabedini Jan 28, 2026
fdedd1e
Fix FreeBSD build failure after log file disambiguation
hasufell Feb 18, 2026
f6be0e0
Reinstate file monitor tracking for installed packages
andreabedini Feb 23, 2026
54cf64b
Stop stealing the vowels
hasufell Feb 24, 2026
3c6bcbc
Fix caching of remote source tarballs
hasufell Feb 24, 2026
e1174eb
fix: serialise BuildInplaceOnly tarball extraction to prevent TOCTOU …
angerman Feb 28, 2026
8f9daf7
Add rebase CI
hasufell Jul 9, 2025
2f10c04
Do nightly release
hasufell Jul 15, 2025
6e4ee4b
Add FreeBSD releases
hasufell Jul 18, 2025
ccac04e
Remove EOL alpine:3.12
hasufell Aug 13, 2025
d6fac5f
Remove dead GHCJS references in ProjectPlanning.hs
angerman May 26, 2026
3386061
Fix stale binDirectoryFor call in ProjectOrchestration
angerman May 26, 2026
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
File renamed without changes.
58 changes: 58 additions & 0 deletions .github/scripts/rebase_local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash

set -eux

upstream_repo=$1
# of the form [<branch>:<rebase-target>], e.g.:
# BA:master B1:master B2:B1 B3:B2
spec=$2

{

git remote add upstream "${upstream_repo}" || true
git fetch upstream

output_branches=()

# sync master with upstream
git checkout master
git reset --hard upstream/master
output_branches+=( "master" )

# rebase each branch
mkdir -p rebase
for branch_spec in ${spec} ; do
branch=$(echo "${branch_spec}" | awk -F ':' '{ print $1 }')
rebase_target=$(echo "${branch_spec}" | awk -F ':' '{ print $2 }')
git checkout "${branch}"
common_ancestor=$(git merge-base "${branch}" "origin/${rebase_target}")
[ -e rebase/"${branch}" ] && exit 1
mkdir -p rebase/"${branch}"
(
cd rebase/"${branch}"
echo "${common_ancestor}" > BASE_COMMIT
git format-patch "${common_ancestor}".."${branch}"
)
if compgen -G rebase/"${branch}"/*.patch > /dev/null; then
git reset --hard "${rebase_target}"
git am --3way rebase/"${branch}"/*.patch
fi
output_branches+=( "${branch}" )
done
unset branch_spec branch

# cherry-pick on stable-master
git checkout stable-master
git reset --hard upstream/master
for branch_spec in ${spec} ; do
branch=$(echo "${branch_spec}" | awk -F ':' '{ print $1 }')
if compgen -G "rebase/${branch}"/*.patch > /dev/null; then
git am --3way "rebase/${branch}"/*.patch
fi
done
output_branches+=( "stable-master" )

} >&2

echo "${output_branches[*]}"

167 changes: 167 additions & 0 deletions .github/scripts/rebase_spec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
#!/bin/bash

# Branch regex we consider for rebase targets.
# For our purposes this is usually 'stable-haskell/feature/*'.
# 'master' is always considered.
branch_regex=$1
shift 1
declare -a input_branches
input_branches=( "$@" )
set -eux

[ ${#input_branches[@]} -eq 0 ] &&
input_branches=( $(gh pr list --label rebase --state open --json headRefName --jq ".[] | select( .headRefName | match(\"${branch_regex}\")) | .headRefName" --template '{{range .}}{{tablerow .headRefName}}{{end}}') )

branch_list=( )
declare -A branch_map

# @FUNCTION: die
# @USAGE: [msg]
# @DESCRIPTION:
# Exits the shell script with status code 2
# and prints the given message in red to STDERR, if any.
die() {
(>&2 red_message "$1")
exit 2
}

# @FUNCTION: red_message
# @USAGE: <msg>
# @DESCRIPTION:
# Print a red message.
red_message() {
printf "\\033[0;31m%s\\033[0m\\n" "$1"
}

# @FUNCTION: array_contains
# @USAGE: <arr_ref> <val>
# @DESCRIPTION:
# Checks whether the array reference contains the given value.
# @RETURN: 0 if value exists, 1 otherwise
array_contains() {
local -n arr=$1
local val=$2
shift 2
if [[ " ${arr[*]} " =~ [[:space:]]${val}[[:space:]] ]]; then
return 0
else
return 1
fi
}

max_backtrack=10

# @FUNCTION: backtrack
# @USAGE: <map_ref> <start_key> <abort_value>
# @DESCRIPTION:
# Backtrack dependencies through an array list.
# E.g. given an associated array with key value pairs of:
# B1 -> M
# B2 -> B1
# B3 -> B2
#
# ...if we pass B3 as start_key and M as abort_value, then
# we receive the flattened ordered list "B1 B2 B3"
# @STDOUT: space separated list of backtracked values
backtrack() {
backtrack_ 0 "$1" "$2" "$3"
}

# internal to track backtrack depth
backtrack_() {
local depth=$1
if [[ $depth -gt $max_backtrack ]] ; then
die "Dependency backtracking too deep... aborting!"
fi
shift 1

if [[ $1 != map ]] ; then
local -n map=$1
fi

local base=$2
local abort_value=$3
local value

if [ "${base}" = "${abort_value}" ] ; then
return
fi

value=${map[$base]}

if [ "${value}" = "${abort_value}" ] ; then
if ! array_contains branch_list "${base}" ; then
echo "${base}"
fi
else
if array_contains branch_list "${base}" ; then
backtrack_ $((depth++)) map "${map[$value]}" "${abort_value}"
else
echo "$(backtrack_ $((depth++)) map "${map[$base]}" "${abort_value}")" "${base}"
fi
fi
}

create_branch_map() {
local -n arr=$1
local -n discovered=$2
local -n map=$3

while IFS= read -r branch || [[ -n $branch ]]; do
rebase_target=$(git branch --merged "${branch}" --sort="ahead-behind:${branch}" --format="%(refname:short)" | grep -e "${branch_regex}" -e '^master$' | awk 'NR==2{print;exit}')

# this is the case when the branch is actually behind master... we then
# still want to rebase against master
if [ -z "${rebase_target}" ] ; then
rebase_target=master
fi

if ! array_contains input_branches "${rebase_target}" && [ "${rebase_target}" != "master" ] ; then
discovered+=( "${rebase_target}" )
fi

map["${branch}"]="${rebase_target}"
done < <(printf '%s\n' "${arr[@]}")
}

{

# create branch rebase tree
# we're doing that on the state of the local tree/master
newly_detected_input_branches=( )
create_branch_map input_branches newly_detected_input_branches branch_map
# these shenanigns are needed in case the rebase target branches themselves do not have
# the 'rebase' label... this would break cherry-picking on master, so we include "parent"
# branches regardless
while true ; do
if [ ${#newly_detected_input_branches[@]} -eq 0 ] ; then
break
else
nothing=( )
create_branch_map newly_detected_input_branches nothing branch_map
newly_detected_input_branches=( "${nothing[@]}" )
fi
done

} >&2

# flatten recursively
for key in "${!branch_map[@]}"; do
value=${branch_map[$key]}
if [ "${value}" = "master" ] ; then
if ! array_contains branch_list "${key}" ; then
branch_list+=( "${key}" )
fi
else
# shellcheck disable=SC2207
branch_list+=( $(backtrack branch_map "$key" "master") )
fi
done
unset key

result=( )
for key in "${branch_list[@]}"; do
result+=( "${key}:${branch_map[$key]}" )
done
echo "${result[@]}"

2 changes: 1 addition & 1 deletion .github/scripts/test.bash → .github/scripts/test.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ cabal update
# TODO: we want to avoid building here... we should just
# be using the previously built 'cabal-tests' binary
# Also see https://github.com/haskell/cabal/issues/11048
cabal run -w "ghc-${GHC_TEST_VERSION}" ${ADD_CABAL_ARGS} cabal-testsuite:cabal-tests -- \
cabal run ${ADD_CABAL_ARGS} cabal-testsuite:cabal-tests -- \
--with-cabal "$(pwd)/out/cabal" \
--intree-cabal-lib "$(pwd)" \
--test-tmp "$(pwd)/testdb" \
Expand Down
156 changes: 156 additions & 0 deletions .github/workflows/rebase.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
name: Rebase against upstream

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

permissions:
contents: write
issues: write
pull-requests: read

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false

jobs:
rebase:
name: Rebase now!
runs-on: ubuntu-latest
env:
UPSTREAM_REPO: https://github.com/haskell/cabal.git
CI_BRANCH: stable-haskell/feature/rebase-CI
outputs:
rebase_output_json: ${{ steps.rebase.outputs.branches_json }}
rebase_output: ${{ steps.rebase.outputs.branches }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- id: rebase
name: rebase
run: |
set -eux

git switch --detach
git fetch origin refs/heads/*:refs/heads/*

gh repo set-default stable-haskell/cabal
git config checkout.defaultRemote origin

# required to apply patches
git config user.email "ci@users.noreply.github.com"
git config user.name "GitHub CI"

# this does not push
branch_spec=$(bash .github/scripts/rebase_spec.sh '^stable-haskell/feature/.*')
rebased_branches=( $(bash .github/scripts/rebase_local.sh ${{ env.UPSTREAM_REPO }} "${branch_spec}") )

# we use branches_json to trigger release workflow, but we don't want to do it for upstream master
echo "branches_json=$(jq --compact-output --null-input '$ARGS.positional' --args -- "${rebased_branches[@]/#/tmp\/}" | jq --compact-output 'del(.[] | select(. == "tmp/master"))')" >> "$GITHUB_OUTPUT"
# this output is used to update remote branches, so it shall include upstream master
echo "branches=${rebased_branches[*]} master" >> "$GITHUB_OUTPUT"
shell: bash
env:
GH_TOKEN: ${{ github.token }}

- name: save branches on remote
run: |
set -eux

for branch in ${{ steps.rebase.outputs.branches }} ; do
git checkout "${branch}"
git push -f https://${{ secrets.REBASE_PAT }}@github.com/${{ github.repository }}.git ${branch}:tmp/${branch}
done
shell: bash
env:
GH_TOKEN: ${{ github.token }}

- if: always()
name: backup
run: |
git checkout -f master || true
git archive master > backup.tar
tar -rf backup.tar .git rebase

- if: always()
name: Upload artifact
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
retention-days: 7
name: backup
path: |
./backup.tar

- name: checkout reusable workflow
run: |
git checkout -f "${{ env.CI_BRANCH }}"

release-workflow:
needs: ["rebase"]
uses: ./.github/workflows/reusable-release.yml
with:
branches: ${{ needs.rebase.outputs.rebase_output_json }}
ghc: "9.6.7"
cabal: "3.12.1.0"

push-job:
runs-on: ubuntu-latest
needs: [rebase, release-workflow]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- name: update branches
run: |
set -eux

for branch in ${{ needs.rebase.outputs.rebase_output }} ; do
git checkout "${branch}"
git push -f https://${{ secrets.REBASE_PAT }}@github.com/${{ github.repository }}.git tmp/${branch}:${branch}
done
git push -f https://${{ secrets.REBASE_PAT }}@github.com/${{ github.repository }}.git tmp/stable-master:stable-master

shell: bash
env:
GH_TOKEN: ${{ github.token }}

- name: delete tmp branches
if: always()
run: |
unset branch
for branch in $(git for-each-ref --format="%(refname:short)" -- 'refs/heads/tmp') ; do
git push -f https://${{ secrets.REBASE_PAT }}@github.com/${{ github.repository }}.git :${branch}
done
shell: bash
env:
GH_TOKEN: ${{ github.token }}

notify-job:
runs-on: ubuntu-latest
needs: [release-workflow]
if: ${{ always() && contains(needs.*.result, 'failure') }}
steps:
- name: Checkout code
uses: actions/checkout@v4

# create an issue with a link to the workflow run on failure
# TODO: don't create more issues, only use one
- run: |
set -eux
gh repo set-default stable-haskell/cabal
for issue in $(gh issue list --label rebase-failure --json url -q '.[] | .url') ; do
gh issue close "${issue}"
done
gh issue create --title "Rebase failed on $(date -u +"%Y-%m-%d")" --label rebase-failure --body "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
env:
GH_TOKEN: ${{ github.token }}

Loading