Skip to content

Commit

Permalink
Merge pull request #67 from dajmaki/cc-toolchain-follow-symlinks
Browse files Browse the repository at this point in the history
Follow symlinks of tools in nixpkgs_cc_configure
  • Loading branch information
mboes committed Jan 29, 2019
2 parents 364adc7 + bcb685d commit 58dd6bc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nixpkgs/nixpkgs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ def nixpkgs_package(*args, **kwargs):
else:
_nixpkgs_package(*args, **kwargs)

def _readlink(repository_ctx, path):
return _execute_or_fail(
repository_ctx, ["readlink", path],
).stdout.rstrip()

def nixpkgs_cc_autoconf_impl(repository_ctx):
cpu_value = get_cpu_value(repository_ctx)
if not _is_supported_platform(repository_ctx):
Expand All @@ -222,7 +227,7 @@ def nixpkgs_cc_autoconf_impl(repository_ctx):
# the Bazel autoconfiguration with the tools we found.
bin_contents = _find_children(repository_ctx, workspace_root + "/bin")
overriden_tools = {
tool: entry
tool: _readlink(repository_ctx, entry)
for entry in bin_contents
for tool in [entry.rpartition("/")[-1]] # Compute basename
}
Expand Down

0 comments on commit 58dd6bc

Please sign in to comment.