I am trying to use the zip crate. When I try to build after repinning and adding this dependency I get this error:
https://gist.github.com/johnynek/c53ea36910352d607eb6bf19612db3d9
Note, it has portions like:
CMAKE_TOOLCHAIN_FILE_aarch64-apple-darwin = None
CMAKE_TOOLCHAIN_FILE_aarch64_apple_darwin = None
HOST_CMAKE_TOOLCHAIN_FILE = None
CMAKE_TOOLCHAIN_FILE = None
CMAKE_GENERATOR_aarch64-apple-darwin = None
CMAKE_GENERATOR_aarch64_apple_darwin = None
HOST_CMAKE_GENERATOR = None
CMAKE_GENERATOR = None
cargo:warning=xcrun: error: unable to lookup item 'PlatformVersion' from command line tools installation
cargo:warning=xcrun: error: unable to lookup item 'PlatformVersion' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'
cargo:warning=xcrun: error: unable to lookup item 'PlatformVersion' from command line tools installation
cargo:warning=xcrun: error: unable to lookup item 'PlatformVersion' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'
cargo:warning=xcrun: error: unable to lookup item 'PlatformVersion' from command line tools installation
cargo:warning=xcrun: error: unable to lookup item 'PlatformVersion' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'
CMAKE_PREFIX_PATH_aarch64-apple-darwin = None
CMAKE_PREFIX_PATH_aarch64_apple_darwin = None
HOST_CMAKE_PREFIX_PATH = None
CMAKE_PREFIX_PATH = None
CMAKE_aarch64-apple-darwin = None
CMAKE_aarch64_apple_darwin = None
HOST_CMAKE = None
CMAKE = None
So it seems to be saying that it can't find cmake. That makes sense, I didn't have cmake installed. But then I did brew install cmake and get the exact same error.
Finally I did:
sudo ln -s /opt/homebrew/bin/cmake /usr/local/bin/
and then reran the bazel build and it worked.
So, it seems that bazel rejects the cmake which is on my PATH in homebrew, but if I force it to also be in /usr/local/bin it works.
There are evidently two issues here:
- rules_rust isn't actually hermetic and is reaching out in the system to find some tools, such as cmake.
- it only reaches into certain places, not the user's path, which one might expect.
Could we have some way to declare the path to cmake in rules_rust setup or otherwise have a hermetic cmake toolchain? I don't think using the zip crate would be terribly esoteric.
I am trying to use the zip crate. When I try to build after repinning and adding this dependency I get this error:
https://gist.github.com/johnynek/c53ea36910352d607eb6bf19612db3d9
Note, it has portions like:
So it seems to be saying that it can't find cmake. That makes sense, I didn't have cmake installed. But then I did
brew install cmakeand get the exact same error.Finally I did:
and then reran the
bazel buildand it worked.So, it seems that bazel rejects the
cmakewhich is on my PATH in homebrew, but if I force it to also be in /usr/local/bin it works.There are evidently two issues here:
Could we have some way to declare the path to cmake in rules_rust setup or otherwise have a hermetic cmake toolchain? I don't think using the zip crate would be terribly esoteric.