-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Really try dylib when compiling for Apple platforms #181
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure this is working?
What I can gather from the CC documentation is the following:
It seems like
/dev/null
wants to remain right behind it. Can you elaborate?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duh, that's obviously because I misplaced the argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would mean that this code probably never ran. Can you help me validate this, or share how you validated it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I did have the right patch originally, but I messed up something before I pushed, or something. It definitely worked. Anyways, here's how I checked: I added a panic at the beginning of
build_zlib()
. ThenPATH=/path/to/cctools/bin:$PATH TARGET_CFLAGS="isysroot /path/to/MacOSX14.2.sdk" CC=clang cargo build --target aarch64-apple-darwin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your help.
That works for me, but it does so both on
main
and on this PR, after adding a panic right at the beginning ofbuild_zlib()
.This was my invocation (on MacOS):
TARGET_CFLAGS="isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk" CC=clang cargo build --target aarch64-apple-darwin
, while noting that my SDK folder is empty, probably not downloaded. I also assume thatisysroot
is a magic value.My expectation would be that there is an invocation that panics on
main
to indicate it's picking up the bundled zlib, but won't panic here as proof that it will pickup the system library more reliably. For me this seems to happen no matter what.Does it panic for you on main but not on the branch? Is
PATH
important for specificcctools
? Isisysroot
magic or am I supposed to replace it - are these flags making all the difference?Thanks for bearing with me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe on a Mac I wouldn't be able to reproduce it then anyway?
I do have a linux VM I could use, but would probably missing all the setup thats's needed to cross-compile.
Just to be clear, I can just merge this but after having found that one flaw I'd like to have proof that it's actually doing what it advertises. As the interested parties surely have a way to reproduce the issue they have with
main
the lack of issue with the code in this branch, maybe some logs could be shared to workaround difficulties in me reproducing it locally?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, if you add a panic to build_zlib, it will fail to cargo build on mac on main.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That definitely doesn't happen for me :/. Here is my patch in case there is something I am missing.
This is the slightly adjusted command-line I have been using:
TARGET_CFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk" CC=clang cargo build --target aarch64-apple-darwin
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what I get on unpatched main:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It occurs to me that maybe you have pkg-config from brew?