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

Clean up build system integration for Wayland security contexts #5507

Merged
merged 2 commits into from
Sep 10, 2023

Conversation

smcv
Copy link
Collaborator

@smcv smcv commented Aug 31, 2023

Follow-up for #4920. cc @emersion

  • build: Link Wayland code into full libflatpak-common only

    This is only needed in flatpak-run-wayland.c, so we don't need it when
    linking ancillary daemons that don't need any of flatpak-run, such as
    the portal, session helper, system helper and OCI authenticator.

  • build: Generate Wayland glue code as private

    The code argument to wayland-scanner is deprecated in favour of
    private-code, which marks the symbols as private, avoiding them
    leaking into the ABI of libflatpak.so.0.

    private-code was new in wayland-scanner 1.15, which is available in
    relatively old LTS distributions like CentOS 7, Debian 10 and
    Ubuntu 18.04, and is much older than wayland-protocols 1.32.

@smcv smcv requested a review from alexlarsson August 31, 2023 15:04
@emersion
Copy link
Contributor

LGTM

@smcv
Copy link
Collaborator Author

smcv commented Aug 31, 2023

For simplicity, I've only done this in the recommended Meson build system

Or we could just say that enabling Wayland security context support requires a halfway modern wayland-scanner (for context, Debian 10 had a new enough version, and is already EOL), and check for >= 1.15 as a minimum.

This feature already requires modern wayland-protocols, which old distributions aren't going to provide anyway.

I'm not intending to implement a version-conditional in Autotools because Automake syntax is so unpleasant to write, and because we should delete the Autotools build system before very long anyway.

@emersion
Copy link
Contributor

Yeah, I think requiring new enough wayland-scanner is perfectly reasonable and would be simpler.

@smcv
Copy link
Collaborator Author

smcv commented Aug 31, 2023

Yeah, I think requiring new enough wayland-scanner is perfectly reasonable and would be simpler.

Done, and yes it's simpler.

@smcv
Copy link
Collaborator Author

smcv commented Sep 8, 2023

@emersion, does this still look good to you?

@emersion
Copy link
Contributor

emersion commented Sep 8, 2023

Sure

This is only needed in flatpak-run-wayland.c, so we don't need it when
linking ancillary daemons that don't need any of flatpak-run, such as
the portal, session helper, system helper and OCI authenticator.

Signed-off-by: Simon McVittie <[email protected]>
The `code` argument to wayland-scanner is deprecated in favour of
`private-code`, which marks the symbols as private, avoiding them
leaking into the ABI of `libflatpak.so.0`.

`private-code` was new in wayland-scanner 1.15, which is available in
relatively old LTS distributions like CentOS 7, Debian 10 and
Ubuntu 18.04, and is much older than wayland-protocols 1.32.

Signed-off-by: Simon McVittie <[email protected]>
@smcv smcv merged commit e6bd149 into flatpak:main Sep 10, 2023
9 checks passed
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.

None yet

3 participants