Skip to content

Conversation

@binary132
Copy link

Issue: #1117

The macOS stage1 Zig compiler should look in Zig's real absolute path
for the Zig stdlib, but os_self_exe_path looked in its relative path,
which caused a symlinked Zig to be unable to find the stdlib.

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

Verified

This commit was signed with the committer’s verified signature. The key has expired.
jbsolomon Bodie Solomon
Issue: ziglang#1117

The macOS stage1 Zig compiler should look in Zig's real absolute path
for the Zig stdlib, but os_self_exe_path looked in its relative path,
which caused a symlinked Zig to be unable to find the stdlib.

This patch fixes the issue by resolving the relative path to the real
path using _realpath()_ before copying to the output path.
@binary132
Copy link
Author

binary132 commented Jun 17, 2018

This implementation uses variable-length arrays, which are NOT in the ISO C++ standard, but are supported by clang and gcc, which is what macOS uses.

I'll tweak this to use the Buf struct from buffer.hpp to be more portable and idiomatic and reopen when it is ready.

@binary132 binary132 closed this Jun 18, 2018
@binary132
Copy link
Author

Reopened as #1128.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

None yet

2 participants