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

Refactors output_field to default to something that disambiguates on paramtrized fields #16232

Merged

Conversation

chrisjrn
Copy link
Contributor

Resolves #16189

@chrisjrn chrisjrn added the category:bugfix Bug fixes for released features label Jul 19, 2022
@chrisjrn chrisjrn requested a review from stuhood July 19, 2022 22:16
@chrisjrn chrisjrn marked this pull request as ready for review July 19, 2022 22:17
@chrisjrn
Copy link
Contributor Author

A cursory glance didn't show anywhere to test the packaging behaviour for regression (golang's package_binary_integration_test.py might work, if it's not too noisymaking)

…n parametrized fields

[ci skip-rust]

[ci skip-build-wheels]
@chrisjrn chrisjrn force-pushed the chrisjrn/16189-whoops-colliding-packages branch from 1642771 to 0cd8573 Compare July 20, 2022 15:27
f"{sanitize(k)}={sanitize(v)}" for k, v in self.parameters.items()
)
params = f"@@{key_value_strs}"
params = f"@{sanitize(self.parameters_repr)}"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is unrelated to the refactor, but it does make path_safe_spec slightly easier to read

Copy link
Contributor

Choose a reason for hiding this comment

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

Does it change the actual value? Or solely code factoring? If it changes behavior, it would be better as a dedicated change.

# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
Copy link
Contributor

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

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

Thanks!

f"{sanitize(k)}={sanitize(v)}" for k, v in self.parameters.items()
)
params = f"@@{key_value_strs}"
params = f"@{sanitize(self.parameters_repr)}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it change the actual value? Or solely code factoring? If it changes behavior, it would be better as a dedicated change.

@chrisjrn
Copy link
Contributor Author

@Eric-Arellano

Does it change the actual value? Or solely code factoring? If it changes behavior, it would be better as a dedicated change.

It doesn't change the actual value, just how it's calculated.

@@ -72,11 +72,14 @@ class OutputPathField(StringField, AsyncFieldMixin):
def value_or_default(self, *, file_ending: str | None) -> str:
Copy link
Contributor

Choose a reason for hiding this comment

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

Re testing: this would be good to unit test in a new file package_test.py. We shouldn't have done that for a long time, bad on us

@chrisjrn
Copy link
Contributor Author

Created #16247 as future work to address lack of unit tests

@chrisjrn chrisjrn merged commit 28d7af5 into pantsbuild:main Jul 20, 2022
@chrisjrn chrisjrn deleted the chrisjrn/16189-whoops-colliding-packages branch July 20, 2022 16:56
chrisjrn pushed a commit to chrisjrn/pants that referenced this pull request Jul 20, 2022
…mbiguates on parametrized fields (pantsbuild#16232)

(cherry picked from commit 28d7af5)

# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]
chrisjrn pushed a commit that referenced this pull request Jul 20, 2022
…mbiguates on parametrized fields (cherry-pick of #16232) (#16248)
stuhood pushed a commit to stuhood/pants that referenced this pull request Jul 20, 2022
…mbiguates on parametrized fields (pantsbuild#16232)

# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
stuhood added a commit that referenced this pull request Jul 20, 2022
…n paramtrized fields (Cherry-pick of #16232) (#16254)

Resolves #16189

[ci skip-rust]
[ci skip-build-wheels]

Co-authored-by: Christopher Neugebauer <chrisjrn@toolchain.com>
jyggen pushed a commit to jyggen/pants that referenced this pull request Jul 27, 2022
…mbiguates on parametrized fields (pantsbuild#16232)

# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:bugfix Bug fixes for released features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parametrized binary targets collide when packaged simultaneously
2 participants