@@ -55,14 +55,18 @@ def _get_xcode_location_cflags(rctx):
5555 # This is a full xcode installation somewhere like /Applications/Xcode13.0.app/Contents/Developer
5656 # so we need to change the path to to the macos specific tools which are in a different relative
5757 # path than xcode installed command line tools.
58- xcode_sdks_json = rctx .execute ([
59- "xcrun" ,
60- "xcodebuild" ,
61- "-showsdks" ,
62- "-json" ,
63- ], environment = {
64- "DEVELOPER_DIR" : xcode_root ,
65- }).stdout
58+ xcode_sdks_json = repo_utils .execute_checked (
59+ rctx ,
60+ op = "LocateXCodeSDKs" ,
61+ arguments = [
62+ repo_utils .which_checked (rctx , "xcrun" ),
63+ "xcodebuild" ,
64+ "-showsdks" ,
65+ "-json" ,
66+ ],
67+ environment = {
68+ "DEVELOPER_DIR" : xcode_root ,
69+ }).stdout
6670 xcode_sdks = json .decode (xcode_sdks_json )
6771 potential_sdks = [
6872 sdk
@@ -190,8 +194,9 @@ def _create_repository_execution_environment(rctx, python_interpreter, logger =
190194 # Gather any available CPPFLAGS values
191195 #
192196 # We may want to build in an environment without a cc toolchain.
193- # In those cases, we're limited to --donwload-only, but we should respect that here.
194- if not rctx .attr .download_only :
197+ # In those cases, we're limited to --download-only, but we should respect that here.
198+ is_wheel = rctx .attr .filename and rctx .attr .filename .endswith (".whl" )
199+ if not (rctx .attr .download_only or is_wheel ):
195200 cppflags = []
196201 cppflags .extend (_get_xcode_location_cflags (rctx ))
197202 cppflags .extend (_get_toolchain_unix_cflags (rctx , python_interpreter ))
0 commit comments