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

lomiri.{lomiri-app-launch,content-hub}: Fix issues with peer spawning & data transfer #316255

Merged
merged 4 commits into from
Jun 7, 2024

Conversation

OPNA2608
Copy link
Contributor

Description of changes

See individual commits for thorough-ish explanations.

Without this, content-hub data exchanges are kinda broken.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

OPNA2608 added 4 commits May 31, 2024 22:11
LAL manages desktop file parsing for various parts of the Lomiri environment. It also handles turning them into SystemD services tracked in the background.
And due to how things work one, it's code is also SystemD-launched by itself.

When we package applications with desktop files, we don't want the Exec values to be absolute, so we patch out absolute paths.
Without absolute paths, PATH is expected to have the path to the executables. But our PATHs don't always contain i.e. /run/current-system/sw/bin.

Services launched by SystemD are one such instance. If LAL code is run under SystemD's restricted reduced PATH, then it fails to find the requested executables.
This is what happens to content-hub, and it causes all transfer requests to be met with an immediate "could not launch peer"-like error, and a transfer being stuck halfway.

To work around this (I wouldn't call this a real solution?), patch LAL code to:
- also propagate whatever PATH it currently *does* have to its launched applications
- postfix the PATH it has with /run/current-system/sw/bin, to give it a decent fallback

These changes allow for lomiri-filemanager-app to be launched via a content-hub request from lomiri-system-settings (i.e. the background selection).
- Patch has been merged, fetch merged one & update comment (hash is unchanged, checked)
- We now have a CMake modern enough for pkg_get_variable DEFINE_VARIABLES, use it
- substituteInPlace --replace is deprecated
- with lib; in meta is frowned-upon
We don't have a functional content-hub transfer test, so this slipped through the cracks during testing.

(The background setting in LSS would be an easy one, but that calls an AccountsSetting function that
doesn't exist outside of Ubuntu, so it wouldn't work anyway.)
- Some patches have been merged, fetch merged ones if possible & update comments
- with lib; in meta is frowned-upon
@ofborg ofborg bot added 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 11-100 labels May 31, 2024
@OPNA2608
Copy link
Contributor Author

OPNA2608 commented May 31, 2024

I would like to remove the crutch in the VM test where we need to keep Morph running, but Morph still segfaults when being launched via content-hub. Have yet to debug that further, but the file manager app in #316240 launches fine with this.

@ofborg build nixosTests.lomiri

@OPNA2608 OPNA2608 merged commit ed61e2b into NixOS:master Jun 7, 2024
30 of 32 checks passed
Copy link
Contributor

github-actions bot commented Jun 7, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 11-100 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant