Makefile.in | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
New commits: commit a048d0a149abf6c3684e026304b04a4f7f039721 Author: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> AuthorDate: Mon Jan 20 14:22:43 2025 +0100 Commit: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> CommitDate: Wed Jan 22 19:02:13 2025 +0100 wsl-as-helper: avoid misdetecting builddir!=srcdir with long paths when the user runs wsl.exe ./autogen.sh in a long path, the build initially works OK, it will realize that the build is performed in the source directory. However if another run of wsl.exe ./autogen.sh is triggered by running make (i.e. when configure.ac or some of the other files gets changed), it was run with the shortened version of the path as the value for SRCDIR, and comparing that with the pathname of the current directory (which most likely was browsed to by using the long form) resulted in a misdetection of the builddir != srcdir case, and autogen.sh did try to create the necessary symlinks and <module>/Makefile and external/*/Makefile files as if building in a separate build directory. Especially the self-referencing symlink in the include dir then caused some parts of the build (skia) to fail. To avoid this problem, explicitly convert the path to its long-form. This alone is not enough however to prevent the same issue occuring when the user changed to the srcdir using the shortened form, then the conversion would fail the same way (and while it is unlikely that the user uses that path manually, launching a terminal via the vscode-integration for example would also use the shortened form). So also cd to the long form of BUILDDIR when running the automatically triggered autogen.sh Change-Id: I02c1ee7d302daa6062b6a049d924f40a49217e5c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180511 Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> Tested-by: Jenkins (cherry picked from commit 206ac992eb4eefc19313c1775e3e76975c7abc5e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180557 diff --git a/Makefile.in b/Makefile.in index 63a3666e9c2b..b049de46620e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -40,8 +40,10 @@ Makefile $(BUILDDIR)/Makefile: $(BUILDDIR)/config_host.mk $(BUILDDIR)/config_hos # run configure in an environment not polluted by config_host.mk ifneq ($(MSYSTEM),) WSL:=@WSL@ -# wsl needs unix-style path into windows realm -$(BUILDDIR)/config_host.mk : SRCDIR:=/$(shell $(WSL) wslpath -u $(SRCDIR)) +# wsl needs unix-style path into windows realm, use long form to avoid confusing autogen.sh wrt +# builddir != srcdir when in actually it is just srcdir-in-shortform vs srcdir-in-longform +# for the same reason cd to the longform of BUILDDIR +$(BUILDDIR)/config_host.mk : SRCDIR:=/$(shell $(WSL) wslpath -u $(shell cygpath -ml $(SRCDIR))) endif $(BUILDDIR)/config_host.mk : $(wildcard \ $(SRCDIR)/autogen.sh \ @@ -57,7 +59,7 @@ $(BUILDDIR)/config_host.mk : $(wildcard \ $(BUILDDIR)/autogen.lastrun \ ) \ $(shell if test -n '$(JAVA_HOME)' -a ! -d '$(JAVA_HOME)'; then echo force-restart; fi) - sh -c "$(if $(MSYSTEM),$(WSL) )$(SRCDIR)/autogen.sh" + sh -c "$(if $(MSYSTEM),cd $(shell cygpath -ml $(BUILDDIR)); $(WSL) )$(SRCDIR)/autogen.sh" else # MAKE_RESTARTS