From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 179801A1E2A for ; Wed, 19 Oct 2016 23:58:42 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 19 Oct 2016 23:58:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,517,1473145200"; d="scan'208,217";a="1073031894" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga002.fm.intel.com with ESMTP; 19 Oct 2016 23:58:42 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 19 Oct 2016 23:58:40 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.206]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.2]) with mapi id 14.03.0248.002; Thu, 20 Oct 2016 14:58:39 +0800 From: "Gao, Liming" To: Leif Lindholm , Ard Biesheuvel CC: Michael Zimmermann , edk2-devel-01 , "Kinney, Michael D" , Andrew Fish Thread-Topic: [edk2] [RFC] edksetup.sh: detect updated BaseTools templates Thread-Index: AQHSKgNMJNNnm1rhgky9g7WI+7FrIKCw6Thg Date: Thu, 20 Oct 2016 06:58:38 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14B49716F@shsmsx102.ccr.corp.intel.com> References: <20160904154135.4324-1-leif.lindholm@linaro.org> <20161019122112.GG3471@bivouac.eciton.net> In-Reply-To: <20161019122112.GG3471@bivouac.eciton.net> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 Subject: Re: [RFC] edksetup.sh: detect updated BaseTools templates X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 06:58:42 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Leif: Windows edksetup.bat has option Reconfig to always copy template files to= Conf directory. For Linux, I suggest to add Reconfig option to edksetup.sh= , then let user use this way. Thanks Liming From: Leif Lindholm [mailto:leif.lindholm@linaro.org] Sent: Wednesday, October 19, 2016 8:21 PM To: Ard Biesheuvel Cc: Michael Zimmermann ; edk2-devel-01 ; Gao, Liming ; Kinney, Michael D ; Andrew Fish Subject: Re: [edk2] [RFC] edksetup.sh: detect updated BaseTools templates So, this thread kind of petered out... I had an internal report of a user failing to build ArmVirtQemu, and narrowed it down to a case of outdated cached configurations. As a temporary workaround, I've now put the proposed timestamp check into my uefi-tools helper scripts, but that's hiding the problem instead of solving it. On Sun, Sep 04, 2016 at 09:35:19PM +0100, Ard Biesheuvel wrote: > On 4 September 2016 at 17:10, Michael Zimmermann > wrote: > >> Could we instead make the files under Conf/ symlinks to the templates? > > Sounds like a good idea in general but what about windows? afaik only N= TFS > > has support for them. > > > > Ah yes, excellent point. > > So perhaps the BaseTools should simply default to the template if the > Conf/ version is missing? I am concerned about breaking people's > workflow where they keep non-trivial local changes in these files. This would absolutely be my preferred solution. Andrew, Mike? / Leif > > On Sun, Sep 4, 2016 at 5:55 PM, Ard Biesheuvel > > wrote: > >> > >> On 4 September 2016 at 16:41, Leif Lindholm > >> wrote: > >> > Make edksetup.sh automatically update the cached configuration under > >> > Conf/ when the templates under BaseTools/Conf/ change. > >> > > >> > Contributed-under: TianoCore Contribution Agreement 1.0 > >> > Signed-off-by: Leif Lindholm > >> > --- > >> > > >> > We keep getting questions from people starting out with EDK2 > >> > development, > >> > whenever certain options in the BaseTools template configs change an= d > >> > their builds break. I don't know if this naive sledgehammer approach= is > >> > acceptable, but I'd like to make life easier for people. > >> > > >> > >> Could we instead make the files under Conf/ symlinks to the templates? > >> That way, people can still keep local changes in these files, which is > >> presumably the reason for this arrangement, while the 'naive' user > >> [with no interest in keeping local changes] does not have to deal with > >> this. > >> > >> > >> > edksetup.sh | 33 +++++++++++++++++++++++++++++++-- > >> > 1 file changed, 31 insertions(+), 2 deletions(-) > >> > > >> > diff --git a/edksetup.sh b/edksetup.sh > >> > index 57368b5..77f0d43 100755 > >> > --- a/edksetup.sh > >> > +++ b/edksetup.sh > >> > @@ -33,12 +33,41 @@ function HelpMsg() > >> > return 1 > >> > } > >> > > >> > +function ClearCache() > >> > +{ > >> > + CONF_FILES=3D"build_rule target tools_def" > >> > + if [ -z "$EDK_TOOLS_PATH" ] > >> > + then > >> > + TEMPLATE_PATH=3D./BaseTools/Conf/ > >> > + else > >> > + TEMPLATE_PATH=3D"$EDK_TOOLS_PATH/Conf/" > >> > + fi > >> > + > >> > + DELETED_FILES=3D0 > >> > + for File in $CONF_FILES > >> > + do > >> > + TEMPLATE_FILE=3D"$TEMPLATE_PATH/$File.template" > >> > + CACHE_FILE=3D"Conf/$File.txt" > >> > + if [ "$TEMPLATE_FILE" -nt "$CACHE_FILE" ] > >> > + then > >> > + echo "Removing outdated '$CACHE_FILE'." > >> > + rm "$CACHE_FILE" > >> > + DELETED_FILES=3D$(($DELETED_FILES + 1)) > >> > + fi > >> > + done > >> > + > >> > + unset TEMPLATE_PATH TEMPLATE_FILE CACHE_FILE > >> > + return $DELETED_FILES > >> > +} > >> > + > >> > function SetWorkspace() > >> > { > >> > # > >> > - # If WORKSPACE is already set, then we can return right now > >> > + # Check for updated BaseTools templates. If none, and > >> > + # WORKSPACE is already set, then we can return right now > >> > # > >> > - if [ -n "$WORKSPACE" ] > >> > + ClearCache > >> > + if [ $? -ne 0 -a -n "$WORKSPACE" ] > >> > then > >> > return 0 > >> > fi > >> > -- > >> > 2.9.3 > >> > > >> _______________________________________________ > >> edk2-devel mailing list > >> edk2-devel@lists.01.org > >> https://lists.01.org/mailman/listinfo/edk2-devel > > > >