KhronosGroup / Vulkan-ValidationLayers

Vulkan Validation Layers (VVL)
https://vulkan.lunarg.com/doc/sdk/latest/linux/khronos_validation_layer.html
Other
748 stars 400 forks source link

BUILD.gn "vulkan_clean_old_validation_layer_objects" removing files unrelated to VVL #8238

Closed romanl-g closed 2 months ago

romanl-g commented 2 months ago

action("vulkan_clean_old_validation_layer_objects")

is nuking files by glob which can match files unrelated to VVL

https://github.com/KhronosGroup/Vulkan-ValidationLayers/blob/e0f6324b75b14466dea699ba4979cfe2096ee5e9/BUILD.gn#L40-L42

This is creating a race condition between build rules resulting in flaky build failures in ANGLE: https://g-issues.angleproject.org/issues/350816748#comment5

@mark-lunarg

romanl-g commented 2 months ago

In our specific case, the files going missing are libVkLayer_lunarg_api_dump.so and VkLayer_lunarg_api_dump.json after their generation got enabled by https://crrev.com/c/5649937

But removing files by glob looks like a risky idea in general.. Seems like this is some old cleanup code - can it be removed altogether?

mark-lunarg commented 2 months ago

I too think it should be possible to remove it altogether, and will take a look tomorrow when this high-temperature national holiday is over.

spencer-lunarg commented 2 months ago

@romanl-g if things are still not working let us know!

romanl-g commented 2 months ago

thanks, this should resolve the issue!

romanl-g commented 2 months ago

Oops, this led to an issue due to now unused var:

https://github.com/KhronosGroup/Vulkan-ValidationLayers/pull/8242/commits/12048d7d846e9020a11feb8650587f6898414d50#r1668658950

romanl-g commented 2 months ago

hmm looks like the link is not working

/b/s/w/ir/cache/builder/angle/buildtools/linux64/gn gen /b/s/w/ir/cache/builder/angle/out/Release --check
  -> returned 1
ERROR at //third_party/vulkan-validation-layers/src/BUILD.gn:23:19: Assignment had no effect.
vulkan_data_dir = "$root_out_dir/$vulkan_data_subdir"
                  ^----------------------------------
You set the variable "vulkan_data_dir" here and it was unused before it went
out of scope.