Skip to content
Snippets Groups Projects

runtime: Correctly handle data dirs when in a Flatpak environment

Merged Ludovico de Nittis requested to merge wip/bind_correct_drirc.d into master
  • Expose the modified /app to the subsandbox, if any

    If we modify "/app" we want to bind it to the new subsandbox instead of always binding an empty directory.

  • When we are in a Flatpak environment there are two issues:

    • It's common to have multiple data directory, usually one for every multiarch
    • If we bind the data directory in "/usr/share/${dir_basename}" there is no guarantee that it will be in the library search path

    For this reason we avoid raising a warning if we have multiple data directory and also we bind them preserving their original path.

Edited by Ludovico de Nittis

Merge request reports

Merge request pipeline #11597 passed

Merge request pipeline passed for 3987c66d

Merged by Simon McVittieSimon McVittie 3 years ago (Apr 13, 2021 4:08pm UTC)

Loading

Pipeline #11610 passed

Pipeline passed for d263dabf on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Ludovico de Nittis changed the description

    changed the description

  • With LIBGL_DEBUG=verbose I verified that the binded drirc.d in /usr/share/drirc.d was not picked up by the mesa driver.

    Additionally when we are in pv_runtime_finish_lib_data() we only know about the real drirc.d directory that is usually located in /app/lib/i386-linux-gnu/GL/default/share/drirc.d, for i386. Also this path is not in the library search patch because apparently only /usr/lib/i386-linux-gnu/GL/default/share/drirc.d is.

    In the freedesktop.org runtime this is handled by creating a symlink /usr/lib/i386-linux-gnu -> ../../app/lib/i386-linux-gnu.

    For this reason if we detect that we are trying to bind a path in /app/lib/*, we also check if the counterpart in /usr/lib is the same directory, and if it is we bind this too.

  • Ludovico de Nittis marked this merge request as ready

    marked this merge request as ready

  • Ludovico de Nittis mentioned in merge request !290 (merged)

    mentioned in merge request !290 (merged)

  • Simon McVittie approved this merge request

    approved this merge request

  • Simon McVittie mentioned in commit d263dabf

    mentioned in commit d263dabf

Please register or sign in to reply
Loading