[llvm] [gn] Use exec_script_allowlist in //llvm/utils/gn/.gn (PR #134172)

Dirk Pranke via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 7 10:27:26 PDT 2025


https://github.com/dpranke updated https://github.com/llvm/llvm-project/pull/134172

>From 19b4d32dd6ebe345bd2e87a8a5767b431e25528a Mon Sep 17 00:00:00 2001
From: Dirk Pranke <dpranke at gmail.com>
Date: Wed, 2 Apr 2025 15:59:24 -0700
Subject: [PATCH 1/2] Update .gn

Use exec_script_allowlist in //llvm/utils/gn/.gn

GN is moving to use exec_script_allowlist instead of exec_script_whitelist everywhere.

See crbug.com/389986807
---
 llvm/utils/gn/.gn | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/utils/gn/.gn b/llvm/utils/gn/.gn
index 4eccc2fc168c0..3abc0f6306585 100644
--- a/llvm/utils/gn/.gn
+++ b/llvm/utils/gn/.gn
@@ -6,7 +6,7 @@ buildconfig = "//llvm/utils/gn/build/BUILDCONFIG.gn"
 
 # Disallow all calls to exec_script. We should be very conservative about
 # whitelisting things here.
-exec_script_whitelist = []
+exec_script_allowlist = []
 
 # Execute action() targets using Python 3.
 script_executable = "python3"

>From fd1e8b6053bc439a96179b5d2b869b36f4202864 Mon Sep 17 00:00:00 2001
From: Dirk Pranke <dpranke at gmail.com>
Date: Mon, 7 Apr 2025 10:27:18 -0700
Subject: [PATCH 2/2] Update BUILD.gn

Remove version check from utils/gn/build/toolchain/BUILD.gn
---
 llvm/utils/gn/build/toolchain/BUILD.gn | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/llvm/utils/gn/build/toolchain/BUILD.gn b/llvm/utils/gn/build/toolchain/BUILD.gn
index ce2e6df1b69f5..00d9df12f5a97 100644
--- a/llvm/utils/gn/build/toolchain/BUILD.gn
+++ b/llvm/utils/gn/build/toolchain/BUILD.gn
@@ -71,23 +71,6 @@ template("unix_toolchain") {
       default_output_dir = "{{root_out_dir}}/lib"
     }
 
-    if (current_os == "ios" || current_os == "mac") {
-      # gn < 1693 (e214b5d35898) doesn't support |frameworks|, requiring
-      # frameworks to be listed in |libs|, but gn >= 1808 (3028c6a426a4) forbids
-      # frameworks from appearing in |libs|. This assertion provides a helpful
-      # cue to upgrade, and is much more user-friendly than the failure that
-      # occurs when an older gn encounters |frameworks|.
-      #
-      # gn_version doesn’t actually exist in gn < 1709 (52cb644a3fb4), and
-      # defined(gn_version) doesn't actually work as expected
-      # (https://crbug.com/gn/183), so 1709 is the true minimum enforced by
-      # this construct, and if gn_version is not available, this line will still
-      # be blamed, making the resolution somewhat discoverable.
-      assert(gn_version >= 1693,
-             "Your GN is too old! " +
-                 "Update it, perhaps by running llvm/utils/gn/get.py")
-    }
-
     # Make these apply to all tools below.
     lib_switch = "-l"
     lib_dir_switch = "-L"



More information about the llvm-commits mailing list