Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 907891 - media-video/pipewire-0.3.70-r2: Add logging support to gentoo-pipewire-launcher
Summary: media-video/pipewire-0.3.70-r2: Add logging support to gentoo-pipewire-launcher
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Sam James
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2023-06-05 09:46 UTC by Alexis
Modified: 2023-06-07 09:52 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to add logging support to gentoo-pipewire-launcher. (0001-media-video-pipewire-Add-logging-support-to-gentoo-p.patch,2.60 KB, patch)
2023-06-05 09:47 UTC, Alexis
Details | Diff
Patch to add logging support to gentoo-pipewire-launcher. (0001-media-video-pipewire-Add-logging-support-to-gentoo-p.patch,2.61 KB, patch)
2023-06-05 23:53 UTC, Alexis
Details | Diff
Patch to add logging support to gentoo-pipewire-launcher. (0001-media-video-pipewire-Add-logging-support-to-gentoo-p.patch,2.74 KB, patch)
2023-06-07 09:33 UTC, Alexis
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexis 2023-06-05 09:46:57 UTC
The `gentoo-pipewire-launcher` script currently doesn't have logging support. The attached patch addresses this. Works For Me, but testing and feedback would be appreciated.

Reproducible: Always
Comment 1 Alexis 2023-06-05 09:47:54 UTC
Created attachment 863322 [details, diff]
Patch to add logging support to gentoo-pipewire-launcher.
Comment 2 Alexis 2023-06-05 09:59:44 UTC
Oh also, happy to create a man page for g-p-l if required. If so, i'd prefer to write it in mdoc(7) (because that provides semantic markup to an extent that man(7) doesn't), but can use man(7) if that's Gentoo policy.
Comment 3 Mike Gilbert gentoo-dev 2023-06-05 23:13:50 UTC
I think you need to put quotes around the variables when they are used in commands. For example:

> @GENTOO_PORTAGE_EPREFIX@/usr/bin/pipewire 1>>"${PIPEWIRE_LOG}" 2>&1 &
Comment 4 Alexis 2023-06-05 23:53:26 UTC
Created attachment 863362 [details, diff]
Patch to add logging support to gentoo-pipewire-launcher.
Comment 5 Alexis 2023-06-05 23:58:53 UTC
(In reply to Mike Gilbert from comment #3)
> I think you need to put quotes around the variables when they are used in
> commands. For example:
> 
> > @GENTOO_PORTAGE_EPREFIX@/usr/bin/pipewire 1>>"${PIPEWIRE_LOG}" 2>&1 &

Ah yeah, good catch, thanks - patch updated.

Also, i wasn't sure whether to allow the *_LOG variables to be specified in the environment, i.e. to have the 'else' branch as:

    : ${PIPEWIRE_LOG:='/dev/null'}
    : ${PIPEWIRE_PULSE_LOG:='/dev/null'}
    : ${WIREPLUMBER_LOG:='/dev/null'}
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-06-07 07:58:27 UTC
I like the idea, but I think we should namespace the variables (prefix with either GENTOO_ or GENTOO_PW_LAUNCHER_, or even the long GENTOO_PIPEWIRE_LAUNCHER_).

This makes it clear it's something we've invented so nobody will bother upstream over it. It also makes it easier to search for.

Also, date --iso-8601=seconds isn't POSIX?
Comment 7 Alexis 2023-06-07 08:08:21 UTC
(In reply to Sam James from comment #6)
> I like the idea, but I think we should namespace the variables (prefix with
> either GENTOO_ or GENTOO_PW_LAUNCHER_, or even the long
> GENTOO_PIPEWIRE_LAUNCHER_).
> 
> This makes it clear it's something we've invented so nobody will bother
> upstream over it. It also makes it easier to search for.

Ah, yeah, good point.

> Also, date --iso-8601=seconds isn't POSIX?

No indeed. i was assuming that it was okay to use this on the basis that @system includes GNU coreutils, such that this `date` implementation will be available. But if policy is for scripts to be POSIX, i'm happy to work with that, and can update the patch accordingly. :-)
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-06-07 08:09:11 UTC
Show me how ugly it is in a POSIX variant and we'll see? ;)
Comment 9 Alexis 2023-06-07 08:19:37 UTC
(In reply to Sam James from comment #8)
> Show me how ugly it is in a POSIX variant and we'll see? ;)

:-)

    date +%Y-%m-%dT%H:%M:%S%Z

although `%Z` produces a timezone name, rather than an offset, e.g. `AEST`; as far as i can tell, there's no specifier for the latter:

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/date.html
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-06-07 08:26:40 UTC
Works for me if it works for you. I don't mind the output change.
Comment 11 Alexis 2023-06-07 09:03:45 UTC
(In reply to Sam James from comment #10)
> Works for me if it works for you. I don't mind the output change.
Okay, great.

As for prefixing the variables, i tend to lean towards:

    GENTOO_PIPEWIRE_LOG
    GENTOO_PIPEWIRE_PULSE_LOG
    GENTOO_WIREPLUMBER_LOG

rather than e.g.:

    GENTOO_PW_LAUNCHER_PIPEWIRE_LOG
    GENTOO_PW_LAUNCHER_PIPEWIRE_PULSE_LOG
    GENTOO_PW_LAUNCHER_WIREPLUMBER_LOG

which feel too unwieldy to me. And abbreviating gentoo-pipewire-launcher to 'GPL' would be a rather misleading prefix. :-)
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-06-07 09:08:46 UTC
OK with me if you're ok to update the wiki accordingly.
Comment 13 Alexis 2023-06-07 09:33:44 UTC
Created attachment 863468 [details, diff]
Patch to add logging support to gentoo-pipewire-launcher.
Comment 14 Alexis 2023-06-07 09:34:01 UTC
(In reply to Sam James from comment #12)
> OK with me if you're ok to update the wiki accordingly.

Sure, can do. Patch updated.
Comment 15 Larry the Git Cow gentoo-dev 2023-06-07 09:52:25 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=18e66b5f484739b45fcc12f8fa89c4d45acd8b80

commit 18e66b5f484739b45fcc12f8fa89c4d45acd8b80
Author:     Alexis <flexibeast@gmail.com>
AuthorDate: 2023-06-05 09:43:26 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-06-07 09:49:48 +0000

    media-video/pipewire: Add logging support to gentoo-pipewire-launcher
    
    Closes: https://bugs.gentoo.org/907891
    Signed-off-by: Alexis <flexibeast@gmail.com>
    Signed-off-by: Sam James <sam@gentoo.org>

 .../pipewire/files/gentoo-pipewire-launcher.in-r2  | 77 ++++++++++++++++++++++
 media-video/pipewire/pipewire-0.3.71-r2.ebuild     |  2 +-
 media-video/pipewire/pipewire-9999.ebuild          |  2 +-
 3 files changed, 79 insertions(+), 2 deletions(-)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c268e89f934af7a752e756e3207eae31f311cb19

commit c268e89f934af7a752e756e3207eae31f311cb19
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-06-07 09:47:59 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-06-07 09:47:59 +0000

    media-video/pipewire: add 0.3.71-r2 (unchanged from 0.3.71-r1 for now)
    
    Doing it this way to get a clean git history for the 2 changes from flexibeast.
    
    Bug: https://bugs.gentoo.org/907966
    Bug: https://bugs.gentoo.org/907891
    Signed-off-by: Sam James <sam@gentoo.org>

 media-video/pipewire/pipewire-0.3.71-r2.ebuild | 461 +++++++++++++++++++++++++
 1 file changed, 461 insertions(+)
Comment 16 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-06-07 09:52:56 UTC
Thanks as ever!