Skip to content

Commit

Permalink
Ensure that packages are invalidated any time package or build langua…
Browse files Browse the repository at this point in the history
…ge options are changed.

This prevents issues where incomplete skyframe nodes are still cached when
tests change state.

Work towards platform-based flags: #19409.

PiperOrigin-RevId: 641037026
Change-Id: Ibb2ba4b1413b516d2f2214244d3f536fb5583ca7
  • Loading branch information
katre authored and Copybara-Service committed Jun 6, 2024
1 parent 84e0304 commit 08ef9b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -525,11 +525,13 @@ private void setUpSkyframe() {
protected void setPackageOptions(String... options) throws Exception {
packageOptions = parsePackageOptions(options);
setUpSkyframe();
invalidatePackages(/* alsoConfigs= */ false);
}

protected void setBuildLanguageOptions(String... options) throws Exception {
buildLanguageOptions = parseBuildLanguageOptions(options);
setUpSkyframe();
invalidatePackages(/* alsoConfigs= */ false);
}

private static PackageOptions parsePackageOptions(String... options) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3473,7 +3473,6 @@ public void testLicenseType() throws Exception {
// (See --incompatible_no_attr_license). However, this verifies that until the attribute
// is removed, values of the attribute are a valid Starlark type.
setBuildLanguageOptions("--incompatible_no_attr_license=false");
invalidatePackages();
scratch.file(
"test/rule.bzl",
"""
Expand Down

0 comments on commit 08ef9b2

Please sign in to comment.