Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
- `verify-pins.yml`: weekly `//core/quality/artifacts:update -- --verify-only`. It fails naming each stale record.
- `patch-upstream.yml`: weekly `//patches:upstream`. It reads the `Upstream:` header of each patch under `patches/` and the `# Upstream:` carry markers in `BUILD` and `.bzl` files, and opens, or updates, the issue "patches: upstream fixes released" when an upstream pull request is merged and in a release, a ref was closed without a merge, or a patch has no header.
- `release-cells.yml`: reusable, read-only. Builds, independently rebuilds and qualifies one archive per `//deploy/private/release:release_matrix` cell on its native runner (a consumer Bazel build included), then verifies all records. The `windows_accept_licenses` input (by default the Visual Studio Build Tools licence) lists the licence ids the Windows cells' consumers accept at `dx init`; it is the only place the release names a licence. Artifacts: `release-cell-<name>` per cell and the combined `release-cells`; outputs: `version`, `sha`, `workflow_ref`. It fails when any cell is rejected, and a rejected cell never stops the others. Each matrix row sets its own job timeout: 180 minutes for the Windows cells, 90 for the others.
- `release-tools.yml`: reusable, read-only. Builds the deadnix, selene, topiary and progenitor binaries on `linux-x86_64`, `linux-arm64`, `macos-arm64` and `windows-x86_64` (static musl binaries on Linux), ad-hoc signs the `macos-arm64` ones, builds static kcov on the two Linux hosts as `dx-kcov-<host>`, builds it a second time and compares the two execution logs with `//tools/testing:determinism_check`, and uploads `release-tool-<host>`, holding the binaries, their licences, the deadnix source crate and the kcov source archive. Its `python-tools` job builds the `dx-python-tools-<host>.tar.gz` bundles of the core Python quality tools for every release host on `linux-x86_64` and uploads `release-tool-python-tools`. Its `go` job cross-builds the `dx-go-<host>` Go tool multicall, `dx-oapi-codegen-<host>` and `dx-gopackagesdriver-<host>` for every release host on `linux-x86_64`, checks each binary's format, copies `dx-oapi-codegen-LICENSE` and `dx-gopackagesdriver-LICENSE`, runs the Linux ones and uploads `release-tool-go`. Its `python-tools`, `go` and `jars` jobs, and the Linux legs of its `tools`, `haskell` and `hackage` jobs, also build their assets twice in fresh output bases with `//tools/testing:determinism_check` and fail when the execution logs differ.
- `release-tools.yml`: reusable, read-only. Builds the deadnix, selene, topiary and progenitor binaries on `linux-x86_64`, `linux-arm64`, `macos-arm64` and `windows-x86_64` (static musl binaries on Linux), ad-hoc signs the `macos-arm64` ones, builds static kcov on the two Linux hosts as `dx-kcov-<host>`, builds it a second time and compares the two execution logs with `//tools/testing:determinism_check`, and uploads `release-tool-<host>`, holding the binaries, their licences, the deadnix source crate and the kcov source archive. Its `python-tools` job builds the `dx-python-tools-<host>.tar.gz` bundles of the core Python quality tools for every release host on `linux-x86_64` and uploads `release-tool-python-tools`. Its `go` job cross-builds the `dx-go-<host>` Go tool multicall, `dx-oapi-codegen-<host>` and `dx-gopackagesdriver-<host>` for every release host on `linux-x86_64`, checks each binary's format, copies `dx-oapi-codegen-LICENSE` and `dx-gopackagesdriver-LICENSE`, runs the Linux ones and uploads `release-tool-go`. Its `python-tools`, `go`, `jars`, `haskell` and `hackage` jobs, and the Linux legs of its `tools` job, also build their assets twice in fresh output bases with `//tools/testing:determinism_check` and fail when the execution logs differ.
- `release.yml`: calls `release-cells.yml` for the five platform archives and `release-tools.yml` for the tool binaries, builds the `rules_dx-<version>.tar.gz` source archive (after `release_driver` checks the tag against the candidate commit), then attests the manifest and uploads them through `release_driver` with the raw dx and dx gazelle binaries, `.sha256` files, the `dx-sha256sums.txt` and `dx-gazelle-sha256sums.txt` and `dx-tool-sha256sums.txt` manifests, and `source.json` to the release, then runs `dx security --verify` on `dx-linux-x86_64.tar.gz` and the source archive and on a one-byte-modified copy of each. The `dry_run` dispatch input runs the same `source`, `attest` and `assets` chain on the cells' version, skips every step that needs a pushed tag, signing or publishing, and still checks the `release-assets` paths. No asset is ever replaced once uploaded: a rerun skips identical assets and fails on a different one.
- `release-consumer.yml`: runs when a release is published, or by dispatch with a `tag`. On the five release platforms it checks the platform archive and the source archive with `gh attestation verify` against the published bundles, resolves `rules_dx` through the BCR when it lists the version and otherwise through a local registry made from the published `source.json`, builds the quickstart consumer with no override, and checks that `@rules_dx//:dx` is the prebuilt download and prints the released version, that topiary and progenitor are the prebuilt downloads, that `@rules_dx//config:tool_govet` is the prebuilt dx-go and `tool_modfmt` runs, on Linux that kcov is the prebuilt download, and on `windows-arm64` that the `pkl_lsp` natives jar packs the prebuilt tree-sitter and tree-sitter-pkl DLLs. It skips releases whose tag does not start with `v`, such as `mirror-php-<version>`. When every `consumer` job is green, its `bcr` job calls `bazel-contrib/publish-to-bcr` (pinned v1.7.0) to open the BCR pull request from the `BCR_REGISTRY_FORK` fork with `BCR_PUBLISH_TOKEN`; it is skipped while that variable is unset and for `v0.0.*` tags. Its `bcr-ledger` job runs `//deploy/private/release:bcr_ledger` and records the pull request URL, `failed`, or `not-authorized` for a skipped `bcr` job, in the run summary and the `bcr-ledger` artifact.
- `upgrade-e2e.yml`: when a release is published, or by dispatch with optional `from` and `to`. Runs `producers_bin --upgrade-e2e`: a throwaway consumer on the second-latest BCR release runs `dx init`, upgrades to the latest and back with `dx upgrade --to <version> --apply`, and runs `bazel test //...` after each step. It needs two published releases on the BCR. `producers_bin --upgrade-e2e --from <from> --to local` upgrades to this checkout instead (`local_path_override` at the root `MODULE.bazel` version), so the run uses the tree's own dx. After `dx init` and each upgrade it reads `bazel mod graph --output=json` and fails when the consumer names `rules_php`, `rules_lua` or `rules_qt`, when a rule set does not resolve to exactly the floor of the target rules_dx release, or when rules_dx does not resolve to the target version.
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/evidence.yml
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,10 @@ jobs:
}
run_task "$RUNNER_TEMP/evidence/evidence.log"
if [ "$DX_RELOCATE" = true ] && [ "$DX_TASK" = build ]; then
bazel run --noshow_progress "${flags[@]}" //tools/testing:determinism_check -- --bazel "$(command -v bazel)" --out "$RUNNER_TEMP/determinism" "${flags[@]}" "${patterns[@]}" 2>&1 | tee "$RUNNER_TEMP/evidence/determinism.txt"
bazel_bin="$(command -v bazel)"
[ "$RUNNER_OS" != Windows ] || bazel_bin="$(cygpath -w "$bazel_bin")"
# The scope flags go to the checked builds only: on the tool build, a toolchain flag like ghc_mingw breaks its Rust deps.
bazel run --noshow_progress //tools/testing:determinism_check -- --bazel "$bazel_bin" --out "$RUNNER_TEMP/determinism" "${flags[@]}" "${patterns[@]}" 2>&1 | tee "$RUNNER_TEMP/evidence/determinism.txt"
elif [ "$DX_RELOCATE" = true ]; then
base="$RUNNER_TEMP/relocated-base"
rm -rf "$base"
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/release-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,9 @@ jobs:
;;
esac
done
case "$HOST" in
linux-*) bazel run //tools/testing:determinism_check -- --bazel "$(command -v bazel)" --out "$RUNNER_TEMP/determinism" ${flags[@]+"${flags[@]}"} "${targets[@]}" ;;
esac
bazel_bin="$(command -v bazel)"
case "$HOST" in windows-*) bazel_bin="$(cygpath -w "$bazel_bin")" ;; esac
bazel run //tools/testing:determinism_check -- --bazel "$bazel_bin" --out "$RUNNER_TEMP/determinism" ${flags[@]+"${flags[@]}"} "${targets[@]}"
check="$RUNNER_TEMP/weeder-check"
case "$HOST" in windows-*) check="$check.exe" ;; esac
cp "$out/dx-weeder-$HOST" "$check"
Expand Down Expand Up @@ -477,7 +477,6 @@ jobs:
echo "$asset is dynamically linked" >&2
exit 1
fi
bazel run //tools/testing:determinism_check -- --bazel "$(command -v bazel)" --out "$RUNNER_TEMP/determinism" ${flags[@]+"${flags[@]}"} "$TARGET"
;;
macos-*)
if otool -L "$out/$asset" | grep -q libHS; then
Expand All @@ -487,6 +486,9 @@ jobs:
codesign --verify "$out/$asset" 2>/dev/null || codesign --force -s - "$out/$asset"
;;
esac
bazel_bin="$(command -v bazel)"
case "$HOST" in windows-*) bazel_bin="$(cygpath -w "$bazel_bin")" ;; esac
bazel run //tools/testing:determinism_check -- --bazel "$bazel_bin" --out "$RUNNER_TEMP/determinism" ${flags[@]+"${flags[@]}"} "$TARGET"
"$out/$asset" --version
if test "$HOST" = "linux-arm64"; then
package="$(jq -c --arg tool "$TOOL" '.packages[] | select(.name == $tool) | {version, archive: .archives[0]}' "$LOCK")"
Expand Down
1 change: 1 addition & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,7 @@ dx_pins.archive(
"//patches/rules_haskell:ghc_xcode_env.patch",
"//patches/rules_haskell:llvm_backend.patch",
"//patches/rules_haskell:toolchain_type_alias.patch",
"//patches/rules_haskell:cabal_windows_relocatable.patch",
],
pins = "//haskell:pins.json",
)
Expand Down
7 changes: 7 additions & 0 deletions haskell/private/toolchain/repos.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ BUNDLED_FLAGS = ["C compiler flags", "C++ compiler flags", "C compiler link flag

MINGW_ROOT = "$topdir/../mingw/"

MINGW_LINK_FLAGS = "-Wl,--no-insert-timestamp"

SETTINGS = {
"C compiler command": NO_HOST_TOOL,
"C compiler flags": "",
Expand Down Expand Up @@ -323,6 +325,11 @@ def ghc_settings(source, cc_target = ""):
key = stripped[2:stripped.index("\"", 2)]
if key in SETTINGS:
seen.append(key)
if key == "C compiler link flags" and MINGW_ROOT in source:
bundled = stripped[stripped.index(",") + 1:].strip().rstrip(")").strip().strip("\"")
line = line[:line.index("(")] + "(" + repr(key) + ", " + repr((bundled + " " + MINGW_LINK_FLAGS).strip()) + ")"
lines.append(line)
continue
if (key in BUNDLED_FLAGS and MINGW_ROOT in source) or (key in BUNDLED_TOOLS and (MINGW_ROOT in source or "\"$tooldir/" in stripped)):
lines.append(line)
continue
Expand Down
2 changes: 1 addition & 1 deletion haskell/tests/toolchain_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def _checks():
expect_false("windows settings keep bundled mingw paths", host_path(windows_settings)),
expect_contains("windows settings keep the bundled windres", windows_settings, "(\"windres command\", \"$topdir/../mingw//bin/llvm-windres.exe\")"),
expect_contains("windows settings keep the bundled merge objects tool", windows_settings, "(\"Merge objects command\", \"\")"),
expect_contains("windows settings keep the bundled link flags", windows_settings, "(\"C compiler link flags\", \"-fuse-ld=lld --rtlib=compiler-rt -D_UCRT\")"),
expect_contains("windows settings keep the bundled link flags without a PE timestamp", windows_settings, "(\"C compiler link flags\", \"-fuse-ld=lld --rtlib=compiler-rt -D_UCRT -Wl,--no-insert-timestamp\")"),
expect_contains("windows settings keep the bundled ar", windows_settings, "(\"ar command\", \"$topdir/../mingw//bin/llvm-ar.exe\")"),
expect_true("a drive path is a host path", host_path("(\"ar command\", \"C:\\\\tools\\\\ar.exe\")")),
expect_true("an absolute path is a host path", host_path("(\"ar command\", \"/usr/bin/ar\")")),
Expand Down
2 changes: 1 addition & 1 deletion patches/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Some upstream fixes are carried as rules_dx code instead of a patch, such as ext

## Patches in rules_dx repository rules: elvis, rules_cuda, rules_d, rules_dotnet, rules_elixir, rules_erlang, rules_fortran, rules_haskell, rules_julia, rules_ocaml, rules_powershell, rules_ruby, rules_scala, windows_support

rules_dx applies these patches in its own repository rules, so consumers get them too and you need to do nothing: `lazy_format.patch` (elvis); `coverage_keep.patch`, `objdir_as_tempdir.patch`, `toolchain_type_alias.patch` (rules_cuda); `pic_link.patch`, `disabled_features.patch`, `toolchain_type_alias.patch` (rules_d); `module_map_key.patch`, `toolchain_type_alias.patch` (rules_fortran); `reproducible.patch`, `fsharp_signature.patch`, `nuget_group_prefix.patch`, `sdk_versions.patch`, `canonical_labels.patch`, `toolchains_gate.patch`, `launcher_args.patch`, `target_runtime.patch`, `fsharp_pdb_path.patch` (rules_dotnet); `coverage_wrapper_no_report.patch`, `hermetic_haskell.patch`, `cabal_rules.patch`, `cabal_mingw_transition.patch`, `cc_wrapper_relpath_mount.patch`, `ghc_wrapper_runfiles_env.patch`, `cc_toolchain_config_info.patch`, `cabal_llvm_ar.patch`, `cc_wrapper_darwin_ffi.patch`, `cabal_binary_dep_data.patch`, `cabal_static_exe.patch`, `cabal_ghcversion_relpath.patch`, `cc_wrapper_origin_rpath.patch`, `ghc_xcode_env.patch`, `llvm_backend.patch`, `toolchain_type_alias.patch` (rules_haskell); `elixir_app_deps.patch`, `elixir_app_name.patch`, `relocatable_tree.patch`, `warnings_as_errors.patch`, `windows_ex_unit_test.patch`, `toolchain_type_alias.patch`, `relative_beam_paths.patch` (rules_elixir); `01_xrl_yrl.patch`, `02_tcw_tags.patch`, `03_auto_sname.patch`, `04_otp_tree.patch`, `05_windows_eunit_cover.patch`, `06_coverage_enabled.patch`, `07_windows_ct_cover.patch`, `08_nif_profile_per_library.patch`, `toolchain_type_alias.patch` (rules_erlang); `config_base_toml.patch`, `in_process_resolve_test.patch`, `locate_installed_package.patch`, `package_annotation_version.patch`, `entry.patch`, `portable_cpu_target.patch`, `template_action_input.patch`, `exec_toolchain.patch`, `inline_runfiles_sh.patch`, `test_tmpdir_runfiles.patch`, `julia_1_13.patch`, `stable_precompile_paths.patch`, `fixed_heap_addresses.patch`, `stable_sysimage_paths.patch` (rules_julia); `empty_glob.patch`, `hermetic_ocaml.patch`, `native_cc_env.patch`, `platform_alias.patch`, `static_cc_deps.patch`, `toolchain_type_alias.patch` (rules_ocaml); `inline_runfiles_sh.patch` (rules_powershell); `coverage.patch`, `rubyinstaller_archive.patch`, `toolchains_gate.patch`, `toolchains_hub.patch`, `windows_binary_rlocation.patch` (rules_ruby); `dx_bzl_srcs.patch`, `manifest_only_wrapper.patch`, `protobuf_repo_name.patch`, `toolchain_type_alias.patch` (rules_scala).
rules_dx applies these patches in its own repository rules, so consumers get them too and you need to do nothing: `lazy_format.patch` (elvis); `coverage_keep.patch`, `objdir_as_tempdir.patch`, `toolchain_type_alias.patch` (rules_cuda); `pic_link.patch`, `disabled_features.patch`, `toolchain_type_alias.patch` (rules_d); `module_map_key.patch`, `toolchain_type_alias.patch` (rules_fortran); `reproducible.patch`, `fsharp_signature.patch`, `nuget_group_prefix.patch`, `sdk_versions.patch`, `canonical_labels.patch`, `toolchains_gate.patch`, `launcher_args.patch`, `target_runtime.patch`, `fsharp_pdb_path.patch` (rules_dotnet); `coverage_wrapper_no_report.patch`, `hermetic_haskell.patch`, `cabal_rules.patch`, `cabal_mingw_transition.patch`, `cc_wrapper_relpath_mount.patch`, `ghc_wrapper_runfiles_env.patch`, `cc_toolchain_config_info.patch`, `cabal_llvm_ar.patch`, `cc_wrapper_darwin_ffi.patch`, `cabal_binary_dep_data.patch`, `cabal_static_exe.patch`, `cabal_ghcversion_relpath.patch`, `cc_wrapper_origin_rpath.patch`, `ghc_xcode_env.patch`, `llvm_backend.patch`, `toolchain_type_alias.patch`, `cabal_windows_relocatable.patch` (rules_haskell); `elixir_app_deps.patch`, `elixir_app_name.patch`, `relocatable_tree.patch`, `warnings_as_errors.patch`, `windows_ex_unit_test.patch`, `toolchain_type_alias.patch`, `relative_beam_paths.patch` (rules_elixir); `01_xrl_yrl.patch`, `02_tcw_tags.patch`, `03_auto_sname.patch`, `04_otp_tree.patch`, `05_windows_eunit_cover.patch`, `06_coverage_enabled.patch`, `07_windows_ct_cover.patch`, `08_nif_profile_per_library.patch`, `toolchain_type_alias.patch` (rules_erlang); `config_base_toml.patch`, `in_process_resolve_test.patch`, `locate_installed_package.patch`, `package_annotation_version.patch`, `entry.patch`, `portable_cpu_target.patch`, `template_action_input.patch`, `exec_toolchain.patch`, `inline_runfiles_sh.patch`, `test_tmpdir_runfiles.patch`, `julia_1_13.patch`, `stable_precompile_paths.patch`, `fixed_heap_addresses.patch`, `stable_sysimage_paths.patch` (rules_julia); `empty_glob.patch`, `hermetic_ocaml.patch`, `native_cc_env.patch`, `platform_alias.patch`, `static_cc_deps.patch`, `toolchain_type_alias.patch` (rules_ocaml); `inline_runfiles_sh.patch` (rules_powershell); `coverage.patch`, `rubyinstaller_archive.patch`, `toolchains_gate.patch`, `toolchains_hub.patch`, `windows_binary_rlocation.patch` (rules_ruby); `dx_bzl_srcs.patch`, `manifest_only_wrapper.patch`, `protobuf_repo_name.patch`, `toolchain_type_alias.patch` (rules_scala).

## julia

Expand Down
1 change: 1 addition & 0 deletions patches/rules_haskell/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ exports_files([
"ghc_xcode_env.patch",
"llvm_backend.patch",
"toolchain_type_alias.patch",
"cabal_windows_relocatable.patch",
])

real_source_target(
Expand Down
Loading
Loading