From 63ef45783fd34f9fe3c6fc61a6b68e0d4493b02d Mon Sep 17 00:00:00 2001 From: Andreas Herrmann Date: Thu, 31 Jan 2019 15:24:41 +0100 Subject: [PATCH] Replace readlink by builtin realpath 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. --- nixpkgs/nixpkgs.bzl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixpkgs/nixpkgs.bzl b/nixpkgs/nixpkgs.bzl index eb1d6fad..5f460f77 100644 --- a/nixpkgs/nixpkgs.bzl +++ b/nixpkgs/nixpkgs.bzl @@ -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)