# Fix 1117: Use realpath in stage1 Darwin os_self_exe_path · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/e6b69151c0d30d2df95d1f92b65784eac7d186d9)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: e6b69151c0d30d2df95d1f92b65784eac7d186d9

Requested commit: e6b69151c0d30d2df95d1f92b65784eac7d186d9

Commit: e6b69151c0d30d2df95d1f92b65784eac7d186d9

Tree: e92630f1caed328d5e95347d5dcecb45949c0319

Author: Bodie Solomon

Committer: Bodie Solomon

## Message

```
Fix 1117: Use realpath in stage1 Darwin os_self_exe_path

Issue: https://github.com/ziglang/zig/issues/1117

The macOS stage1 Zig compiler should look in Zig's real absolute path
for the Zig stdlib, but os_self_exe_path looks in its path as returned
by _NSGetExecutablePath, which may be a symlink.  This means that a
symlinked Zig cannot find the Zig stdlib.

This patch fixes the issue by resolving the _NSGetExecutablePath result
to the real path using realpath() before copying the result to the
output path.

```

## Parents

- [d52ef95f77478582e5c479cc2bd0a4ecb5591933](https://git.cafe/gitcafe/zig/commit/d52ef95f77478582e5c479cc2bd0a4ecb5591933?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/e6b69151c0d30d2df95d1f92b65784eac7d186d9?format=markdown)
