Page MenuHome GnuPG

2.4.0 does not support in-source-tree builds
Closed, ResolvedPublic

Description

Hit the following make check failure when packaging gnupg-2.4.0 for Gentoo:

PASS: tests/migrations/extended-pkf.scm
Testing a clean migration ...
Testing a migration with existing private-keys-v1.d ...
Testing a migration with existing but weird private-keys-v1.d ...
PASS: tests/migrations/from-classic.scm
===================
3 tests run, 3 succeeded, 0 failed, 0 failed expectedly, 0 succeeded unexpectedly, 0 skipped.
===================
make[2]: Leaving directory '/var/tmp/portage/app-crypt/gnupg-2.4.0/work/gnupg-2.4.0/tests/migrations'
Making check in gpgme
make[2]: Entering directory '/var/tmp/portage/app-crypt/gnupg-2.4.0/work/gnupg-2.4.0/tests/gpgme'
/usr/sbin/mkdir: cannot create directory ‘setup.scm’: Not a directory
make[2]: *** [Makefile:617: xcheck] Error 1
make[2]: Leaving directory '/var/tmp/portage/app-crypt/gnupg-2.4.0/work/gnupg-2.4.0/tests/gpgme'
make[1]: *** [Makefile:517: check-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/app-crypt/gnupg-2.4.0/work/gnupg-2.4.0/tests'
make: *** [Makefile:631: check-recursive] Error 1
 * ERROR: app-crypt/gnupg-2.4.0::gentoo failed (test phase):
 *   Make check failed. See above for details.

build.log:

.

Please let me know if further infromation is required. 2.3.8 passes tests fine.

Event Timeline

werner added projects: workaround, gnupg24.
werner added a subscriber: werner.

You are building in the source tree - not a good idea. This should be supported but we don't test this. Please make your life easier and don't do build this way. We try to fix this for the next release.

werner renamed this task from Test failure with gnupg-2.4.0 (`/usr/sbin/mkdir: cannot create directory ‘setup.scm’: Not a directory`) to 2.4.0 does not support in-source-tree builds.Dec 20 2022, 11:22 AM

Ah, thanks! I didn't know this was unsupported. I'll change what we're doing.

Sorry, one more thing: I should use out of source builds for all gnupg software (libgpg-error, libksba, etc)? It's fine if so, just want to check what the policy is.

You should do it for all software ;-).

Actually in-source-tree builds work but there was a late patch which causes your problem. And because make distcheck and our even more verbose double build for Windows and the AppImage didn't test this.

gniibe added a subscriber: gniibe.

I will push this change:

commit e89d57a2cb10bd04d266165015f159be2ab48984
Author: NIIBE Yutaka <gniibe@fsij.org>
Date:   Wed Dec 21 10:52:24 2022 +0900

    tests: Fix tests/gpgme for in-source-tree builds.
    
    * tests/gpgme/Makefile.am: Don't use setup.scm/ dir.
    * tests/gpgme/all-tests.scm: Fix the name of the environment.
    
    --
    
    GnuPG-bug-id: 6313
    Fixes-commit: c19ea75f10d6278569619f90977ce7c820e9319d
    Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>

diff --git a/tests/gpgme/Makefile.am b/tests/gpgme/Makefile.am
index ca7be13df..ae98db4a0 100644
--- a/tests/gpgme/Makefile.am
+++ b/tests/gpgme/Makefile.am
@@ -47,8 +47,7 @@ check: xcheck
 
 .PHONY: xcheck
 xcheck:
-	@$(MKDIR_P) setup.scm/tests \
-	  tests/gpg lang/qt/tests lang/python/tests
+	@$(MKDIR_P) tests/gpg lang/qt/tests lang/python/tests
 	$(TESTS_ENVIRONMENT) $(abs_top_builddir)/tests/gpgscm/gpgscm$(EXEEXT) \
 	  $(abs_srcdir)/run-tests.scm $(TESTFLAGS) $(TESTS)
 
@@ -61,4 +60,4 @@ CLEANFILES = *.log report.xml
 all-local: $(required_pgms)
 
 clean-local:
-	-rm -rf setup.scm/tests tests/gpg lang/qt/tests lang/python/tests
+	-rm -rf tests lang
diff --git a/tests/gpgme/all-tests.scm b/tests/gpgme/all-tests.scm
index 1746c4ee1..aef7d6a21 100644
--- a/tests/gpgme/all-tests.scm
+++ b/tests/gpgme/all-tests.scm
@@ -41,7 +41,7 @@
     (test::scm
      #f
      #f
-     (path-join "tests" "gpgme" "setup.scm" "tests" "gpg")
+     (path-join "tests" "gpgme" "tests" "gpg")
      (in-srcdir "tests" "gpgme" "setup.scm")
      "--" "tests" "gpg")))
  (define setup-py
@@ -49,7 +49,7 @@
     (test::scm
      #f
      #f
-     (path-join "tests" "gpgme" "setup.scm" "lang" "python" "tests")
+     (path-join "tests" "gpgme" "lang" "python" "tests")
      (in-srcdir "tests" "gpgme" "setup.scm")
      "--" "lang" "python" "tests")))
gniibe changed the task status from Open to Testing.Dec 22 2022, 12:54 AM

Pushed the change.

This is probably not the right place, but considering you're telling people *here* that they should not build in the source tree, your README and INSTALL files do tell the users to do exactly that.

Somehow I was waiting for such a comment ;-) Sure you are right and we will fix the README eventually.

README and INSTALL now suggest to to use a build directory.