diff --git a/swiftpkg/internal/repository_files.bzl b/swiftpkg/internal/repository_files.bzl index bc75ea14c..acf93a313 100644 --- a/swiftpkg/internal/repository_files.bzl +++ b/swiftpkg/internal/repository_files.bzl @@ -280,7 +280,7 @@ def _file_type(repository_ctx, path): A `string` representing the file type for the path as returned by the `file` utility. """ - file_args = ["file", "--brief", path] + file_args = ["file", "--dereference", "--brief", path] exec_result = repository_ctx.execute(file_args, quiet = True) if exec_result.return_code != 0: fail("Failed to determine the file type for {path}. stderr:\n{stderr}".format( diff --git a/swiftpkg/tests/testutils.bzl b/swiftpkg/tests/testutils.bzl index 822a0b8ad..5e505f9b5 100644 --- a/swiftpkg/tests/testutils.bzl +++ b/swiftpkg/tests/testutils.bzl @@ -36,9 +36,9 @@ def _new_stub_repository_ctx( exec_result = _new_exec_result( stdout = "\n".join(results), ) - elif args_len == 3 and args[0] == "file" and args[1] == "--brief": - # Expected command: `file --brief path` - path = args[2] + elif args_len == 4 and args[0] == "file" and args[1] == "--dereference" and args[2] == "--brief": + # Expected command: `file --dereference --brief path` + path = args[3] results = file_type_results.get(path, "") exec_result = _new_exec_result(stdout = results) elif args_len == 3 and args[0] == "otool" and args[1] == "-l":