Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emit_size() rule in rules/shell_command/rules.bzl fails on macOS #103

Closed
laszlocsomor opened this issue Jul 15, 2019 · 1 comment · Fixed by #104
Closed

emit_size() rule in rules/shell_command/rules.bzl fails on macOS #103

laszlocsomor opened this issue Jul 15, 2019 · 1 comment · Fixed by #104

Comments

@laszlocsomor
Copy link
Contributor

https://buildkite.com/bazel/bazel-bazel-examples/builds/54#d3ab95d6-7c36-473b-a4ea-935ccd30e105

(02:04:43) ERROR: /Users/buildkite/builds/bk-imacpro-13/bazel/bazel-bazel-examples/rules/shell_command/BUILD:10:1: Couldn't build file shell_command/foo.size: error executing shell command: '/bin/bash -c stat -L -c%s 'shell_command/foo.txt' > 'bazel-out/darwin-fastbuild/bin/shell_command/foo.size'' failed (Exit 1) bash failed: error executing command
--
  | (cd /private/var/tmp/_bazel_buildkite/498b38e3f668fa53ddf838edc27b273f/sandbox/darwin-sandbox/7/execroot/__main__ && \
  | exec env - \
  | /bin/bash -c 'stat -L -c%s '\''shell_command/foo.txt'\'' > '\''bazel-out/darwin-fastbuild/bin/shell_command/foo.size'\''')
  | Execution platform: @bazel_tools//platforms:host_platform
  |  
  | Use --sandbox_debug to see verbose messages from the sandbox
  | stat: illegal option -- c
  | usage: stat [-FlLnqrsx] [-f format] [-t timefmt] [file ...]

The rule executes stat -L -c%s <path> but -c is not supported on macOS.

@laszlocsomor
Copy link
Contributor Author

laszlocsomor commented Jul 15, 2019

stat -L -f%z <path> is the right incantation

laszlocsomor added a commit to laszlocsomor/examples that referenced this issue Jul 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant