Skip to content

Instantly share code, notes, and snippets.

@djungelorm
Last active April 13, 2016 21:41
Show Gist options
  • Save djungelorm/a880dbf2851f65aa51e4938f271d0074 to your computer and use it in GitHub Desktop.
Save djungelorm/a880dbf2851f65aa51e4938f271d0074 to your computer and use it in GitHub Desktop.
diff --git a/client/lua/BUILD b/client/lua/BUILD
index 305b24d..dcd5ebd 100644
--- a/client/lua/BUILD
+++ b/client/lua/BUILD
@@ -12,7 +12,7 @@ genrule(
name = 'zip',
srcs = [':rock'],
outs = ['krpc-lua-%s.zip' % version],
- cmd = 'ln -f -r -s "$<" "$@"',
+ cmd = 'ln -f -s "`pwd`/$<" "`pwd`/$@"',
output_to_bindir = True
)
diff --git a/client/python/BUILD b/client/python/BUILD
index 1da79f7..5574c3a 100644
--- a/client/python/BUILD
+++ b/client/python/BUILD
@@ -12,7 +12,7 @@ genrule(
name = 'python',
srcs = [':python-pypi'],
outs = ['krpc-python-%s.zip' % version],
- cmd = 'ln -f -r -s "$<" "$@"',
+ cmd = 'ln -f -s "`pwd`/$<" "`pwd`/$@"',
output_to_bindir = True,
visibility = ['//visibility:public']
)
diff --git a/tools/build/client_test.bzl b/tools/build/client_test.bzl
index c9d9035..d0d94ae 100644
--- a/tools/build/client_test.bzl
+++ b/tools/build/client_test.bzl
@@ -5,9 +5,9 @@ def _impl(ctx):
sub_commands = [
'mkdir -p `dirname test-executable.runfiles/%s`' % ctx.executable.test_executable.short_path,
- 'ln -f -r -s %s test-executable.runfiles/%s' % (ctx.executable.test_executable.short_path, ctx.executable.test_executable.short_path),
+ 'ln -f -s "`pwd`/%s" "`pwd`/test-executable.runfiles/%s"' % (ctx.executable.test_executable.short_path, ctx.executable.test_executable.short_path),
'mkdir -p `dirname server-executable.runfiles/%s`' % ctx.executable.server_executable.short_path,
- 'ln -f -r -s %s server-executable.runfiles/%s' % (ctx.executable.server_executable.short_path, ctx.executable.server_executable.short_path),
+ 'ln -f -s "`pwd`/%s" "`pwd`/server-executable.runfiles/%s"' % (ctx.executable.server_executable.short_path, ctx.executable.server_executable.short_path),
]
test_runfiles_dir = 'test-executable.runfiles/' + ctx.executable.test_executable.short_path + '.runfiles'
@@ -15,11 +15,11 @@ def _impl(ctx):
for f in test_executable_runfiles:
sub_commands.append('mkdir -p `dirname %s`' % (test_runfiles_dir + '/' + f.short_path))
- sub_commands.append('ln -f -r -s %s %s' % (f.short_path, test_runfiles_dir + '/' + f.short_path))
+ sub_commands.append('ln -f -s "`pwd`/%s" "`pwd`/%s"' % (f.short_path, test_runfiles_dir + '/' + f.short_path))
for f in server_executable_runfiles:
sub_commands.append('mkdir -p `dirname %s`' % (server_runfiles_dir + '/' + f.short_path))
- sub_commands.append('ln -f -r -s %s %s' % (f.short_path, server_runfiles_dir + '/' + f.short_path))
+ sub_commands.append('ln -f -s "`pwd`/%s" "`pwd`/%s"' % (f.short_path, server_runfiles_dir + '/' + f.short_path))
ports_file = 'ports/'+ctx.executable.test_executable.basename
diff --git a/tools/build/csharp.bzl b/tools/build/csharp.bzl
index 0fedd58..23f5863 100644
--- a/tools/build/csharp.bzl
+++ b/tools/build/csharp.bzl
@@ -9,7 +9,7 @@ def _ref_impl(ctx):
mnemonic = 'CSharpReference',
inputs = [input],
outputs = [output],
- command = 'ln -f -r -s %s %s' % (input.path, output.path)
+ command = 'ln -f -s "`pwd`/%s" "`pwd`/%s"' % (input.path, output.path)
)
return struct(
diff --git a/tools/build/lua.bzl b/tools/build/lua.bzl
index db7a86e..9e9cee3 100644
--- a/tools/build/lua.bzl
+++ b/tools/build/lua.bzl
@@ -37,7 +37,7 @@ def _rock_impl(ctx):
mnemonic = 'StageLuaRockFile',
inputs = [input],
outputs = [staging_file],
- command = 'ln -f -r -s %s %s' % (input.path, staging_file.path)
+ command = 'ln -f -s "`pwd`/%s" "`pwd`/%s"' % (input.path, staging_file.path)
)
staging_inputs.append(staging_file)
diff --git a/tools/build/pkg.bzl b/tools/build/pkg.bzl
index ab55806..9c62a93 100644
--- a/tools/build/pkg.bzl
+++ b/tools/build/pkg.bzl
@@ -27,7 +27,7 @@ def _stage_files_impl(ctx):
path = ctx.label.name + '/' + _apply_path_map(ctx.attr.path_map, src.short_path)
out = ctx.new_file(ctx.configuration.genfiles_dir, path)
- sub_commands = ['ln -f -r -s %s %s' % (src.path, out.path)]
+ sub_commands = ['ln -f -s "`pwd`/%s" "`pwd`/%s"' % (src.path, out.path)]
ctx.action(
mnemonic = 'StageFile',
diff --git a/tools/build/python.bzl b/tools/build/python.bzl
index d2638ec..bc5ee4f 100644
--- a/tools/build/python.bzl
+++ b/tools/build/python.bzl
@@ -49,7 +49,7 @@ def _sdist_impl(ctx):
mnemonic = 'PackageFile',
inputs = [input],
outputs = [staging_file],
- command = 'ln -f -r -s %s %s' % (input.path, staging_file.path)
+ command = 'ln -f -s "`pwd`/%s" "`pwd`/%s"' % (input.path, staging_file.path)
)
staging_inputs.append(staging_file)
diff --git a/tools/build/sphinx.bzl b/tools/build/sphinx.bzl
index 3f0e157..d27a8e3 100644
--- a/tools/build/sphinx.bzl
+++ b/tools/build/sphinx.bzl
@@ -12,7 +12,7 @@ def _get_src_dir(srcs, short_path=False):
def _add_runfile(sub_commands, path, runfile_path):
sub_commands.extend([
'mkdir -p `dirname %s`' % runfile_path,
- 'ln -f -r -s %s %s' % (path, runfile_path)
+ 'ln -f -s "`pwd`/%s" "`pwd`/%s"' % (path, runfile_path)
])
def _build_impl(ctx):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment