toolchain-scripts-mingw32.bbclass: Remove trailing slash in SDKROOT
PATCH 1/1 toolchain-scripts-mingw32.bbclass: Remove trailing slash in SDKROOT
Modify toolchain-scripts-mingw32.bbclass to add a check in
environment-setup script which removes trailing slash in
path of SDKROOT.
This is needed to avoid multiple adjacent slashes in paths
which are produced by appending to SDKROOT.
In reference to https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file?redirectedfrom=MSDN
naming convention used for paths and disk drives in windows
should use a single backslash. Even though in some cases windows
ignores double slashes in paths and it might work but it isn't
documented as a right naming convention and does fail in some
cases eg. dir command cannot interpret double slashes and fails.
For example if my SDK is located in D: drive, the environment setup scripts sets "SDKROOT=D:\" and hence SDKTARGETSYSROOT gets set as "SDKTARGETSYSROOT=D:\\sysroots\armv8a-oe-linux" The introduced check removes additional slash in SDKROOT to set it as "SDKROOT=D:" so all other variables using SDKROOT get set without additional slash.
--- classes/toolchain-scripts-mingw32.bbclass | 1 + 1 file changed, 1 insertion(+)
classes/toolchain-scripts-mingw32.bbclass +1 -0
@@ -12,6 +12,7 @@ toolchain_create_sdk_env_script:sdkmingw32 () { touch $script # Be sure to use the 'short' path, so we can have deeper directories. echo 'set SDKROOT=%~sdp0%' >> $script + echo 'IF %SDKROOT:~-1%==\ set SDKROOT=%SDKROOT:~0,-1%' >> $script # Convert to mingw32 subpaths sysroot='%SDKROOT%'${sysroot##${SDKPATH}}
Signature · 1 line
2.25.1
Hi,
Any update on this?
-----Original Message-----
From: Hamza, Muhammad <[email protected]>
Sent: Monday, October 24, 2022 11:03 AM
To: [email protected]
Cc: [email protected]; Hamza, Muhammad <[email protected]>
Subject: [meta-mingw][kirkstone][PATCH] toolchain-scripts-mingw32.bbclass: Remove trailing slash in SDKROOT
Modify toolchain-scripts-mingw32.bbclass to add a check in environment-setup script which removes trailing slash in path of SDKROOT.
This is needed to avoid multiple adjacent slashes in paths which are produced by appending to SDKROOT.
In reference to https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file?redirectedfrom=MSDN
naming convention used for paths and disk drives in windows should use a single backslash. Even though in some cases windows ignores double slashes in paths and it might work but it isn't documented as a right naming convention and does fail in some cases eg. dir command cannot interpret double slashes and fails.
For example if my SDK is located in D: drive, the environment setup scripts sets "SDKROOT=D:\" and hence SDKTARGETSYSROOT gets set as "SDKTARGETSYSROOT=D:\\sysroots\armv8a-oe-linux" The introduced check removes additional slash in SDKROOT to set it as "SDKROOT=D:" so all other variables using SDKROOT get set without additional slash.
--- classes/toolchain-scripts-mingw32.bbclass | 1 + 1 file changed, 1 insertion(+)
classes/toolchain-scripts-mingw32.bbclass +1 -0
@@ -12,6 +12,7 @@ toolchain_create_sdk_env_script:sdkmingw32 () { touch $script # Be sure to use the 'short' path, so we can have deeper directories. echo 'set SDKROOT=%~sdp0%' >> $script + echo 'IF %SDKROOT:~-1%==\ set SDKROOT=%SDKROOT:~0,-1%' >> $script # Convert to mingw32 subpaths sysroot='%SDKROOT%'${sysroot##${SDKPATH}}
--
2.25.1
Ya, I queued it in master-next. Let me run it through the AB then we can merge it
Quoted 39 lines · Muhammad
Hi,
Any update on this?-----Original Message-----
From: Hamza, Muhammad <[email protected]>
Sent: Monday, October 24, 2022 11:03 AM
To: [email protected]
Cc: [email protected]; Hamza, Muhammad <[email protected]>
Subject: [meta-mingw][kirkstone][PATCH] toolchain-scripts-mingw32.bbclass: Remove trailing slash in SDKROOTModify toolchain-scripts-mingw32.bbclass to add a check in environment-setup script which removes trailing slash in path of SDKROOT.
This is needed to avoid multiple adjacent slashes in paths which are produced by appending to SDKROOT.
In reference to https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file?redirectedfrom=MSDN
naming convention used for paths and disk drives in windows should use a single backslash. Even though in some cases windows ignores double slashes in paths and it might work but it isn't documented as a right naming convention and does fail in some cases eg. dir command cannot interpret double slashes and fails.For example if my SDK is located in D: drive, the environment setup scripts sets "SDKROOT=D:\" and hence SDKTARGETSYSROOT gets set as "SDKTARGETSYSROOT=D:\\sysroots\armv8a-oe-linux" The introduced check removes additional slash in SDKROOT to set it as "SDKROOT=D:" so all other variables using SDKROOT get set without additional slash.
Signed-off-by Muhammad Hamza <[email protected]>--- classes/toolchain-scripts-mingw32.bbclass | 1 + 1 file changed, 1 insertion(+)classes/toolchain-scripts-mingw32.bbclass +1
-1@@ -12,6 +12,7 @@ toolchain_create_sdk_env_script:sdkmingw32 () { touch $script # Be sure to use the 'short' path, so we can have deeper directories. echo 'set SDKROOT=%~sdp0%' >> $script + echo 'IF %SDKROOT:~-1%==\ set SDKROOT=%SDKROOT:~0,-1%' >> $script # Convert to mingw32 subpaths sysroot='%SDKROOT%'${sysroot##${SDKPATH}} --2.25.1
All right, thanks.
-----Original Message-----
From: Joshua Watt <[email protected]>
Sent: Friday, October 28, 2022 5:45 PM
To: Hamza, Muhammad <[email protected]>
Cc: [email protected]
Subject: Re: [meta-mingw][kirkstone][PATCH] toolchain-scripts-mingw32.bbclass: Remove trailing slash in SDKROOT
Ya, I queued it in master-next. Let me run it through the AB then we can merge it
Quoted 44 lines · Muhammad
Hi,
Any update on this?-----Original Message-----
From: Hamza, Muhammad <[email protected]>
Sent: Monday, October 24, 2022 11:03 AM
To: [email protected]
Cc: [email protected]; Hamza, Muhammad <[email protected]>
Subject: [meta-mingw][kirkstone][PATCH] toolchain-scripts-mingw32.bbclass: Remove trailing slash in SDKROOTModify toolchain-scripts-mingw32.bbclass to add a check in environment-setup script which removes trailing slash in path of SDKROOT.
This is needed to avoid multiple adjacent slashes in paths which are produced by appending to SDKROOT.
In reference to
https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file?r
edirectedfrom=MSDN naming convention used for paths and disk drives in
windows should use a single backslash. Even though in some cases windows ignores double slashes in paths and it might work but it isn't documented as a right naming convention and does fail in some cases eg. dir command cannot interpret double slashes and fails.For example if my SDK is located in D: drive, the environment setup scripts sets "SDKROOT=D:\" and hence SDKTARGETSYSROOT gets set as "SDKTARGETSYSROOT=D:\\sysroots\armv8a-oe-linux" The introduced check removes additional slash in SDKROOT to set it as "SDKROOT=D:" so all other variables using SDKROOT get set without additional slash.
Signed-off-by Muhammad Hamza <[email protected]>--- classes/toolchain-scripts-mingw32.bbclass | 1 + 1 file changed, 1 insertion(+)classes/toolchain-scripts-mingw32.bbclass +2
-1@@ -12,6 +12,7 @@ toolchain_create_sdk_env_script:sdkmingw32 () { touch $script # Be sure to use the 'short' path, so we can have deeper directories. echo 'set SDKROOT=%~sdp0%' >> $script + echo 'IF %SDKROOT:~-1%==\ set SDKROOT=%SDKROOT:~0,-1%' >> + $script # Convert to mingw32 subpaths sysroot='%SDKROOT%'${sysroot##${SDKPATH}} --2.25.1