From: "Jayaprakash, N" <n.jayaprakash@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
"Jayaprakash, N" <n.jayaprakash@intel.com>,
Pedro Falcato <pedro.falcato@gmail.com>
Cc: Rebecca Cran <rebecca@bsdio.com>,
"Kinney, Michael D" <michael.d.kinney@intel.com>,
Laszlo Ersek <lersek@redhat.com>,
Liming Gao <gaoliming@byosoft.com.cn>,
"Feng, Bob C" <bob.c.feng@intel.com>,
"Chen, Christine" <yuwei.chen@intel.com>
Subject: Re: [edk2-devel] [edk2 Patch 1/1] BaseTools: Syntax warning invalid escape sequence \C
Date: Fri, 9 Feb 2024 10:37:14 +0000 [thread overview]
Message-ID: <PH7PR11MB59438F5D4590262A33D5D700EE4B2@PH7PR11MB5943.namprd11.prod.outlook.com> (raw)
In-Reply-To: <17B176ECA49BD037.2925@groups.io>
Hi Pedro,
Do you agree with the below thoughts? Let me know if you have any questions.
Regards,
JP
-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Jayaprakash, N
Sent: Wednesday, February 7, 2024 8:58 AM
To: Pedro Falcato <pedro.falcato@gmail.com>; devel@edk2.groups.io
Cc: Rebecca Cran <rebecca@bsdio.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Laszlo Ersek <lersek@redhat.com>; Liming Gao <gaoliming@byosoft.com.cn>; Feng, Bob C <bob.c.feng@intel.com>; Chen, Christine <yuwei.chen@intel.com>
Subject: Re: [edk2-devel] [edk2 Patch 1/1] BaseTools: Syntax warning invalid escape sequence \C
Thanks Pedro.
I thought about using / instead of \\ but in many places, the path separator \\ is still used across the code.
But after looking at the usage of path separator in other parts of the code. I decided to go with \\.
For example:
In the same file:
2953 : MakeApp = MakeApp + '%s\\PcdValueCommon.c : %s\n' % (self.OutputPath, PcdValueCommonPath)
2842: if sys.platform == "win32":
MakeApp = MakeApp + 'APPFILE = %s\\%s.exe\n' % (self.OutputPath, PcdValueInitName) + 'APPNAME = %s\n' % (PcdValueInitName) + 'OBJECTS = %s\\%s.obj %s.obj\n' % (self.OutputPath, PcdValueInitName, os.path.join(self.OutputPath, PcdValueCommonName)) + 'INC = '
Hence to align with the usage of path separator for "win32", I have used the \\ instead of /.
Hope this is fine.
Regards,
JP
-----Original Message-----
From: Pedro Falcato <pedro.falcato@gmail.com>
Sent: Tuesday, February 6, 2024 10:14 PM
To: devel@edk2.groups.io; Jayaprakash, N <n.jayaprakash@intel.com>
Cc: Rebecca Cran <rebecca@bsdio.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Laszlo Ersek <lersek@redhat.com>; Liming Gao <gaoliming@byosoft.com.cn>; Feng, Bob C <bob.c.feng@intel.com>; Chen, Christine <yuwei.chen@intel.com>
Subject: Re: [edk2-devel] [edk2 Patch 1/1] BaseTools: Syntax warning invalid escape sequence \C
On Tue, Feb 6, 2024 at 7:02 AM Jayaprakash, N <n.jayaprakash@intel.com> wrote:
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4666
>
> This commit fixes the issue reported through BZ4666.
> The Syntax warning related to invalid escape sequence for \C is seen
> on Windows OS based builds of edk2 sources.
> On Windows the path seperator needs to prefixed with \ so essentially
> we need to use \\ as path seperator.
>
> Cc: Rebecca Cran <rebecca@bsdio.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Yuwei Chen <yuwei.chen@intel.com>
> Cc: Jayaprakash N <n.jayaprakash@intel.com>
> Signed-off-by: Jayaprakash N <n.jayaprakash@intel.com>
> ---
> BaseTools/Source/Python/Workspace/DscBuildData.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py
> b/BaseTools/Source/Python/Workspace/DscBuildData.py
> index 4768099343..b69d406249 100644
> --- a/BaseTools/Source/Python/Workspace/DscBuildData.py
> +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
> @@ -2949,7 +2949,7 @@ class DscBuildData(PlatformBuildClassObject):
> for include_file in IncFileList:
> MakeApp += "$(OBJECTS) : %s\n" % include_file
> if sys.platform == "win32":
> - PcdValueCommonPath = os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "Source\C\Common\PcdValueCommon.c"))
> + PcdValueCommonPath =
> + os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"
> + ], "Source\\C\\Common\\PcdValueCommon.c"))
AIUI, changing the \ to / would also work (and it would be prettier/more readable), since we're calling normpath right after.
--
Pedro
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115300): https://edk2.groups.io/g/devel/message/115300
Mute This Topic: https://groups.io/mt/104193926/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
next prev parent reply other threads:[~2024-02-09 10:37 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-06 7:02 [edk2-devel] [edk2 Patch 0/1] Fix invalid escape sequence \C syntax warning Jayaprakash, N
2024-02-06 7:02 ` [edk2-devel] [edk2 Patch 1/1] BaseTools: Syntax warning invalid escape sequence \C Jayaprakash, N
2024-02-06 14:32 ` Laszlo Ersek
2024-02-06 16:43 ` Pedro Falcato
2024-02-07 3:27 ` Jayaprakash, N
[not found] ` <17B176ECA49BD037.2925@groups.io>
2024-02-09 10:37 ` Jayaprakash, N [this message]
2024-02-09 14:24 ` Pedro Falcato
[not found] ` <17B22B806B304043.15017@groups.io>
2024-02-13 16:24 ` Jayaprakash, N
2024-02-14 15:03 ` Rebecca Cran
2024-02-14 15:10 ` Jayaprakash, N
2024-02-14 17:25 ` Michael D Kinney
2024-02-15 3:47 ` Jayaprakash, N
2024-02-28 0:29 ` Rebecca Cran
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=PH7PR11MB59438F5D4590262A33D5D700EE4B2@PH7PR11MB5943.namprd11.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox