Skip to content

Commit

Permalink
Replace readlink by builtin realpath
Browse files Browse the repository at this point in the history
readlink is not available or behaves differently on MacOS, so that
`_readlink` fails on MacOS.

This change instead uses the `realpath` attribute on `path` objects,
which also resolves all symlinks.
  • Loading branch information
aherrmann committed Jan 31, 2019
1 parent 58dd6bc commit 63ef457
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions nixpkgs/nixpkgs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,7 @@ def nixpkgs_package(*args, **kwargs):
_nixpkgs_package(*args, **kwargs)

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

def nixpkgs_cc_autoconf_impl(repository_ctx):
cpu_value = get_cpu_value(repository_ctx)
Expand Down

0 comments on commit 63ef457

Please sign in to comment.