Skip to content
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

BUGFIX: copy dylibs #504

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

BUGFIX: copy dylibs #504

wants to merge 2 commits into from

Conversation

Tokarak
Copy link

@Tokarak Tokarak commented Aug 30, 2023

A rough patch copying all dylibs available in the runtime into the app. This should close most issues that #502 was intended to fix.

Tested in standalone mode, Anaconda python installation, Apple Silicon.

Reverts #315 (it never helped and only affected x86 architecture; #502 was supposed to port the fix to other architectures, and it definitely did not resolve the bug).
Closes: #494 #482 #286 #472

The behaviour exhibited only fits the default standalone mode; not alias mode and probably not semi-standalone mode. It's hell to test a project where you aren't sure whether the problem is in the modified code, versioning, or an original bug, and I haven't even touched the other modes yet, so I'm hoping a maintainer will adapt this code to how it should be.

I’m not sure all edge cases are covered, especially semi_standalone

Signed-off-by: Tokarak <63452145+Tokarak@users.noreply.github.com>
This reverts ronaldoussoren#315, which never worked and only applied to x86 architecture.

Signed-off-by: Tokarak <63452145+Tokarak@users.noreply.github.com>
dylib_dir = os.path.dirname(runtime)
for fn in os.listdir(dylib_dir):
if fn.endswith(".dylib"):
mm.mm.run_file(os.path.join(dylib_dir, fn))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found a bug! Some dylibs are nested in further directories, and so aren't copied. The may also have to be copied as-specified?

Therefore, it may be better to copy the whole environment — it seems like best practice too, keeping a minimal VENV.

What HASN'T been answered, is why did this work for so long, and then suddenly stop working, and for (maybe) apple silicon only? I hope a maintainer who knows the code picks this up. I spent enough time, so I'm done here.

@@ -20,7 +20,7 @@
{
"name": "main-x86_64",
"target": "10.5",
"cflags": "-g -arch x86_64 -Wl,-rpath,@executable_path/../Frameworks",
"cflags": "-g -arch x86_64",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to work out why the issues are popping up only for apple silicon... As far as I know, this is the only difference. If it has no change at runtime, maybe it has an effect at build-time? This could be a quick lead which could be easy to test experimentally.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I sent a probe in #507 and #508. I personally got a negative result on arm64 (#508), so it's likely that #315 truly did do nothing... and this massive bug has existed for more than 3 years?

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.

Missing libraries
1 participant