Skip to content

Commit

Permalink
OSX fixes: 6l -s, tell asciidoc which Python to use and where dot is at.
Browse files Browse the repository at this point in the history
Summary:
On OS X, asciidoc fails to find the executable of the
Python interpreter, leading it to try and execute the
empty string. We can fix this by overriding the
autodetected interpreter with an attribute.

The environment Bazel runs builds in does not include
the path for graphviz on OS X. This CL adds logic to
configure this in setup_bazel.sh.

Finally, there's a Go issue on OS X that we're hitting.
(golang/go#10254). Stop hitting it.

Reviewers: shahms, fromberger, schroederc

Reviewed By: schroederc

Differential Revision: https://phabricator-dot-kythe-repo.appspot.com/D319
  • Loading branch information
zrlk committed Jun 4, 2015
1 parent 5cd4906 commit 2406989
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions tools/build_rules/doc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def asciidoc(name, src, attrs={}, confs=[], data=[], tools=[], tags=None):
'export BINDIR="$$PWD/bazel-out/host/bin"',
'export OUTDIR="$$PWD/$(@D)"',
'export LOGFILE="$$(mktemp -t \"XXXXXXasciidoc\")"',
'export PATH',
'trap "rm \"$${LOGFILE}\"" EXIT ERR INT',
"asciidoc %s -o $(@) $(location %s) 2> \"$${LOGFILE}\"" % (' '.join(args), src),
'cat $${LOGFILE}',
Expand Down
17 changes: 16 additions & 1 deletion tools/build_rules/go.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ link_args = {
"dbg": ["-race"],
}

link_args_darwin = {
# https://github.com/golang/go/issues/10254
"opt": [
"-w",
],
"fastbuild": [
"-w",
],
"dbg": ["-race"],
}

def go_compile(ctx, pkg, srcs, archive, setupGOPATH=False, extra_archives=[]):
gotool = ctx.file._go

Expand Down Expand Up @@ -82,7 +93,11 @@ def link_binary(ctx, binary, archive, recursive_deps):
for a in recursive_deps + [archive]:
include_paths += "-L \"" + a.path + "_gopath\" "

args = link_args[ctx.var['COMPILATION_MODE']]
if str(ctx.configuration).find('darwin') >= 0:
args = link_args_darwin[ctx.var['COMPILATION_MODE']]
else:
args = link_args[ctx.var['COMPILATION_MODE']]

cmd = (
"set -e;" +
"export PATH;" +
Expand Down

0 comments on commit 2406989

Please sign in to comment.