Skip to content

release-tools: haskell and hackage determinism_check on every host (part of #14268) - #14326

Draft
TrapsterDK wants to merge 8 commits into
mainfrom
rt-determinism-14268
Draft

TrapsterDK wants to merge 8 commits into
mainfrom
rt-determinism-14268

Conversation

@TrapsterDK

@TrapsterDK TrapsterDK commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #14268.

  • evidence.yml passes Bazel's native path (cygpath -w) to determinism_check on Windows, builds the tool without the scope flags, and on a failed check keeps both copies of the first 20 differing files in the artifact.
  • patches/rules_haskell/cabal_windows_relocatable.patch: on Windows, cabal_wrapper.py configures the install dirs relative to the execroot, runs Setup copy --destdir=<execroot>, and rewrites both the execroot (any separator run, any case) and the relative install dirs in the package .conf to ${pkgroot}/. Cabal has no relocatable builds on Windows, so before this the absolute output base sat in every package.cache and in every Paths_<pkg>.o. Non-Windows paths are unchanged.
  • release-tools.yml: the haskell and hackage jobs run determinism_check on every leg with --bazel "$bazel_bin" (cygpath -w on Windows). release_tools_workflow_test.rs and the workflows README follow.

Evidence (task=build relocate=true):

  • windows_x86_64, haskell targets, before the Paths fix: run 45017442095, 72 → 16 differing actions, all Paths_*.o and the links using them.
  • After b351ea5: windows_x86_64 haskell, macos_arm64 haskell, macos_arm64 hlint + nixfmt runs requested on the PR (pending).

Tested: //tools/ci:workflow_files_test, //tools/ci:actionlint_test, //patches:update_readme_test, //patches:headers_test pass. The patch applies to the pinned rules_haskell on fetch.

Stays draft until the three evidence runs are green. Then: set timeout-minutes from the measured times if needed, and the owner's release.yml dry run.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hyoCCuZ6e43Z3trY9a

@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

The four evidence runs (44853620796, 44853627359, 44853634950, 44853641582) all stopped before the determinism check: MODULE.bazel.lock is no longer up-to-date because the usages of the extension '@@rules_go+//go:extensions.bzl%go_sdk' have changed, a stale lock on the old base. Merged main and dispatched one combined run (macos_arm64 + windows_x86_64, task=build relocate=true, --//haskell/private/toolchain:ghc_mingw=True, the hpc_lcov, weeder, hlint and nixfmt sources): https://github.com/devhusdk/rules_dx/actions/runs/44950862074

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hw4aq9a55MtjjUhEzN

@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Merged origin/main (a4c8c2a). On c95eae4, analysis failed on the dx_crates digest, which main fixed in #14535. Shard 0's //tools/ci:aggregate_gates_test (reusable-release.yml "List the deployables" swallows a failure with || true) and //tools/ci:config_consistency_test (README.md quickstart .bazelversion is not 9.3.1) also fail locally on the merged head. This PR doesn't touch either file, so both come from main.

Evidence run 44950862074:

  • windows_x86_64: bazel run //tools/testing:determinism_check fails to build the tool itself. The run's --//haskell/private/toolchain:ghc_mingw=True reaches the tool build, and the libz-sys build script compiles with dx_haskell_toolchains__windows_x86_64/mingw/bin/clang for x86_64-pc-windows-msvc: src/zlib/zconf.h:456:14: fatal error: 'sys/types.h' file not found. The determinism check never runs.
  • macos_arm64: the evidence task was cancelled after about 70 minutes and left no result.

This stays a draft: the Remaining list in the body is still open.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hw4aq9a55MtjjUhEzN

Copy link
Copy Markdown
Collaborator Author

/evidence platforms=["windows_x86_64"] task=build relocate=true flags=--//haskell/private/toolchain:ghc_mingw=True scope=//haskell/private/coverage:hpc_lcov_source //haskell/private/tools/weeder/bin:source //haskell/private/tools/hlint/bin:source

e9eb595 builds //tools/testing:determinism_check without the scope flags, so ghc_mingw no longer reaches the tool's libz-sys build; the flags still reach both checked builds as the tool's arguments. //tools/ci:actionlint_test passes. Still draft: the Remaining list in the body is open.


Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

Evidence started on rt-determinism-14268: https://github.com/devhusdk/rules_dx/actions/runs/45004200913

Copy link
Copy Markdown
Collaborator Author

/evidence platforms=["windows_x86_64"] task=build relocate=true flags=--//haskell/private/toolchain:ghc_mingw=True scope=//haskell/private/coverage:hpc_lcov_source //haskell/private/tools/weeder/bin:source

Run 45004200913 reached the check on Windows: 72 actions differ, almost all HaskellCabalLibrary package.cache files of @haskell_weeder_hackage, plus .a/_iface of the CPP packages (call-stack, invariant, regex-base, regex-tdfa, toml-reader, transformers-compat, weeder) and the two links. On Linux the same package.cache holds only ${pkgroot} paths, so a Windows path leaks into the .conf. d054c1a makes a failed check copy both copies of the first 20 differing files into the evidence artifact so we can diff them.


Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

Evidence started on rt-determinism-14268: https://github.com/devhusdk/rules_dx/actions/runs/45010873796

Copy link
Copy Markdown
Collaborator Author

/evidence platforms=["windows_x86_64"] task=build relocate=true flags=--//haskell/private/toolchain:ghc_mingw=True scope=//haskell/private/coverage:hpc_lcov_source //haskell/private/tools/weeder/bin:source

Run 45010873796 uploaded both copies: every package.cache holds D:\\a\\_temp\\determinism\\{first,second}\\base\\execroot\\_main\\... with doubled backslashes, which make_relocatable_paths (single-backslash re.escape(execroot)) never matched. 411c79c adds patches/rules_haskell/cabal_windows_relocatable_conf.patch: on Windows the execroot matches with any run of \// separators, case-insensitive, and becomes ${pkgroot}/.... Checked with an ntpath simulation on the three path shapes; Linux package.cache for @haskell_weeder_hackage//:call-stack is unchanged.

Still expected to differ after this: the .a of packages with a Cabal Paths_ module (call-stack, invariant, regex-base, regex-tdfa, toml-reader, transformers-compat, weeder), whose objects embed the absolute install prefix because --enable-relocatable is off on Windows.

//patches:update_readme_test and //patches:headers_test pass.


Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

Evidence started on rt-determinism-14268: https://github.com/devhusdk/rules_dx/actions/runs/45015631238

Copy link
Copy Markdown
Collaborator Author

/evidence platforms=["windows_x86_64"] task=build relocate=true flags=--//haskell/private/toolchain:ghc_mingw=True scope=//haskell/private/coverage:hpc_lcov_source //haskell/private/tools/weeder/bin:source

Run 45015631238: the patched build of both targets passed, then determinism_check's first rebuild failed to fetch https://hackage.haskell.org/package/these-1.2.1/revision/3.cabal ("Tried to reconnect at offset 2,384 but server didn't support it"), a hackage download error, before any action ran. Rerunning once.


Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

Evidence started on rt-determinism-14268: https://github.com/devhusdk/rules_dx/actions/runs/45017442095

Copy link
Copy Markdown
Collaborator Author

Run 45017442095 (windows_x86_64, 411c79c): 72 → 16 nondeterministic actions. Every package.cache now matches. Left: _iface and .a of call-stack, invariant, regex-base, regex-tdfa, toml-reader, transformers-compat and weeder, plus weeder.exe and //haskell/private/coverage:hpc_lcov_source_upstream (HaskellLinkBinary). These are the packages with a Cabal Paths_ module: with --enable-relocatable off on Windows, Cabal bakes the absolute --prefix/--libdir/--datadir/--sysconfdir (D:\\a\\_temp\\determinism\\first\\...) into Paths_*.o, and the module's flag hash goes into the .hi. Stays draft.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

/evidence platforms=["windows_x86_64"] task=build relocate=true flags=--//haskell/private/toolchain:ghc_mingw=True scope=//haskell/private/coverage:hpc_lcov_source //haskell/private/tools/weeder/bin:source

b351ea5: the artifact of run 45017442095 shows only Paths_*.o differ in the 7 archives, each holding D:\\a\\_temp\\determinism\\first\\...\\_install\\... (Cabal's non-relocatable Windows Paths module bakes the install dirs). The patch, renamed cabal_windows_relocatable.patch, now configures --prefix/--libdir/--datadir/... relative to the execroot on Windows, runs Setup copy --destdir=<execroot>, and rewrites the relative dirs in the .conf to ${pkgroot}/ (checked with an ntpath simulation). Non-Windows paths are unchanged. The same commit moves the haskell and hackage checks in release-tools.yml out of linux-*) with --bazel "$bazel_bin" (cygpath -w on Windows) and updates release_tools_workflow_test.rs and the workflows README. //tools/ci:workflow_files_test, //tools/ci:actionlint_test, //patches:update_readme_test and //patches:headers_test pass.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

/evidence platforms=["macos_arm64"] task=build relocate=true scope=//haskell/private/coverage:hpc_lcov_source //haskell/private/tools/weeder/bin:source

macOS haskell targets alone (the combined run was cancelled at ~70 min).


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

/evidence platforms=["macos_arm64"] task=build relocate=true scope=@haskell_hlint_hackage//:hlint-exe-hlint @haskell_nixfmt_hackage//:nixfmt-exe-nixfmt

macOS hackage legs (hlint, nixfmt).


Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

Evidence started on rt-determinism-14268: https://github.com/devhusdk/rules_dx/actions/runs/45075121550

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

Evidence started on rt-determinism-14268: https://github.com/devhusdk/rules_dx/actions/runs/45075121550

@github-actions

Copy link
Copy Markdown
Contributor

Evidence started on rt-determinism-14268: https://github.com/devhusdk/rules_dx/actions/runs/45075262131

Copy link
Copy Markdown
Collaborator Author

/evidence platforms=["windows_x86_64"] task=build relocate=true flags=--//haskell/private/toolchain:ghc_mingw=True scope=//haskell/private/coverage:hpc_lcov_source //haskell/private/tools/weeder/bin:source

Run 45075121550 failed in configure: Cabal says expected an absolute directory name for --prefix. 42b644c roots the install dirs on a fixed drive (C:\bazel-out\...\_install); Setup copy --destdir=<execroot> drops the drive, so files still land under the execroot. The .conf rewrite accepts the drive prefix (checked with an ntpath simulation). //patches:update_readme_test and //patches:headers_test pass. The two macOS runs on b351ea5 are unaffected (the change is Windows-only).


Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

Evidence started on rt-determinism-14268: https://github.com/devhusdk/rules_dx/actions/runs/45077580856

Copy link
Copy Markdown
Collaborator Author

/evidence platforms=["windows_x86_64"] task=build relocate=true flags=--//haskell/private/toolchain:ghc_mingw=True scope=//haskell/private/coverage:hpc_lcov_source //haskell/private/tools/weeder/bin:source

Read the runs:

  • windows_x86_64 45077580856 (42b644c): the fixed-drive install dirs work. 72 → 2 differing actions: only the weeder.exe (HaskellCabalBinary) and hpc_lcov_source_upstream.exe (HaskellLinkBinary) links. Both are over the 20 MB copy limit, so the artifact had no bytes to compare. 7eea8fc keeps the sizes and the first 400 cmp -l offsets of every differing pair (checked locally with a 30 MB pair under bash -e -o pipefail). It also merges main (clean). If the offsets sit in the PE header (TimeDateStamp at e_lfanew+8), the fix is -optl-Wl,--no-insert-timestamp on the mingw link.
  • macos_arm64 haskell 45075121663: green, determinism check included (48 min).
  • macos_arm64 hlint + nixfmt 45075262131: rejected before building, because evidence takes no @repo// labels as scope. Rerunning below with the main-repo aliases.

//tools/ci:workflow_files_test and //tools/ci:actionlint_test pass on 7eea8fc.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

/evidence platforms=["macos_arm64"] task=build relocate=true scope=//haskell/private/tools/hlint/bin:source //core/quality/tools/nixfmt/bin:nixfmt_source

macOS hackage legs (hlint, nixfmt), through the main-repo aliases that select @haskell_{hlint,nixfmt}_hackage on macos_arm64.


Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

Evidence started on rt-determinism-14268: https://github.com/devhusdk/rules_dx/actions/runs/45143519034

TrapsterDK and others added 4 commits November 23, 2026 13:11
…art of #14268)

Same change as #14269 so macOS and Windows determinism evidence can run for haskell and hackage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hzWDHEg9zNhhTJrJ7t
On Windows, --//haskell/private/toolchain:ghc_mingw=True reached the
tool build and broke libz-sys, so the check never ran. The flags still
reach the two checked builds through the tool's own arguments.

Part of #14268

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hzHMsAXTcwYJpjaj9H
A failed check now copies the first 20 differing files (up to 20 MB
each) from both output bases into the evidence artifact, so a
Windows-only difference can be diffed without a Windows host.

Part of #14268

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hwnLJiVCijfoaG9uwF
On Windows the cabal_wrapper leaves the absolute execroot in every
installed package .conf, because Cabal writes the paths with doubled
backslashes and the execroot match uses single ones. Every
package.cache then holds the output base, so two builds in different
output bases differ (72 actions in evidence run 45004200913). A
rules_haskell patch matches the execroot with any run of separators,
in any case, and rewrites it to ${pkgroot}/ with forward slashes.

Part of #14268

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hwnLJiVCijfoaG9uwF
claude and others added 4 commits November 23, 2026 13:11
Cabal cannot build relocatable packages on Windows, so it bakes the
absolute --prefix, --libdir and friends into every Paths_<pkg> object.
Evidence run 45017442095 showed only those objects differing between two
output bases. The rules_haskell patch now configures the install dirs
relative to the execroot on Windows, copies with --destdir=<execroot>,
and rewrites the relative dirs in the package .conf to ${pkgroot}/.

release-tools.yml runs determinism_check on every haskell and hackage
leg, passing Bazel's native path on Windows.

Part of #14268

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hyoCCuZ6e43Z3trY9a
Evidence run 45075121550: Cabal rejects a relative --prefix ("expected an
absolute directory name"). Configure C:\<path under the execroot>
instead; copy --destdir drops the drive, so files still land under the
execroot and no output holds the output base.

Part of #14268

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hyoCCuZ6e43Z3trY9a
Windows run 45077580856 left only the weeder.exe and
hpc_lcov_source_upstream.exe links differing, but both are over the 20 MB
copy limit, so the artifact held neither. Each differing pair now also
keeps its sizes and first 400 differing byte offsets from cmp -l.

Part of #14268

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hzfCX44JNoyXRYMq2N
Run 45143519034 left two nondeterministic Windows actions, both PE links
(weeder.exe and hpc_lcov_source_upstream.exe). The bundled mingw link flags
now pass -Wl,--no-insert-timestamp. evidence.yml drops the differing-file
copy: determinism_check frees each output base since #14652, so it found
no files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hxcqqAoDeuSr83mscS
@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Rebased onto main (5bf6454) as d9ec5dc.

  • Run 45143519034 (windows_x86_64): 2 nondeterministic actions are left, both PE links (weeder.exe, hpc_lcov_source_upstream.exe). The artifact had no determinism-diff files. Since ci: determinism frees the first output base and splits //deploy/private (part of #14435) #14652, determinism_check removes each output base after its build, so the copy step could never find them. d9ec5dc drops that dead block from evidence.yml.
  • haskell/private/toolchain/repos.bzl: the bundled mingw C compiler link flags now end with -Wl,--no-insert-timestamp. lld's MinGW driver then writes TimeDateStamp 0 in place of the link time. haskell/tests/toolchain_tests.bzl expects it.
  • The macOS hlint + nixfmt request from 09:02 never got its own run: the bot linked it to the Windows run.

Local (linux_x86_64): bazel test //haskell/tests:all //tools/ci:workflow_files_test //tools/ci:actionlint_test //patches:all: 13 pass. bazel mod deps --lockfile_mode=error is clean.

Evidence:

This stays draft: it touches .github/workflows and needs the release.yml dry run.

🤖 Generated with Claude Code

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review Touches review paths; needs a second-session Review: comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants