#16357 closed defect (fixed)
kBuild: abspathex is broken on Windows 10
Reported by: | IndyJones | Owned by: | |
---|---|---|---|
Component: | other | Version: | VirtualBox 5.1.12 |
Keywords: | build, kbuild, kmk | Cc: | |
Guest type: | other | Host type: | Windows |
Description
The abspathex in kBuild is broken when running on a Windows 10 x64 machine. The function always expands short paths which results in the build to fail. Here is an example (taken from footer-pass2-compiling-targets.kmk):
# Adjust paths if we got a default path. ifneq ($(defpath),) local libpath := $(abspathex $(libpath),$(defpath)) local deps := $(abspathex $(deps),$(defpath)) local orderdeps := $(abspathex $(orderdeps),$(defpath)) othersrc := $(abspathex $(othersrc),$(defpath)) # libs are not subject to this because of the the -l<lib> stuff. Use $(<target>_DEFPATH)/lib if relative to current dir! endif
libpath's value before calling abspath: C:/PROGRA~2/MICROS~3/Windows/v7.1A/Lib libpath's value after calling abspath: C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1A/Lib
This results in an invalid libpath containing blanks which will later on cause the build to produce following compiler command line and fail:
C:/PROGRA~2/MICROS~4.0/VC/bin/link.exe -nologo -machine:x86 -Ignore:4197 /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LargeAddressAware /DynamicBase /NxCompat /Release /Debug /Opt:Ref /Opt:Icf /Version:501.51 /DISALLOWLIB:libcd.lib /DISALLOWLIB:libcmtd.lib /DISALLOWLIB:msvcrt.lib /DISALLOWLIB:msvcrtd.lib /DISALLOWLIB:msvcprt.lib /DISALLOWLIB:msvcprtd.lib /OUT:D:/vbox/out/win.x86/release/obj/bin2c/bin2c.exe /MAPINFO:EXPORTS /INCREMENTAL:NO /MAP:D:/vbox/out/win.x86/release/obj/bin2c/bin2c.map /LIBPATH:C:/Program /LIBPATH:Files /LIBPATH:(x86)/Microsoft /LIBPATH:SDKs/Windows/v7.1A/Lib @D:/vbox/out/win.x86/release/obj/bin2c/bin2c.rsp
Obviously the /LIBPATH arguments at the end are completely screwed due to the blanks in the path.
Also I tried to remove the line "local libpath := $(abspathex $(libpath),$(defpath))"
from footer-pass2-compiling-targets.kmk which allows me to continue the build. However only until the first GUI component (VBoxDbgUI) is built. Then the build fails when the first file is moc'ed - this time with a screwed include path because qt5.kmk also uses abspathex.
This issue is related to https://forums.virtualbox.org/viewtopic.php?f=10&t=81139
Should be fixed in kBuild revision 3025 and later. Hope it works for you too.