Skip to content

Conversation

@xmkg
Copy link
Member

@xmkg xmkg commented Jul 4, 2025

The GUI binary, multipass.gui's RUNPATH is $ORIGIN/lib, which resolves to $REPO_ROOT/build/bin/bundle/lib/, whereas the libdart_ffi.so is in $REPO_ROOT/build/lib folder. Hence, the multipass.gui fails to launch on local builds if libdart_ffi.so is not somehow placed in the library search path manually (i.e., by copying, or by LD_LIBRARY_PATH).

This patch copies the libdart_ffi.so to the bundle/lib so the GUI can find the dart_ffi library on local build without relying on manual intervention.

MULTI-2067

The GUI binary, multipass.gui's RUNPATH is $ORIGIN/lib, which resolves
to `$REPO_ROOT/build/bin/bundle/lib/`, whereas the libdart_ffi.so is in
`$REPO_ROOT/build/lib` folder. Hence, the multipass.gui fails to launch
on local builds if libdart_ffi.so is not somehow placed to the library
search path manually (i.e. by copying, or by LD_LIBRARY_PATH).

This patch adds a libdart_ffi.so symlink to the bundle/lib so the GUI
can find the dart_ffi library on local build without relying on a manual
intervention.

Signed-off-by: Mustafa Kemal Gilor <mustafa.gilor@canonical.com>
@xmkg xmkg marked this pull request as draft July 4, 2025 08:53
Signed-off-by: Mustafa Kemal Gilor <mustafa.gilor@canonical.com>
@xmkg xmkg force-pushed the enhancement/symlink-libdart-ffi-to-bundle-lib branch from 79668d6 to eec3052 Compare July 4, 2025 10:07
@codecov
Copy link

codecov bot commented Jul 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.31%. Comparing base (b7a35a3) to head (0cc0d85).
⚠️ Report is 434 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4212   +/-   ##
=======================================
  Coverage   89.31%   89.31%           
=======================================
  Files         259      259           
  Lines       15684    15684           
=======================================
  Hits        14008    14008           
  Misses       1676     1676           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

symlinking gets complicated pretty fast when the folder structure
changes.

Signed-off-by: Mustafa Kemal Gilor <mustafa.gilor@canonical.com>
@xmkg xmkg force-pushed the enhancement/symlink-libdart-ffi-to-bundle-lib branch from cbf6b1c to 0cc0d85 Compare July 7, 2025 18:32
@xmkg xmkg marked this pull request as ready for review July 7, 2025 18:32
@xmkg xmkg requested a review from levkropp July 8, 2025 06:51
Copy link
Contributor

@levkropp levkropp left a comment

Choose a reason for hiding this comment

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

LGTM! Works as expected. I have no issues with a simple copy over a symlink

@xmkg xmkg changed the title [client/gui] symlink libdart_ffi to bundle/lib post build [client/gui] copy libdart_ffi to bundle/lib post build Jul 8, 2025
@xmkg
Copy link
Member Author

xmkg commented Jul 8, 2025

@ricab @sharder996 @Sploder12, could I interest any of you in doing a secondary review? :)

Copy link
Collaborator

@ricab ricab left a comment

Choose a reason for hiding this comment

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

LGTM, thanks Mustafa!

Just a question out of curiosity: how would the symlink get more complicated than the copy? Either command needs updating on dir-structure changes, no?

Copy link
Collaborator

@sharder996 sharder996 left a comment

Choose a reason for hiding this comment

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

Tested on MacOS. LGTM!

Trade you for a rubber stamp on #4181

@xmkg
Copy link
Member Author

xmkg commented Jul 8, 2025

LGTM, thanks Mustafa!

Just a question out of curiosity: how would the symlink get more complicated than the copy? Either command needs updating on dir-structure changes, no?

Unfortunately for us, the bundle directory itself is a symlink too, so to put a proper relative symlink for libdart_ffi in bundle, we'd need to resolve all the symlink components in the path, which is a bit more complex (and uglier) than just copying the file.

@xmkg
Copy link
Member Author

xmkg commented Jul 8, 2025

Tested on MacOS. LGTM!

Trade you for a rubber stamp on #4181

Fair enough :) Re-approved 👍

@ricab ricab added this pull request to the merge queue Jul 8, 2025
Merged via the queue into main with commit 280d7c7 Jul 8, 2025
24 of 31 checks passed
@ricab ricab deleted the enhancement/symlink-libdart-ffi-to-bundle-lib branch July 8, 2025 21:40
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.

4 participants