• [gentoo-dev] [PATCH 0/6] virtualx.eclass: Use Xvfb -displayfd ... + cle

    From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Wed Jul 27 09:20:01 2022
    Hi,

    With modern versions of Xvfb, we can get rid of our custom logic of
    trying to find a free DISPLAY. This patchset does that + some
    refactoring. It also removes the hack of disabling sandbox that
    apparently dates back to 2002 and has never been really explained.
    According to my quick testing, Xvfb works just fine without it.


    Michał Górny (6):
    virtualx.eclass: Add quoting to workaround vim syntax hl bug
    virtualx.eclass: Pass xvfbargs as an array
    virtualx.eclass: Remove unused XHOST
    virtualx.eclass: Inline XVFB
    virtualx.eclass: Let Xvfb figure out the free DISPLAY
    virtualx.eclass: Do not disable sandbox

    eclass/virtualx.eclass | 79 +++++++++++++-----------------------------
    1 file changed, 24 insertions(+), 55 deletions(-)

    --
    2.35.1

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Wed Jul 27 09:20:02 2022
    The code responsible for disabling sandbox dates back to 2002 and does
    not include any explanation. Let's try if we still need it.

    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/virtualx.eclass | 7 -------
    1 file changed, 7 deletions(-)

    diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
    index c0af095e89a5..e04834d39bd1 100644
    --- a/eclass/virtualx.eclass
    +++ b/eclass/virtualx.eclass
    @@ -107,7 +107,6 @@ virtx() {

    local i=0
    local retval=0
    - local OLD_SANDBOX_ON="${SANDBOX_ON}"
    local xvfbargs=( -screen 0 1280x1024x24 +extension RANDR )

    debug-print "${FUNCNAME}: running Xvfb hack"
    @@ -115,9 +114,6 @@ virtx() {

    einfo "Starting Xvfb ..."

    - # We really do not want SANDBOX enabled here
    - export SANDBOX_ON="0"
    -
    debug-print "${FUNCNAME}: Xvfb -displayfd 1 ${xvfbargs[*]}"
    local logfile=${T}/Xvfb.log
    local pidfile=${T}/Xvfb.pid
    @@ -134,9 +130,6 @@ virtx() {
    die "Xvfb failed to start"
    fi

    - # Now enable SANDBOX again if needed.
    - export SANDBOX_ON="${OLD_SANDBOX_ON}"
    -
    # Do not break on error, but setup $retval, as we need to kill Xvfb
    einfo "Xvfb started on DISPLAY=${DISPLAY}"
    debug-print "${FUNCNAME}: $@"
  • From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Wed Jul 27 09:20:02 2022
    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/virtualx.eclass | 15 +++++++--------
    1 file changed, 7 insertions(+), 8 deletions(-)

    diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
    index 05b89e814a42..d1c05e20b246 100644
    --- a/eclass/virtualx.eclass
    +++ b/eclass/virtualx.eclass
    @@ -108,9 +108,8 @@ virtx() {
    local i=0
    local retval=0
    local OLD_SANDBOX_ON="${SANDBOX_ON}"
    - local XVFB XDISPLAY
    + local XDISPLAY
    local xvfbargs=( -screen 0 1280x1024x24 +extension RANDR )
    - XVFB=$(type -p Xvfb) || die

    debug-print "${FUNCNAME}: running Xvfb hack"
    export XAUTHORITY=
    @@ -133,24 +132,24 @@ virtx() {
    # We really do not want SANDBOX enabled here
    export SANDBOX_ON="0"

    - debug-print "${FUNCNAME}: ${XVFB} :${XDISPLAY} ${xvfbargs[*]}"
    - ${XVFB} :${XDISPLAY} "${xvfbargs[@]}" &>/dev/null &
    + debug-print "${FUNCNAME}: Xvfb :${XDISPLAY} ${xvfbargs[*]}"
    + Xvfb :${XDISPLAY} "${xvfbargs[@]}" &>/dev/null &
    sleep 2

    local start=${XDISPLAY}
    while [[ ! -f /tmp/.X${XDISPLAY}-lock ]]; do
    # Stop trying a
  • From Sam James@21:1/5 to All on Wed Jul 27 09:30:01 2022
    On 27 Jul 2022, at 08:17, Michał Górny <mgorny@gentoo.org> wrote:

    The code responsible for disabling sandbox dates back to 2002 and does
    not include any explanation. Let's try if we still need it.

    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---

    I'd tag https://bugs.gentoo.org/107479.

    eclass/virtualx.eclass | 7 -------
    1 file changed, 7 deletions(-)


    -----BEGIN PGP SIGNATURE-----

    iNUEARYKAH0WIQQlpruI3Zt2TGtVQcJzhAn1IN+RkAUCYuDnWV8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0MjVB NkJCODhERDlCNzY0QzZCNTU0MUMyNzM4NDA5RjUyMERGOTE5MAAKCRBzhAn1IN+R kMBaAQCiwmsLXWu6tP3dat+aPi4MiMcvqDw9YXrLITD8A5U3gwD/cWm1vtd9TvTD U4p6UFg4Q8dCNwbpRQtk13qj3sUSgQk=
    =ipWO
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)