ERROR: /private/var/tmp/_bazel_ors/69a4269ef9a625e3cd84076e6996a3e0/external/com_google_protobuf/BUILD:354:1: C++ compilation of rule '@com_google_protobuf//:protoc' failed: I/O exception during sandboxed execution: xcrun failed with code 1.
This most likely indicates that SDK version [10.10] for platform [MacOSX] is unsupported for the target version of xcode.
Process exited with status 1
stdout: stderr: xcodebuild: error: SDK "macosx10.10" cannot be located.
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/b9ef5a9a-2a22-449f-977b-b8f593439cbf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Or,we encountered the same problem on Bazel's CI in the last days. Bazel does not correctly take the Xcode version or even the path of the Xcode installation into account when building the cache key. This results in cache poisoning and getting cache hits for artifacts built with a different Xcode version.The solution is to manually build an additional cache key that you put into every action's cache key. For example, you could add the OS version, the Xcode version, the path to Xcode and some other information that you feel makes a difference for your builds and then hash everything with SHA256.Now we have to put this SHA256 digest into every action's cache key. We first tried to solve this using the --host_platform_remote_properties_override flag in this way:--host_platform_remote_properties_override=properties:{name:"platform" value:"$CACHE_KEY"}or the other form:--host_platform_remote_properties_override=properties:{name:"cache-silo-key" value:"$CACHE_KEY"}We tried this, because we found a lot of examples inside docs and other people's wrappers inside Google that did this - but it turns out, this doesn't actually work. The semantics of the flag silently changed a few releases ago to no longer override anything (despite the flag still being called "[...]_override" ...) - it now only provides a default, however that seems to be mostly ignored and overridden by some automatic platform detection that Bazel does.
The "correct" way is thus to separate your cache into silos by using a prefix in the URL:--remote_http_cache=https://storage.googleapis.com/$BUCKET/$CACHE_KEY for GCSor--remote_http_cache=http://192.168.0.1/$CACHE_KEY for a local HTTP cacheNote though that bazel-remote currently does not support this - the prefix is silently ignored and the cache is not separated. We thus had to switch to using nginx for our local cache server for the Mac cluster, which can be configured to support this. I don't know about RBE and if it supports URL prefixing.Cc'ing @Jakob Buchgraber and @Eric Burnett for further ideas on how to solve this. Maybe there's a better way than using URL prefixes that I'm not aware of.
Jakob Buchgraber
Software Engineer
Google Germany GmbH
Erika-Mann-Straße 33
80636 München
Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde.
This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.
We have a team of ~ 100 developers sharing the same remote cache (read/write).Each of us is using Mac but we don't force same OS version / xcode version policy.Recently I got the following error:
ERROR: /private/var/tmp/_bazel_ors/69a4269ef9a625e3cd84076e6996a3e0/external/com_google_protobuf/BUILD:354:1: C++ compilation of rule '@com_google_protobuf//:protoc' failed: I/O exception during sandboxed execution: xcrun failed with code 1.
This most likely indicates that SDK version [10.10] for platform [MacOSX] is unsupported for the target version of xcode.
Process exited with status 1
stdout: stderr: xcodebuild: error: SDK "macosx10.10" cannot be located.When I ran bazel clean and disabled the cache this problem was resolved.I think something is not hermetic in my builds around cpp / xcode but I'm not sure what.Two possible things that may solve it is:1. (preferred) Defining remote tools so that bazel would download them and use them instead of the OS built in tools (similar to remote JDK)
2. Making sure that the xcode version changes the cache key so two users using different xcode wouldn't share outputs.
How do you solve it in your place?
--
On Tue, Apr 23, 2019 at 9:46 AM Philipp Wollermann <phi...@google.com> wrote:I'm surprised this didn't work - it's true that the new semantics are to provide defaults only, but if you're using remote caching (rather than remote execution) I'd expect there to be no manually-specified remote execution properties in the default platform, and so these defaults would be used.
The "correct" way is thus to separate your cache into silos by using a prefix in the URL:--remote_http_cache=https://storage.googleapis.com/$BUCKET/$CACHE_KEY for GCSor--remote_http_cache=http://192.168.0.1/$CACHE_KEY for a local HTTP cacheNote though that bazel-remote currently does not support this - the prefix is silently ignored and the cache is not separated. We thus had to switch to using nginx for our local cache server for the Mac cluster, which can be configured to support this. I don't know about RBE and if it supports URL prefixing.Cc'ing @Jakob Buchgraber and @Eric Burnett for further ideas on how to solve this. Maybe there's a better way than using URL prefixes that I'm not aware of.I'm not sure why URL prefixes would be the "correct" way to solve this - bazel is in full control of the action keying, and so anything it could inject into the URL it should be able to inject into the key directly. If the current set of bazel flags aren't letting users express their keying easily enough, I'd prefer to fix the flags than to add another place to control it (and one that's independent of the Platform logic bazel is standardizing on).
bazel build --show_progress_rate_limit=5 --curses=yes --color=yes --verbose_failures --keep_going --jobs=36 --announce_rc --experimental_multi_threaded_digest --experimental_repository_cache_hardlinks --disk_cache= --sandbox_writable_path=/var/tmp/_bazel_buildkite/cache/repos/v1 --test_env=REPOSITORY_CACHE=/var/tmp/_bazel_buildkite/cache/repos/v1 --remote_timeout=60 --remote_max_connections=200 --remote_http_cache=http://100.107.67.248/6966eb210b1628bacfdbb6fb82c61b1232cc936558cdc383e90e715842c5672c --apple_platform_type=macos --noincompatible_strict_action_env //src:bazel //src:bazel_jdk_minimalDoes that mean we don't use any platform and thus it should work? Then why didn't it work?
On Tue, Apr 23, 2019 at 5:10 PM Eric Burnett <ericb...@google.com> wrote:On Tue, Apr 23, 2019 at 9:46 AM Philipp Wollermann <phi...@google.com> wrote:I'm surprised this didn't work - it's true that the new semantics are to provide defaults only, but if you're using remote caching (rather than remote execution) I'd expect there to be no manually-specified remote execution properties in the default platform, and so these defaults would be used.I don't know much about the platforms stuff in Bazel.We do have a few "platform(...)" definitions in Bazel's BUILD file: https://github.com/bazelbuild/bazel/blob/master/BUILD#L136And here's a call to register_execution_platforms(...): https://github.com/bazelbuild/bazel/blob/master/WORKSPACE#L465However, we don't set any flags that tell Bazel that it should use these platforms, for example here's a typical "Bazel presubmit on macOS" command line:bazel build --show_progress_rate_limit=5 --curses=yes --color=yes --verbose_failures --keep_going --jobs=36 --announce_rc --experimental_multi_threaded_digest --experimental_repository_cache_hardlinks --disk_cache= --sandbox_writable_path=/var/tmp/_bazel_buildkite/cache/repos/v1 --test_env=REPOSITORY_CACHE=/var/tmp/_bazel_buildkite/cache/repos/v1 --remote_timeout=60 --remote_max_connections=200 --remote_http_cache=http://100.107.67.248/6966eb210b1628bacfdbb6fb82c61b1232cc936558cdc383e90e715842c5672c --apple_platform_type=macos --noincompatible_strict_action_env //src:bazel //src:bazel_jdk_minimalDoes that mean we don't use any platform and thus it should work? Then why didn't it work?
The "correct" way is thus to separate your cache into silos by using a prefix in the URL:--remote_http_cache=https://storage.googleapis.com/$BUCKET/$CACHE_KEY for GCSor--remote_http_cache=http://192.168.0.1/$CACHE_KEY for a local HTTP cacheNote though that bazel-remote currently does not support this - the prefix is silently ignored and the cache is not separated. We thus had to switch to using nginx for our local cache server for the Mac cluster, which can be configured to support this. I don't know about RBE and if it supports URL prefixing.Cc'ing @Jakob Buchgraber and @Eric Burnett for further ideas on how to solve this. Maybe there's a better way than using URL prefixes that I'm not aware of.I'm not sure why URL prefixes would be the "correct" way to solve this - bazel is in full control of the action keying, and so anything it could inject into the URL it should be able to inject into the key directly. If the current set of bazel flags aren't letting users express their keying easily enough, I'd prefer to fix the flags than to add another place to control it (and one that's independent of the Platform logic bazel is standardizing on).Correct from an infrastructure perspective, not from a "this is how I always wanted Bazel to work" perspective:There was a flag that we were supposed to use for exactly this case, it stopped working and there is no clear, working replacement.Thus, on the infra side, we have to invent our own solution to this problem to deal with whatever bugs or unintuitive behavior Bazel has here.The current solution uses URL prefixes. It's not beautiful, but it works, until we figure out how to tell Bazel purely from the command-line that it should put these additional things into its action cache keys no matter what.
Cheers,Philipp
3) If the Bazel tests are calling "register_execution_platforms()" in the WORKSPACE (directly or in a macro), then execution platforms are being considered before the host platform. Any remote_execution_properties on those platforms will be used directly.
4) Using a separate execution platform per xcode version is probably not the right way to manage this: there's no way except directly editing the WORKSPACE (or by changing the "--extra_execution_platforms" flag) to change which execution platform is used. Instead, we should make sure that the xcode version is reflected in the action's command and/or inputs, so that changing the xcode version causes the action key to change.
Maybe it's just me but it somehow sounds to me that it's much too easy to mess Bazel up then I'd like it to be.
This is getting us into slow and mistaken.
Solving the apple rules is great, seeing if we can package their dependencies as external dependencies (like remotejdk) would probably be even better but I think that the question which troubles us is:
What is the principled answer? How can I know that all inputs are indeed declared? Otherwise I'm at risk.
"Bazel tests are calling "register_execution_platforms()" in the WORKSPACE":
How can tests "call" something in the WORKSPACE file?
From my point of view, there's this line in our WORKSPACE file: https://github.com/bazelbuild/bazel/blob/master/WORKSPACE#L465
Which - to me - looks like that register_execution_platforms thing is always called (because it's in the WORKSPACE file without any logic surrounding it!).
Does that mean it's always in effect? Does that mean we now "have a platform" (as opposed to that state where we "don't have a platform" and thus the --remote_default_platform_properties flag takes effect) when I just run "bazel build" without any remote execution?
"execution platforms are being considered before the host platform":
What does "a platform is being considered before the host platform" mean?
"remote_execution_properties on those platforms will be used directly":
What does "used directly" mean?
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/CA%2BAhZoicih8tWLqEKy%2BJ1QGshN_epj-Vp9zt4KwZLxZnGLBhEg%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/736c53b9-ac63-48e5-ae74-345359d790d8%40googlegroups.com.