Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the rust_no_allocation backend deterministic #85

Merged
merged 1 commit into from
Nov 11, 2023

Conversation

Colecf
Copy link
Contributor

@Colecf Colecf commented Nov 10, 2023

Having non-deterministic generated sources means that incremental builds would have extra recompilations.

Also pretty-print the generated code.

The non-determinism was discovered in some android modules like bluetooth_core_rust_packets

Having non-deterministic generated sources means that incremental
builds would have extra recompilations.

Also pretty-print the generated code.
@Colecf Colecf force-pushed the deterministic_rust_generation branch from d9c2ac4 to 2802478 Compare November 10, 2023 23:30
@hchataing hchataing merged commit d3ab8fd into google:main Nov 11, 2023
6 checks passed
@Colecf Colecf deleted the deterministic_rust_generation branch November 11, 2023 00:15
jrguzman-ms pushed a commit to msft-mirror-aosp/platform.build.soong that referenced this pull request Nov 11, 2023
These genrules work with sandboxing already, they just had
non-determinism that lead genrule_sandboxing.py to think that they
didn't.

Non-determinism sources include:
 - HeadlessBuildTimestamp literally just generates a header file with
   a timestamp, not much we can do here other than re-architect their
   code.
 - Pdlc has a non-determinism issue I sent out a cl to fix:
   google/pdl#85
 - Python tools write the command they were ran with to generated files,
   and non-embedded-launcher python scripts have non-deterministic
   paths. Switched to embedded_launcher: true: aosp/2825231
     - In addition, the path to the genrule sandbox is not
       non-deterministic, but it is a hash of the inputs to the sandbox.
       When running genrule_sandbox.py, it compares a "partial" sandbox
       (which only sandboxes tools) to a "full" sandbox, and these two
       runs have different sandbox hashes.

Bug: 307824623
Test: Presubmits
Change-Id: Ib966262dc1aac99a0798f26d8a03966cc97fe1bf
pure-soul-kk pushed a commit to Project-Elixir/build_soong that referenced this pull request Mar 15, 2024
These genrules work with sandboxing already, they just had
non-determinism that lead genrule_sandboxing.py to think that they
didn't.

Non-determinism sources include:
 - HeadlessBuildTimestamp literally just generates a header file with
   a timestamp, not much we can do here other than re-architect their
   code.
 - Pdlc has a non-determinism issue I sent out a cl to fix:
   google/pdl#85
 - Python tools write the command they were ran with to generated files,
   and non-embedded-launcher python scripts have non-deterministic
   paths. Switched to embedded_launcher: true: aosp/2825231
     - In addition, the path to the genrule sandbox is not
       non-deterministic, but it is a hash of the inputs to the sandbox.
       When running genrule_sandbox.py, it compares a "partial" sandbox
       (which only sandboxes tools) to a "full" sandbox, and these two
       runs have different sandbox hashes.

Bug: 307824623
Test: Presubmits
Change-Id: Ib966262dc1aac99a0798f26d8a03966cc97fe1bf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants