New GitHub issue #93336 from neonene:<br>

<hr>

<pre>
Currently, out-of-tree builds pass `test_embed.py` without checking on a buildbot (ubuntu). This issue can be linked to gh-89858 and may already be known.

**Messages without `-W` test option:**
```
test_audit (test.test_embed.AuditingTests.test_audit) ... skipped 
    "'/home/runner/work/cpython/cpython-builddir/Programs/_testembed' doesn't exist"

test_audit_run_command (test.test_embed.AuditingTests.test_audit_run_command) ... skipped
    "'/home/runner/work/cpython/cpython-builddir/Programs/_testembed' doesn't exist"

test_audit_run_file (test.test_embed.AuditingTests.test_audit_run_file) ... skipped
    "'/home/runner/work/cpython/cpython-builddir/Programs/_testembed' doesn't exist"
...
```

<br>

They come from `support.REPO_ROOT` below which points `/home/runner/work/cpython/cpython-ro-srcdir`. One test failure was left when I set `/home/runner/work/cpython/cpython-builddir` instead:
https://github.com/python/cpython/blob/66f5add1f0ac801cba5ece36e6cfd68985d82029/Lib/test/test_embed.py#L72-L76

https://github.com/python/cpython/blob/66f5add1f0ac801cba5ece36e6cfd68985d82029/Lib/test/support/__init__.py#L109-L112
```
FAIL: test_init_pybuilddir (test.test_embed.InitConfigTests.test_init_pybuilddir)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/test/test_embed.py", line 1356, in test_init_pybuilddir
    self.check_all_configs("test_init_compat_config", config,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/test/test_embed.py", line 801, in check_all_configs
    self.check_config(configs, expected_config)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/test/test_embed.py", line 727, in check_config
    self.assertEqual(config, expected)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
<details>

```
AssertionError: {'_co[351 chars]'], 'xoptions': [], 'warnoptions': [], 'python[1304 chars]': 0} != {'_co[351 chars]'], 'orig_argv': [], 'xoptions': [], 'warnopti[1296 chars]': 0}
  {'_config_init': 1,
   '_init_main': 1,
   '_install_importlib': 1,
   '_isolated_interpreter': 0,
   'argv': [''],
   'base_exec_prefix': '/usr/local',
   'base_executable': '/tmp/tmp9etrf77o/_testembed',
   'base_prefix': '/usr/local',
   'buffered_stdio': 1,
   'bytes_warning': 0,
   'check_hash_pycs_mode': 'default',
   'code_debug_ranges': 1,
   'configure_c_stdio': 0,
   'dev_mode': 0,
   'dump_refs': 0,
   'exec_prefix': '/usr/local',
   'executable': '/tmp/tmp9etrf77o/_testembed',
   'faulthandler': 0,
   'hash_seed': 0,
   'home': None,
   'import_time': 0,
   'inspect': 0,
   'install_signal_handlers': 1,
   'interactive': 0,
   'isolated': 0,
   'malloc_stats': 0,
   'module_search_paths': ['/usr/local/lib/python312.zip',
                           '/home/runner/work/cpython/cpython-ro-srcdir/Lib',
                           '/home/runner/work/cpython/cpython-builddir/build/lib.linux-x86_64-3.12-pydebug',
                           '/usr/local/lib/python312.zip',
-                          '/tmp/cpython-ro-srcdir/Lib',
?                                ^ ^ ^ -----------

+                          '/tmp/tmp9etrf77o/Lib',
?                                ^^ ^^ ^^^^

                           '/tmp/tmp9etrf77o/libdir'],
   'module_search_paths_set': 1,
   'optimization_level': 0,
   'orig_argv': [],
   'parse_argv': 0,
   'parser_debug': 0,
   'pathconfig_warnings': 1,
   'platlibdir': 'lib',
   'prefix': '/usr/local',
   'program_name': './_testembed',
   'pycache_prefix': None,
   'pythonpath_env': '/usr/local/lib/python312.zip:/home/runner/work/cpython/cpython-ro-srcdir/Lib:/home/runner/work/cpython/cpython-builddir/build/lib.linux-x86_64-3.12-pydebug',
   'quiet': 0,
   'run_command': None,
   'run_filename': None,
   'run_module': None,
   'safe_path': 0,
   'show_ref_count': 0,
   'site_import': 1,
   'skip_source_first_line': 0,
-  'stdlib_dir': '/tmp/cpython-ro-srcdir/Lib',
+  'stdlib_dir': '/tmp/tmp9etrf77o/Lib',
   'tracemalloc': 0,
   'use_environment': 1,
-  'use_frozen_modules': 0,
?                        ^

+  'use_frozen_modules': False,
?                        ^^^^^

   'use_hash_seed': 0,
   'user_site_directory': 1,
   'verbose': 0,
   'warn_default_encoding': 0,
   'warnoptions': [],
   'write_bytecode': 1,
   'xoptions': []}
```
</details>
</pre>

<hr>

<a href="https://github.com/python/cpython/issues/93336">View on GitHub</a>
<p>Labels: type-bug</p>
<p>Assignee: </p>