@@ -418,18 +418,6 @@ def build(options: Options, tmp_path: Path) -> None:
418
418
build_options = options .build_options (config .identifier )
419
419
build_frontend = build_options .build_frontend or BuildFrontendConfig ("build" )
420
420
421
- if (
422
- config .identifier .startswith ("gp" )
423
- and build_frontend .name == "build"
424
- and "--no-isolation" not in build_frontend .args
425
- and "-n" not in build_frontend .args
426
- ):
427
- # GraalPy fails to discover its standard library when a venv is created
428
- # from a virtualenv seeded executable. See
429
- # https://github.com/oracle/graalpython/issues/491 and remove this once
430
- # fixed upstream.
431
- build_frontend = BuildFrontendConfig ("build[uv]" , build_frontend .args )
432
-
433
421
use_uv = build_frontend .name == "build[uv]" and can_use_uv (config )
434
422
log .build_start (config .identifier )
435
423
@@ -482,6 +470,22 @@ def build(options: Options, tmp_path: Path) -> None:
482
470
build_frontend , build_options .build_verbosity , build_options .config_settings
483
471
)
484
472
473
+ if (
474
+ config .identifier .startswith ("gp" )
475
+ and build_frontend .name == "build"
476
+ and "--no-isolation" not in extra_flags
477
+ and "-n" not in extra_flags
478
+ ):
479
+ # GraalPy fails to discover its standard library when a venv is created
480
+ # from a virtualenv seeded executable. See
481
+ # https://github.com/oracle/graalpython/issues/491 and remove this once
482
+ # fixed upstream.
483
+ log .notice (
484
+ "Disabling build isolation to workaround GraalPy bug. If the build fails, consider using pip or build[uv] as build frontend."
485
+ )
486
+ shell ("graalpy -m pip install setuptools wheel" , env = env )
487
+ extra_flags = [* extra_flags , "-n" ]
488
+
485
489
build_env = env .copy ()
486
490
if not use_uv :
487
491
build_env ["VIRTUALENV_PIP" ] = pip_version
0 commit comments