Closed Kiri2002 closed 3 months ago
well, I meet same issue in other flutter package. I think maybe this is something wrong with flutter itself
I had a similar issue but i fixed it using these commands: https://github.com/LinwoodDev/Butterfly/blob/5eeb947dad8f8205f0b163040cdbf4a16f34d2b3/app/scripts/build-rpm.sh#L21-L33 Just run this after flutter build Can you try if these fixes your issue?
I had a similar issue but i fixed it using these commands:
Just run this after flutter build Can you try if these fixes your issue?
Yes, this script fix well. I added to PKGBUILD(arch package script).
It would be very beneficial, if this ".so fixing" script run in
app/build/linux/x64/release/bundle/lib/
directly after build. So that others could ignore this issue totally.
Well, bad news, it can't just set all "issue .so" runpath to "ORIGIN", otherwise app will down:
[FATAL:flutter/runtime/dart_vm_initializer.cc(89)] Error while initializing the Dart VM: Invalid vm isolate snapshot seen
Aborted: oops, process 'butterfly' core dumped
this happened because some .so shouldn't have runpath even "ORIGIN" run after above script, all issue .so set to "ORIGIN":
readelf -d lib/*|grep run -B 1 03/28/2024 10:00:13 PM PM
Tag Type Name/Value
0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN]
--
0x000000000000000e (SONAME) Library soname: [libdynamic_color_plugin.so]
0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN]
--
0x000000000000000e (SONAME) Library soname: [libfile_selector_linux_plugin.so]
0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN]
--
Tag Type Name/Value
0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN]
--
0x000000000000000e (SONAME) Library soname: [libflutter_secure_storage_linux_plugin.so]
0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN]
--
Tag Type Name/Value
0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN]
--
0x000000000000000e (SONAME) Library soname: [libprinting_plugin.so]
0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN]
--
0x000000000000000e (SONAME) Library soname: [libscreen_retriever_plugin.so]
0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN]
--
0x000000000000000e (SONAME) Library soname: [liburl_launcher_linux_plugin.so]
0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN]
--
0x000000000000000e (SONAME) Library soname: [libwindow_manager_plugin.so]
0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN]
while, it should be:
readelf -d lib/*|grep run -B 1 03/28/2024 10:00:26 PM PM
Tag Type Name/Value
0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN]
--
0x000000000000000e (SONAME) Library soname: [libprinting_plugin.so]
0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN]
In this way, app run well.
So i thinks the right way may be just delete wrong path.
I had a similar issue but i fixed it using these commands:
Just run this after flutter build Can you try if these fixes your issue?
refined script like this, works fine:
# Fix .so files using patchelf
for file in *.so; do
PATCHELF_OUTPUT=$(patchelf --print-rpath $file)
echo "Checking $file: $PATCHELF_OUTPUT"
# Skip file if PATCHELF_OUTPUT does not contain CURRENT_DIR
if [[ ! $PATCHELF_OUTPUT =~ $CURRENT_DIR ]]; then
echo "Skipping $file"
continue
fi
# Remove rpath if it not contain ORIGIN before
if [[ ! $PATCHELF_OUTPUT =~ 'ORIGIN' ]]; then
echo "Removing rpath for $file"
patchelf --remove-rpath $file
continue
fi
# Set rpath to ORIGIN if it contain ORIGIN before
echo "Setting ORIGIN rpath for $file"
patchelf --set-rpath '$ORIGIN' $file
done
perfect, can i close this issue? Please send me a link to the package if you are done :)
perfect, can i close this issue? Please send me a link to the package if you are done :)
Well I pushed the package to Archlinuxcn'repo, I will link the package as long as it passed.
Thanks to your beautiful software and your nice work :smiley:
Oh nice, but is this package only available in china? I thought this build scripts are universal?
What happened?
After build in archlinux, in app/build/linux/x64/release/bundle/lib, some so files got run RPATH:
"/home/kiri/Build/butterfly/src" is my building path.
Although it can run successfully, but maybe not safe.
I changed use this cmd and works well.
But idk how to avoid this issue in build process.
Version
2.0.3
Platform
Linux
Relevant log output
Code of Conduct