[Webkit-unassigned] [Bug 280610] New: [GLib] Centralize handling of environment variables

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 30 04:32:35 PDT 2024


https://bugs.webkit.org/show_bug.cgi?id=280610

            Bug ID: 280610
           Summary: [GLib] Centralize handling of environment variables
           Product: WebKit
           Version: Other
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Platform
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: aperez at igalia.com

In the GLib (WPE + GTK) ports we have a number of toggles and tweaks that may
be applied at runtime using environment variables. While mostly intended for
development, end-users are asked sometimes to use them for complementing bug
reports and/or trying workarounds for their issues.

Currently, each call site which makes use of an environment variable handles
reading the environment variable and parsing, resulting in code duplication
and lack of consistency, e.g. some locations will accept "0" and "1" as boolean
flags, others "0" and any non-zero value; and error-checking also varies wildly.

We would like to have a WTF::Environment (or similarly named) class defining
the base structure and common code used to get and parse environment variable
values. An additional YAML source file would describes which environment
variables are available, the types of the values they accept, what are their
default values if undefined (or cannot be parsed), and an optional short
description. Then, we would generate C++ code from the YAML file that adds
getter functions to the Environment class.

If the above sounds familiar, it's because the idea is inspired by how
“Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml” is used to
describe feature flags =)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240930/c614fddc/attachment.htm>


More information about the webkit-unassigned mailing list