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

[fontc] Only crater needs unique build file names #1062

Merged
merged 1 commit into from
Nov 14, 2024
Merged

[fontc] Only crater needs unique build file names #1062

merged 1 commit into from
Nov 14, 2024

Conversation

cmyr
Copy link
Member

@cmyr cmyr commented Nov 12, 2024

When running in the context of crater, gftools builder may be invoked multiple times in parallel, which can cause the generated ninja.build files to overwrite each other.

To fix this, I implemented a scheme where we generate a unique name for the generated build file, so that multiple could exist and be in use for the same project, at the same time.

These files can pile up, though; I had initially thought they were cleaned up by default, but that doesn't seem to be the case.

This patch makes it so we only use this new naming scheme if we're running for crater, and uses the old names otherwise.

It also makes it so we always set the cleanup flag if we're running for crater.

When running in the context of crater, gftools builder may be invoked
multiple times in parallel, which can cause the generated ninja.build
files to overwrite each other.

To fix this, I implemented a scheme where we generate a unique name for
the generated build file, so that multiple could exist and be in use for
the same project, at the same time.

These files can pile up, though; I had initially thought they were
cleaned up by default, but that doesn't seem to be the case.

This patch makes it so we only use this new naming scheme if we're
running for crater, and uses the old names otherwise.

It also makes it so we always set the cleanup flag if we're running for
crater.
if self.fontc_bin_path or self.simple_output_path:
# if we're running for fontc we want uniquely named build files,
# to ensure they don't collide
return f"build-{time.time_ns()}.ninja"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, why nanoseconds over something like a uuid?

@m4rc1e m4rc1e merged commit 48f7b83 into main Nov 14, 2024
11 checks passed
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