Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Base stamping decisions on --stamp configuration, not attributes on t… #1878

Merged
merged 1 commit into from Nov 26, 2021

Conversation

alexeagle
Copy link
Collaborator

…he rule

This follows the example of rules_go and rules_nodejs.

It means we don't produce cache-busting outputs unless the user
explicitly requests non-deteriminism in the build with --stamp.

BREAKING CHANGE:

  • To get stamped outputs, users must now call bazel with --stamp
  • the stamp attribute was removed from some providers
  • the stamp attribute was deprecated on container_push and container_bundle, it is now removed
  • the stamp attribute was removed from container_image, there is no
    replacement

Fixes #1451

@google-cla google-cla bot added the cla: yes label Jun 2, 2021
Copy link
Collaborator

@gravypod gravypod left a comment

Choose a reason for hiding this comment

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

Could we add an update to README.md that explains this behavior?

@alexeagle alexeagle force-pushed the stamping branch 7 times, most recently from e9ff310 to 4ccc7a5 Compare June 4, 2021 13:59
@alexeagle alexeagle marked this pull request as ready for review June 4, 2021 14:02
Copy link
Collaborator

@gravypod gravypod left a comment

Choose a reason for hiding this comment

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

I think this is good but as we discussed we should wait for a major version change whenever we're ready.

The first option is to use stamping. Stamping is enabled when a supported
attribute contains a python format placeholder (e.g. `{BUILD_USER}`).
The first option is to use stamping.
Stamping is enabled when bazel is run with `--stamp`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can this be configured with .bazelrc? I know some users want to always stamp containers so showing them an easy to use setup to make that always happen is probably a good idea.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated this to still have a stamp attribute on our three stamp-aware rules, and that attribute is now a trinary. So you can still use stamp=always behavior like before.

@alexeagle
Copy link
Collaborator Author

Okay so what's our cadence for major releases?
Since we haven't released a 1.0 semver dictates that breaking changes are in every minor. So we don't have a way to signal this beyond either just a 0.18.0 including this change.
I think we should have a 1.0. Could discuss doing that now? holding this change for that doesn't make a difference for semver though

@gravypod
Copy link
Collaborator

gravypod commented Jun 5, 2021 via email

@alexeagle
Copy link
Collaborator Author

If we do 1.0 we need to say what that means and how we'll version in the future. Can discuss at our meeting Monday but I'll have to duck out early due to conflict

This follows the example of rules_go and rules_nodejs.

It means we don't produce cache-busting outputs unless the user
explicitly requests non-deteriminism in the build with --stamp.

BREAKING CHANGE:
- To get stamped outputs, users must now call bazel with `--stamp`
- the stamp attribute is removed from some providers
- the stamp attribute is now trinary

Fixes bazelbuild#1451
@alexeagle
Copy link
Collaborator Author

fyi @aptenodytes-forsteri rebased and landable.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

stamping results in different digest with remote cache
2 participants