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

AppImage packaging failed when copying shared libraries #144

Open
tk-nguyen opened this issue Sep 27, 2023 · 3 comments
Open

AppImage packaging failed when copying shared libraries #144

tk-nguyen opened this issue Sep 27, 2023 · 3 comments

Comments

@tk-nguyen
Copy link

Hello! We're using this package to create Linux AppImage builds for our app, but it is failing when copying over shared libraries. Probably it's because it's copying twice.

image

image

After running ldd on the built app, there are 2 locations for our shared libraries, which cause flutter_distributor to copy them both:

image

image

Maybe we can add -f to cp command or detect duplicated shared libraries?

@lijy91
Copy link
Member

lijy91 commented Nov 26, 2023

Hi @KRTirtho , can you help me take a look at this issue?

@KRTirtho
Copy link
Contributor

But we're already making sure paths are unique. I'm unsure how it's getting duplicated

final soDeps = lines
.split('\n')
.where(
(line) => line.contains('=>') && line.trim().startsWith('lib'))
/// converts this:
/// libkeybinder-3.0.so.0 => /lib64/libkeybinder-3.0.so.0 (0x00007f6513811000)
/// to this:
/// /lib64/libkeybinder-3.0.so.0
.map((line) => line.split(' => ')[1].trim().split(' ').first.trim())
.toList()
..sort();
return soDeps.toSet();

@KRTirtho
Copy link
Contributor

Also, in here we made sure to eradicate duplicates

final libFlutterGtkDeps = await _getSharedDependencies(
path.join(
makeConfig.packagingDirectory.path,
'${makeConfig.appName}.AppDir/lib/libflutter_linux_gtk.so',
),
);
await Future.wait(
appSOLibs.map((so) async {
final referencedSharedLibs = await _getSharedDependencies(so.path)
.then((d) => d.difference(libFlutterGtkDeps)
..removeWhere(
(lib) => lib.contains('libflutter_linux_gtk.so'),
));
if (referencedSharedLibs.isEmpty) return;

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

No branches or pull requests

3 participants