[dotnet] [build] Support deterministic build output#17497
Conversation
Review Summary by QodoSupport deterministic build output via pathmap normalization
WalkthroughsDescription• Add /pathmap compiler option to normalize Bazel sandbox paths • Enable byte-for-byte reproducible deterministic builds • Map execution root to stable prefix for environment-agnostic compilation Diagramflowchart LR
A["Bazel Execution Root Path"] -- "Extract and normalize" --> B["Stable Prefix Mapping"]
B -- "Apply /pathmap option" --> C["Deterministic Build Output"]
D["Compiler Options"] -- "Add pathmap" --> C
File Changes1. dotnet/private/sourcelink.bzl
|
Code Review by Qodo
1.
|
|
Persistent review updated to latest commit 2a92102 |
* origin/trunk: (97 commits) [py] update python dependencies (SeleniumHQ#17490) [build] fix renovate reported issues with configuration [build] remove base-ref from renovate workflows it does not work for the use case I had for them [build] add renovate dependency workflow (SeleniumHQ#17504) [build] simplify commit-changes workflow (SeleniumHQ#17503) [build] clarify dependency pin and update tasks (SeleniumHQ#17463) [build] do not rerun or attempt to upload logs unless workflow failure is from the Bazel step [build] fix renovate ignore rules_python to v2 until upstream fixed [build] renovate ignore rules_python until upstream fixed [build] bump rules_closure version (SeleniumHQ#17500) [build] bump rules_jvm_external (SeleniumHQ#17501) [js] remove npm dependency by using bazel for everything (SeleniumHQ#17499) [build] bump ruby versions to latest patch releases (SeleniumHQ#17496) [dotnet] [build] Support deterministic build output (SeleniumHQ#17497) [build] remove renovate update requests pending work done in SeleniumHQ#17427 (SeleniumHQ#17498) [dotnet] [build] Fix remote linkage in SourceLink (SeleniumHQ#17495) [rust] update reqwest to 0.13 (SeleniumHQ#17488) [build] bump low-risk Bazel module dependencies (SeleniumHQ#17494) [dotnet] run format against slnx instead of looping csproj (SeleniumHQ#17483) [build] ignore renovate.json references in renovate recommendations ... # Conflicts: # MODULE.bazel # rust/BUILD.bazel
Currently builds are not deterministic, regardless default
/deterministic+compiler flag. This is because bazel sandbox directory path. In normaldotnet build(SDK 8+ if I am not wrong), SDK determines CI environment automatically and normalizes input paths to be some neutral, environment agnostic.This PR mimics the behavior.
💥 What does this PR do?
Use
/pathmapcompiler option.🤖 AI assistance
💡 Additional Considerations
Should be default behavior in
rules_dotnet.🔄 Types of changes