From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::244; helo=mail-wr0-x244.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::244]) (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 54A6A211F8891 for ; Wed, 27 Jun 2018 02:43:36 -0700 (PDT) Received: by mail-wr0-x244.google.com with SMTP id c13-v6so1339977wrq.2 for ; Wed, 27 Jun 2018 02:43:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=bPFs5Ql5QBmd2ssYVnPdewyudjgcx6nCnaV1R5lUK8U=; b=emCiG6ISU8xHZt/Pikt+E2604nYnj9P/zk+PkuE5bxTQz5V6jbix1P98iTeimLKIpk nfa8u5cNiE/i+tbV75JDvNFdqeH9M6jXc5V4lObZ9R4pZn97SEODfKnAq0BJr2bamg8q JQ7SnXZ10mI+We4z2SsGKc9jQTWJI2rJghoDM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=bPFs5Ql5QBmd2ssYVnPdewyudjgcx6nCnaV1R5lUK8U=; b=f2qlPPDuiqg3Lu5lqN6iF4ZKIiCt5H1T5YLZUoN/63LEMpZXP2T6zVA1JsKUd8xJah m8Z1yNCoRMEZ64pscARwIcKZ7YyZjMcxjgMovQF8tN9KvTIETY5kJ1pE63ZiiK4gSopm DA3uO9SfM0gaWXhZCxTmYIc3tS5LkFIa+B1iT5y5TWHvUt1F4PAneGGwK43bVOQJ7O5w +CUyboVhPaDrLl2e5XYNBz8AujMAjKT6TnfKfHWrw9BoX1On7TOkPTE5spRQDfHPXzew LaPqBoBNrXVN1/UggN3aZC6r6EEP5v7/qn2FqgB5Mg6FewduaFFNWCOkBRXmpl8i9R8X MeNQ== X-Gm-Message-State: APt69E02MZK6dlA02oqV5PCJgGtbCe6E5GiZyXL7h1lvh2rhdTK6hP2R lSyUxs6T8IlN++d7SK2YNdtwzXqNesA= X-Google-Smtp-Source: AAOMgpeDcIUxwb4QLZ+gNyR2XroLwNQHWP1pxCT6hJ/dBCWC95pCrOta0LPIKSODNa1q65bcugAdFw== X-Received: by 2002:adf:f88d:: with SMTP id u13-v6mr4345977wrp.237.1530092615277; Wed, 27 Jun 2018 02:43:35 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id d10-v6sm6178050wrj.38.2018.06.27.02.43.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Jun 2018 02:43:34 -0700 (PDT) Date: Wed, 27 Jun 2018 10:43:32 +0100 From: Leif Lindholm To: Chris Co , sami.mujawar@arm.com Cc: "edk2-devel@lists.01.org" , Yonghong Zhu , Liming Gao , evan.lloyd@arm.com Message-ID: <20180627094332.fh5dt3cabrieyxmt@bivouac.eciton.net> References: <20180627035753.49848-1-christopher.co@microsoft.com> <20180627035753.49848-2-christopher.co@microsoft.com> MIME-Version: 1.0 In-Reply-To: <20180627035753.49848-2-christopher.co@microsoft.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [PATCH v1 1/1] BaseTools/Trim: Canonicalize filepaths to fix comparison X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2018 09:43:37 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sami, Evan? I think we need your input/review here. On Wed, Jun 27, 2018 at 03:58:06AM +0000, Chris Co wrote: > When using Linaro GCC5+ arm-eabi toolchain on Windows, the generated > DSDT.iii contains a canonicalized ("\.\" removed and lower case) > filepath for the preprocessed DSDT.i file in the first line. > Due to this, when Trim.exe is called to generate DSDT.iiii, future > filepath comparisons against this canonicalized filepath, which > should match, actually fail the comparison which results in an > empty DSDT.iiii. > > Issue was first reported to Linaro here: > https://bugs.linaro.org/show_bug.cgi?id=2909 > where the recommendation was to address the issue in Trim.exe. > > This patch canonicalizes and lower cases all file paths encountered > during trim execution on preprocessed files. Since file paths are > standarized, the comparison succeeds for files that should match > regardless of the presence of upper case or "\.\" characters in > the file path. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Christopher Co > Cc: Leif Lindholm > Cc: Yonghong Zhu > Cc: Liming Gao > --- > BaseTools/Source/Python/Trim/Trim.py | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/BaseTools/Source/Python/Trim/Trim.py b/BaseTools/Source/Python/Trim/Trim.py > index a74075859148..cca4e5c9694a 100644 > --- a/BaseTools/Source/Python/Trim/Trim.py > +++ b/BaseTools/Source/Python/Trim/Trim.py > @@ -166,6 +166,8 @@ def TrimPreprocessedFile(Source, Target, ConvertHex, TrimLong): > if len(MatchList) == 2: > LineNumber = int(MatchList[0], 0) > InjectedFile = MatchList[1] > + InjectedFile = InjectedFile.replace("\\.\\","") > + InjectedFile = InjectedFile.lower() > # The first injetcted file must be the preprocessed file itself > if PreprocessedFile == "": > PreprocessedFile = InjectedFile > -- > 2.16.2.gvfs.1.33.gf5370f1 >