Bug 212524

Summary: [GTK] Bubblewrap sandbox lacks support for sndio
Product: WebKit Reporter: Haelwenn (lanodan) Monnier <contact+bugs.webkit.org>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: aperez, bugs-noreply, clopez
Priority: P2    
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Haelwenn (lanodan) Monnier 2020-05-29 07:50:47 PDT
Loosely related to https://bugs.webkit.org/show_bug.cgi?id=210101 (I'm using sndio as a workaround to this alsa bug)
Comment 1 Haelwenn (lanodan) Monnier 2020-05-29 07:53:55 PDT
Created attachment 400580 [details]
Patch
Comment 2 Carlos Alberto Lopez Perez 2020-05-29 07:59:32 PDT
Comment on attachment 400580 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=400580&action=review

> Source/WebKit/ChangeLog:4
> +        BubblewrapLauncher.cpp: Add paths required for sndio
> +

You have to add the bug number here. Check how other Changelog entries are written.

> Source/WebKit/ChangeLog:11
> +        No new tests (OOPS!).

You have to remove this line and change it by something like "Covered by existing tests"
Comment 3 Haelwenn (lanodan) Monnier 2020-05-29 09:27:40 PDT
(In reply to Carlos Alberto Lopez Perez from comment #2)
> Comment on attachment 400580 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=400580&action=review
> > Source/WebKit/ChangeLog:11
> > +        No new tests (OOPS!).
> 
> You have to remove this line and change it by something like "Covered by
> existing tests"

Well there *is* no tests for sndio into the webkit bubblewrap sandbox so I'm not really sure what to write there.
Comment 4 Adrian Perez 2020-05-29 09:48:11 PDT
Comment on attachment 400580 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=400580&action=review

> Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp:386
> +    bindIfExists(args, "/tmp/sndio", BindFlags::ReadWrite);

Does the patch work without this bind mount? I think it should be enought to
bind the per-user directory (as done in the next two lines). I tried to run
“sndiod” in my system and there is only a “/tmp/sndio-1000” directory (my
user UID here is 1000), but no “/tmp/sndio” directory.
Comment 5 Carlos Alberto Lopez Perez 2020-05-29 10:21:04 PDT
(In reply to Haelwenn (lanodan) Monnier from comment #3)
> (In reply to Carlos Alberto Lopez Perez from comment #2)
> > Comment on attachment 400580 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=400580&action=review
> > > Source/WebKit/ChangeLog:11
> > > +        No new tests (OOPS!).
> > 
> > You have to remove this line and change it by something like "Covered by
> > existing tests"
> 
> Well there *is* no tests for sndio into the webkit bubblewrap sandbox so I'm
> not really sure what to write there.

I know, but you have to remove that line "No new tests (OOPS!)." to make our tooling happy. So saying something along with what I suggested is good enough. You can also say something like "Feature has been manually tested, there is currently not automatic tests for it"
Comment 6 Haelwenn (lanodan) Monnier 2020-05-30 06:25:17 PDT
(In reply to Adrian Perez from comment #4)
> Comment on attachment 400580 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=400580&action=review
> 
> > Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp:386
> > +    bindIfExists(args, "/tmp/sndio", BindFlags::ReadWrite);
> 
> Does the patch work without this bind mount? I think it should be enought to
> bind the per-user directory (as done in the next two lines). I tried to run
> “sndiod” in my system and there is only a “/tmp/sndio-1000” directory (my
> user UID here is 1000), but no “/tmp/sndio” directory.

Yes, the "/tmp/sndio" is needed when sndio is launched as superuser (which then drops to an unprivileged user like "sndiod"), this allows to share it between multiple users.
Comment 7 Haelwenn (lanodan) Monnier 2020-05-30 06:37:28 PDT
Created attachment 400667 [details]
Patch
Comment 8 Adrian Perez 2020-05-30 11:48:55 PDT
(In reply to Haelwenn (lanodan) Monnier from comment #6)
> (In reply to Adrian Perez from comment #4)
> > Comment on attachment 400580 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=400580&action=review
> > 
> > > Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp:386
> > > +    bindIfExists(args, "/tmp/sndio", BindFlags::ReadWrite);
> > 
> > Does the patch work without this bind mount? I think it should be enought to
> > bind the per-user directory (as done in the next two lines). I tried to run
> > “sndiod” in my system and there is only a “/tmp/sndio-1000” directory (my
> > user UID here is 1000), but no “/tmp/sndio” directory.
> 
> Yes, the "/tmp/sndio" is needed when sndio is launched as superuser (which
> then drops to an unprivileged user like "sndiod"), this allows to share it
> between multiple users.

Ah, good to know, thanks for commenting about this :)
Comment 9 Haelwenn (lanodan) Monnier 2020-07-05 22:57:21 PDT
Any updates on merging it?
Comment 10 Adrian Perez 2020-07-06 05:07:29 PDT
Comment on attachment 400667 [details]
Patch

Let's land this, patch LGTM now. Thanks for working on the patch!
Comment 11 EWS 2020-07-06 05:13:12 PDT
Committed r263966: <https://trac.webkit.org/changeset/263966>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 400667 [details].