Skip to contentSkip to conversation

kbuild: install-extmod-build: Fix when given dir outside the build dir

PATCH Applied James Le Cuirot 3 participants 3 messages Oct 16, 2025 – Oct 25, 2025 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: install-extmod-build: Fix when given dir outside the build dir

Commit b5e395653546 ("kbuild: install-extmod-build: Fix build when specifying KBUILD_OUTPUT") tried to address the "build" variable expecting a relative path by using realpath --relative-base=., but this only works when the given directory is below the current directory. realpath --relative-to=. will return a relative path in all cases.

Fixes b5e395653546 ("kbuild: install-extmod-build: Fix build when specifying KBUILD_OUTPUT")
---
 scripts/package/install-extmod-build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/package/install-extmod-build +1 -1
index b96538787f3d..054fdf45cc37 100755
@@ -63,7 +63,7 @@ if [ "${CC}" != "${HOSTCC}" ]; then
 	# Clear VPATH and srcroot because the source files reside in the output
 	# directory.
 	# shellcheck disable=SC2016 # $(MAKE) and $(build) will be expanded by Make
-	"${MAKE}" run-command KBUILD_RUN_COMMAND='+$(MAKE) HOSTCC='"${CC}"' VPATH= srcroot=. $(build)='"$(realpath --relative-base=. "${destdir}")"/scripts
+	"${MAKE}" run-command KBUILD_RUN_COMMAND='+$(MAKE) HOSTCC='"${CC}"' VPATH= srcroot=. $(build)='"$(realpath --relative-to=. "${destdir}")"/scripts
 
 	rm -f "${destdir}/scripts/Kbuild"
 fi
Signature · 1 line
2.51.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · James Le Cuirot

Commit b5e395653546 ("kbuild: install-extmod-build: Fix build when specifying KBUILD_OUTPUT") tried to address the "build" variable expecting a relative path by using realpath --relative-base=., but this only works when the given directory is below the current directory. realpath --relative-to=. will return a relative path in all cases.

Fixes b5e395653546 ("kbuild: install-extmod-build: Fix build when specifying KBUILD_OUTPUT")
---
 scripts/package/install-extmod-build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks!

maintainer Applied
#2 lore raw
In reply to James Le Cuirot
Quoted 8 lines · James Le Cuirot

Commit b5e395653546 ("kbuild: install-extmod-build: Fix build when specifying KBUILD_OUTPUT") tried to address the "build" variable expecting a relative path by using realpath --relative-base=., but this only works when the given directory is below the current directory. realpath --relative-to=. will return a relative path in all cases.

[...]

Applied, thanks!

[1/1] kbuild: install-extmod-build: Fix when given dir outside the build dir

      https://git.kernel.org/kbuild/c/5ff90d427ef84

Best regards,

Signature · 1 line
Nathan Chancellor <[email protected]>