Mesa (master): scons: Print a deprecation warning about using scons on not windows

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Oct 24 18:35:27 UTC 2019


Module: Mesa
Branch: master
Commit: 54053bc8d0dad89a38e2179050831f64a02ea4ec
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=54053bc8d0dad89a38e2179050831f64a02ea4ec

Author: Dylan Baker <dylan at pnwbakers.com>
Date:   Mon Oct 21 09:29:23 2019 -0700

scons: Print a deprecation warning about using scons on not windows

At this point meson should be able to handle all of the non-windows
platforms just fine; we'd like to be able to stop maintaining scons for
those platforms sooner than later.

Reviewed-by: Eric Anholt <eric at anholt.net>

---

 .gitlab-ci.yml            |  4 ++--
 .gitlab-ci/scons-build.sh |  4 ++--
 SConstruct                | 14 ++++++++++++++
 common.py                 |  1 +
 4 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f8c16dc0f51..a08a33f60f7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -377,9 +377,9 @@ scons:
   extends: .scons-build
   variables:
     SCONS_TARGET: "llvm=1"
-    SCONS_CHECK_COMMAND: "scons llvm=1 check"
+    SCONS_CHECK_COMMAND: "scons llvm=1 force_scons=1 check"
   script:
-    - SCONS_TARGET="" SCONS_CHECK_COMMAND="scons check" .gitlab-ci/scons-build.sh
+    - SCONS_TARGET="" SCONS_CHECK_COMMAND="scons check force_scons=1" .gitlab-ci/scons-build.sh
     - LLVM_VERSION=6.0 .gitlab-ci/scons-build.sh
     - LLVM_VERSION=7 .gitlab-ci/scons-build.sh
     - LLVM_VERSION=8 .gitlab-ci/scons-build.sh
diff --git a/.gitlab-ci/scons-build.sh b/.gitlab-ci/scons-build.sh
index 30e93c2bb38..ac62b2cbeba 100755
--- a/.gitlab-ci/scons-build.sh
+++ b/.gitlab-ci/scons-build.sh
@@ -8,5 +8,5 @@ if test -n "$LLVM_VERSION"; then
 fi
 
 rm -rf build
-scons $SCONS_TARGET
-eval $SCONS_CHECK_COMMAND
+scons $SCONS_TARGET force_scons=on
+eval $SCONS_CHECK_COMMAND 
diff --git a/SConstruct b/SConstruct
index 207794c3eb3..aeb1309d464 100644
--- a/SConstruct
+++ b/SConstruct
@@ -67,6 +67,20 @@ else:
 
 Help(opts.GenerateHelpText(env))
 
+
+#######################################################################
+# Print a deprecation warning for using scons on non-windows
+
+if common.host_platform != 'windows':
+    force = ARGUMENTS['force_scons']
+    if force.lower() not in {'false', 'off', 'none', '0', 'n'}:
+        print("WARNING: Scons is deprecated for non-windows platforms (including cygwin) "
+              "please use meson instead.", file=sys.stderr)
+    else:
+        print("ERROR: Scons is deprecated for non-windows platforms (including cygwin) "
+              "please use meson instead. If you really need to use scons you "
+              "can add `force_scons=1` to the scons command line.", file=sys.stderr)
+        sys.exit(1)
 #######################################################################
 # Environment setup
 
diff --git a/common.py b/common.py
index 51dba9c3ca0..b7762cb4e94 100644
--- a/common.py
+++ b/common.py
@@ -112,6 +112,7 @@ def AddOptions(opts):
     opts.Add(BoolOption('asan', 'enable Address Sanitizer', 'no'))
     opts.Add('toolchain', 'compiler toolchain', default_toolchain)
     opts.Add(BoolOption('llvm', 'use LLVM', default_llvm))
+    opts.Add(BoolOption('force_scons', 'Force enable scons on deprecated platforms', 'false'))
     opts.Add(BoolOption('openmp', 'EXPERIMENTAL: compile with openmp (swrast)',
                         'no'))
     opts.Add(BoolOption('debug', 'DEPRECATED: debug build', 'yes'))




More information about the mesa-commit mailing list