You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using ReClient (https://github.com/bazelbuild/reclient) as the client and an RBE Service that supports RE API v2.1 or higher for Android RBE builds. During the build process, I encountered an issue where OutputFiles were unexpectedly modified. While debugging, I identified that this issue was caused by a shallow copy resulting from the use of append() in the Command#ToREProto() function in the remote-apis-sdk. Since Go's append can result in a shallow copy depending on the slice's capacity, shouldn't it be explicitly modified to ensure a deep copy?
I believe modifying the remote-apis-sdk code is a more appropriate solution to this issue than addressing it in ReClient, so I made adjustments to the SDK code. Below is the modification I tested.
Good catch. The conversion must produce a deep clone. I'd allocate a properly sized slice before filling it up from both sources to avoid potential resizes. Please feel free to post a PR for the remote-apis-sdks.
I am using ReClient (https://github.com/bazelbuild/reclient) as the client and an RBE Service that supports RE API v2.1 or higher for Android RBE builds. During the build process, I encountered an issue where OutputFiles were unexpectedly modified. While debugging, I identified that this issue was caused by a shallow copy resulting from the use of append() in the Command#ToREProto() function in the remote-apis-sdk. Since Go's append can result in a shallow copy depending on the slice's capacity, shouldn't it be explicitly modified to ensure a deep copy?
I believe modifying the remote-apis-sdk code is a more appropriate solution to this issue than addressing it in ReClient, so I made adjustments to the SDK code. Below is the modification I tested.
There are many ways to address this issue, but this is how I resolved it: https://github.com/bazelbuild/remote-apis-sdks/blob/master/go/pkg/command/command.go#L600
The text was updated successfully, but these errors were encountered: