From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web12.18645.1577341790868815591 for ; Wed, 25 Dec 2019 22:29:51 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: zhijux.fan@intel.com) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Dec 2019 22:29:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,358,1571727600"; d="dat'59?scan'59,208,59";a="212292142" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga008.jf.intel.com with ESMTP; 25 Dec 2019 22:29:49 -0800 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 25 Dec 2019 22:29:49 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 25 Dec 2019 22:29:48 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.19]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.222]) with mapi id 14.03.0439.000; Thu, 26 Dec 2019 14:29:47 +0800 From: "Fan, ZhijuX" To: "devel@edk2.groups.io" CC: "Gao, Liming" , "Feng, Bob C" Subject: [PATCH] BaseTools:Reconfig reset environment value set by edksetup script Thread-Topic: [PATCH] BaseTools:Reconfig reset environment value set by edksetup script Thread-Index: AdW7tdy7enFYllonQCaNBpYu22HWpA== Date: Thu, 26 Dec 2019 06:29:46 +0000 Message-ID: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: zhijux.fan@intel.com X-Groupsio-MsgNum: 52576 Content-Type: multipart/mixed; boundary="_000_FAD0D7E0AE0FA54D987F6E72435CAFD50AFF4C65SHSMSX101ccrcor_" Content-Language: en-US --_000_FAD0D7E0AE0FA54D987F6E72435CAFD50AFF4C65SHSMSX101ccrcor_ Content-Type: text/plain; charset="windows-1256" Content-Transfer-Encoding: quoted-printable BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=3D1985 Reconfig option should not only update build config files. This option should reset environment value set by edksetup script, such as EDK_TOOLS_PATH/PYTHONPATH. If so, this option will be valuable for the user to switch the different WORKSPACEs. We can locate BASETOOLS by setting the WORKSPACE in a directory separate from BASETOOLS,but it can't switch workspaces. for example, set WORKSPACE=3DC:\work\edk2 in directory C:\ run C:\work\edk2\edksetup in directory C:\ switch workspaces, set WORKSPACE=3DC:\workspace\edk2 run C:\workspace\edk2\edksetup in directory C:\ This situation does not apply with Reconfig, So I use the "clean" option to clear the environment variables associated with edksetup run "C:\workspace\edk2\edksetup clean" in directory C:\, run "C:\workspace\edk2\edksetup" in directory C:\ This patch is going to fix that issue. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Zhiju.Fan --- edksetup.bat | 28 ++++++++++++++++++++++++++-- edksetup.sh | 31 ++++++++++++++++++++++++++++--- 2 files changed, 54 insertions(+), 5 deletions(-) diff --git a/edksetup.bat b/edksetup.bat index 024f57a4b7..97b55659ac 100755 --- a/edksetup.bat +++ b/edksetup.bat @@ -25,6 +25,29 @@ pushd . cd %~dp0 =20 +if /I "%1" NEQ "Reconfig" ( + if /I "%1" NEQ "EnvClean" ( + goto SetEnv + ) + ) + +set EDK_TOOLS_BIN=3D +set CONF_PATH=3D +set BASETOOLS_PYTHON_SOURCE=3D +set EDK_TOOLS_PATH=3D +set WORKSPACE=3D + +if /I "%1"=3D=3D"Reconfig" ( + echo reset environment value set by edksetup script + goto SetEnv +) + +if /I "%1"=3D=3D"EnvClean" ( + echo clean environment value set by edksetup script + goto end +) + +:SetEnv if not defined WORKSPACE ( goto SetWorkSpace ) @@ -142,9 +165,10 @@ if "%1"=3D=3D"" goto end =20 :Usage @echo. - @echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [Reconfig] [Re= build] [ForceRebuild] [VS2019] [VS2017] [VS2015] [VS2013] [VS2012]" + @echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [Reconfig] [Re= build] [EnvClean] [ForceRebuild] [VS2019] [VS2017] [VS2015] [VS2013] [VS201= 2]" @echo. - @echo Reconfig Reinstall target.txt, tools_def.txt and bui= ld_rule.txt. + @echo Reconfig Reinstall target.txt, tools_def.txt=EF=BC= =8C build_rule.txt and reset environment value set by edksetup script. + @echo EnvClean Clean environment value by edksetup script. @echo Rebuild Perform incremental rebuild of BaseTools bi= naries. @echo ForceRebuild Force a full rebuild of BaseTools binaries. @echo VS2012 Set the env for VS2012 build. diff --git a/edksetup.sh b/edksetup.sh index 06d2f041e6..10ce6fb752 100755 --- a/edksetup.sh +++ b/edksetup.sh @@ -33,6 +33,8 @@ function HelpMsg() echo " --reconfig Overwrite the WORKSPACE/Conf/*.txt files w= ith the" echo " template files from the BaseTools/Conf dir= ectory." echo + echo " --envclean Clean environment value by edksetup script= ." + echo echo Please note: This script must be \'sourced\' so the environment can= be changed. echo ". $SCRIPTNAME" echo "source $SCRIPTNAME" @@ -44,6 +46,20 @@ function SetWorkspace() # If WORKSPACE is already set, then we can return right now # export PYTHONHASHSEED=3D1 + if [ -n $RECONFIG ] + then + echo reset environment value set by edksetup script + WORKSPACE=3D + CONF_PATH=3D + fi + + if [ -n $ENVCLEAN ] + then + echo clean environment value by edksetup script + WORKSPACE=3D + CONF_PATH=3D + return 0 + fi if [ -n "$WORKSPACE" ] then return 0 @@ -177,9 +193,14 @@ function SetupPython() =20 function SourceEnv() { - SetWorkspace && - SetupEnv - SetupPython + if [ -n $ENVCLEAN ] + then + SetWorkspace + else + SetWorkspace && + SetupEnv + SetupPython + fi } =20 I=3D$# @@ -194,6 +215,10 @@ do RECONFIG=3DTRUE shift ;; + --envclean) + ENVCLEAN=3DTRUE + shift + ;; *) HelpMsg break --=20 2.14.1.windows.1 --_000_FAD0D7E0AE0FA54D987F6E72435CAFD50AFF4C65SHSMSX101ccrcor_ Content-Disposition: attachment; filename="winmail.dat" Content-Transfer-Encoding: base64 Content-Type: application/ms-tnef; name="winmail.dat" eJ8+Ih5EAQaQCAAEAAAAAAABAAEAAQeQBgAIAAAA6AQAAAAAAADsAAEJgAEAIQAAADNENDMzNzk2 Nzg5RDk0NDVBODgyMDJDNDczMjhCMTg1AOkGAQ2ABAACAAAAAgACAAEFgAMADgAAAOMHDAAaAAYA HQAuAAQAZQEBIIADAA4AAADjBwwAGgAGAB0ALgAEAGUBAQiABwAYAAAASVBNLk1pY3Jvc29mdCBN YWlsLk5vdGUAMQgBBIABAEoAAABbUEFUQ0hdIEJhc2VUb29sczpSZWNvbmZpZyByZXNldCBlbnZp cm9ubWVudCB2YWx1ZSBzZXQgYnkgZWRrc2V0dXAgc2NyaXB0ADEbAQuAAQAhAAAAM0Q0MzM3OTY3 ODlEOTQ0NUE4ODIwMkM0NzMyOEIxODUA6QYBA5AGABwTAAA0AAAAAgF/AAEAAABIAAAAPEZBRDBE N0UwQUUwRkE1NEQ5ODdGNkU3MjQzNUNBRkQ1MEFGRjRDNjVAU0hTTVNYMTAxLmNjci5jb3JwLmlu dGVsLmNvbT4ACwAfDgEAAAACAQkQAQAAANkIAADVCAAA0xQAAExaRnWYq8D5YQAKZmJpZAQAAGNj wHBnMTI1MgD+A0PwdGV4dAH3AqQD4wIABGNoCsBzZXQwIO8HbQKDAFARTTIKgAa0AoCWfQqACMg7 CWIxOQ7AvwnDFnIKMhZxAoAVYioJsHMJ8ASQYXQFsg5QA2Bzom8BgCBFeBHBbhgwXQZSdgSQF7YC EHIAwHR9CFBuGjEQIAXABaAbZGSa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