-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
os: opening/locating/copying system libraries is broken in macOS Big Sur beta #39832
Comments
I'm a bit confused as to what this implies. Does the Go toolchain not work? Do Go binaries not work? What about shared libraries and plugins? |
Note that this problem is listed as a "known issue" of the beta, not as an intended feature. Maybe it will be fixed. |
@randall77 Well what works is basically everything in Golang, however, yeah the os.Open("/usr/lib/libsystem.dylib"), is basically broken, I tested in C and yes the same happens unless I do dlopen(), that is Apple's new behavior, while the issue only affects systems libraries, means that without a workaround opening/copying default libraries on macOS will no longer work (in Go or other stuff that doesn't do a workaround) |
If Go programs generally work, but they fail in exactly the ways that C programs fail, then I don't think there is anything we should or even can change in the Go project. |
any updates on this? |
@seiflotfy If there are updates, they will be posted here. |
There is a solution for this, and it is dumping the libraries, the tool is provided by Apple but not by default on macOS, I have the tool on my brew repository. is dyld_shared_cache_util you can read more online |
Still not an ideal solution, and I dont have the knowledge if we can interact with the cache, the cache is located at |
@DiegoMagdaleno could you step back a second and explain what not being able to open a system library is preventing you from doing? That would help @randall77 identify the answer to his question, #39832 (comment) |
@davecheney I have a tool that makes Chroots, so this means, for example, binaries depend on libs they are linked to. Here is an example.
As you can see this are linked to /usr/lib that are system libraries on macOS, however, when you try to copy them it is gonna fail saying there is no such file or directory. I am trying to copy them from dir A to dir B |
Is this a limitation of Go or are other utils like cp, rsync, or install also affected? |
Other utilities also appear to be affected. When I opened this issue this wasn't very know, so I thought it was Golang. |
Given that this problem is not restricted to go, would you consider closing this. If Apple fixes the problem it will be fixed for all languages and tools simultaneously |
Sure thing, I was considering closing it a few days ago. Sorry for the inconvenience |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
This recipe is very clear and I actually have an example with my own software:
/usr/lib/system.b.dylib
.There is a reason of why this happens, according to Apple, they changed how default system libraries work on macOS (example the C library).
Quote:
My project can be located here
This code checks otool to get linked libraries and then copies them (The code might be bad).
What did you expect to see?
What did you see instead?
Proposed solution
Perhaps an idea of mine will be having an array of the default libraries of macOS (such as libsystem.b.dylib) and check at runtime if the OS is macOS if it is, and the user wants to copy some of this libraries, the solution is to syscall dlopen() instead of open(), hope this issue can help anyone and if not I guess I will have to fix it on my side.
The text was updated successfully, but these errors were encountered: