Re: [PATCH] tests: ignore $__CF_USER_TEXT_ENCODING in env during commandtest

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 03, 2023 at 12:00:30AM -0400, Laine Stump wrote:
> This environment variable is supposedly set according to the contents
> of ~/.CFUserTextEncoding, and certainly on MacOS 14 (Sonoma) it shows
> up in the environment, causing commandtest to fail. However, the value
> that is shown in $__CF_USER_TEXT_ENCODING during the test 1) is not in
> the environment of the shell the test is run from, and 2) doesn't
> match the contents of ~/.CFUserTextEncoding.
> 
> It is true, though, that filtering out this environment setting from
> the test results permits commandtest to pass on MacOS 14.
> 
> Signed-off-by: Laine Stump <laine@xxxxxxxxxx>

I guess this is being set by macOS libc runtime somewhere.

> ---
> 
> [*] There may be a better way to suppress this environment setting
>     (maybe something done to prevent it from ever being added to the
>     environment in the first place?), and that would be fine too. This
>     patch does work though.
> 
> [*] Andrea's patches to force rpcgen to generate ANSI C code are also
>     required for the test suite to pass on MacOS 14.
> 
>  tests/commandhelper.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/commandhelper.c b/tests/commandhelper.c
> index 9b56feb120..08ee48a3a8 100644
> --- a/tests/commandhelper.c
> +++ b/tests/commandhelper.c
> @@ -169,9 +169,12 @@ static int printEnvironment(FILE *log)
>  
>      for (i = 0; i < length; i++) {
>          /* Ignore the variables used to instruct the loader into
> -         * behaving differently, as they could throw the tests off. */
> -        if (!STRPREFIX(newenv[i], "LD_"))
> +         * behaving differently, as they could throw the tests off.
> +         * Also ignore __CF_USER_TEXT_ENCODING, which is set by MacOS. */
> +        if (!STRPREFIX(newenv[i], "LD_") &&
> +            !STRPREFIX(newenv[i], "__CF_USER_TEXT_ENCODING=")) {
>              fprintf(log, "ENV:%s\n", newenv[i]);
> +        }

Reviewed-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux