From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id EF7521A1E28 for ; Sun, 4 Sep 2016 13:46:23 -0700 (PDT) Received: by mail-wm0-x234.google.com with SMTP id 1so107910208wmz.1 for ; Sun, 04 Sep 2016 13:46:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=v7fH/8s6hvNsb0KEXcdC2ye6J8dCZRzUkDugKKXcgH0=; b=xdKpLROjhXJL3vz3zLbeTw9lnJWO0wJmqZ3+2NJWxJrXy1tof5ZNvttgRg99ch1qvK JrKwx+X7t4wyYTeVFczfdAHA9CyAHPIylQvg6egcKndmB2Qtvn7MtNQlOIGZltGmpRla FltSoxOBbSorr4Y+9SfNTFRw6/1mRGSepRID/gacE37Ou8U+Cs1Z8KCAfk7LawlkZGFr m5vbL2kwL772dGyUIjsN7wfplN/8unos2dMdttCSUPPTRS3j8m38HiAakdXoG7RocMyy C0cdFMwZDTeX7R6mke1TSIAnv+F6z35iARzEVkSHLz5bWmLbuLNoIH7jpo6BAQcR/lGe UXpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=v7fH/8s6hvNsb0KEXcdC2ye6J8dCZRzUkDugKKXcgH0=; b=BWYxZDgVO3U5BzgPViS5M9GAPIRhNAcOw/L2qiSNJ+melqXwWIeoQwWj3C/q1aZafG PNeCsQ+cy9fvWZW/2dh0146bADn8ARJlNPePwYZSjg44g08241GA5YHj9QppDtUlZAUl CLSstNtIktBSZpF8a5C4myrRxL6WbHnfvMtPRpkNSXrZaaBg4FTgCK7N7ngpxuMD+70v gTRz7LzGnwJ0DP9YGxuSqVc+oa1KR1Gbor43S6AfZVPRZeglBvOa/EB8JdigumQXfs/0 qayOinfBnm6e5e74S1Wsj8wCkWwD9yuFUd2Hk25aevHZRYFdBIATB/9CJY+uaMSDtSOh QlkQ== X-Gm-Message-State: AE9vXwPabtbIRm6zZS2HhDGJIz264B6lF2DyxOZTY8Fpy7iHsqGzA5ZkJ2n9V0utRsDGY8bsN0P7cmxc/CTw6A== X-Received: by 10.195.2.42 with SMTP id bl10mr28124779wjd.21.1473021982065; Sun, 04 Sep 2016 13:46:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.0.204 with HTTP; Sun, 4 Sep 2016 13:46:21 -0700 (PDT) In-Reply-To: References: <20160904154135.4324-1-leif.lindholm@linaro.org> From: Michael Zimmermann Date: Sun, 4 Sep 2016 22:46:21 +0200 Message-ID: To: Ard Biesheuvel Cc: Leif Lindholm , edk2-devel-01 , Liming Gao 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: Sun, 04 Sep 2016 20:46:24 -0000 Content-Type: text/plain; charset=UTF-8 what about creating timestamp files(or even checksums if you want to be 100% sure) after copying the templates? so you can check if somebody else modified them. if the timestamp files don't exist you it means that we never copied the templates. On Sun, Sep 4, 2016 at 10:35 PM, 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 > NTFS > > 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. > > > > On Sun, Sep 4, 2016 at 5:55 PM, Ard Biesheuvel < > ard.biesheuvel@linaro.org> > > 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 and > >> > 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="build_rule target tools_def" > >> > + if [ -z "$EDK_TOOLS_PATH" ] > >> > + then > >> > + TEMPLATE_PATH=./BaseTools/Conf/ > >> > + else > >> > + TEMPLATE_PATH="$EDK_TOOLS_PATH/Conf/" > >> > + fi > >> > + > >> > + DELETED_FILES=0 > >> > + for File in $CONF_FILES > >> > + do > >> > + TEMPLATE_FILE="$TEMPLATE_PATH/$File.template" > >> > + CACHE_FILE="Conf/$File.txt" > >> > + if [ "$TEMPLATE_FILE" -nt "$CACHE_FILE" ] > >> > + then > >> > + echo "Removing outdated '$CACHE_FILE'." > >> > + rm "$CACHE_FILE" > >> > + DELETED_FILES=$(($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 > > > > >