Skip to content

Make distcheck - possible fixes#881

Open
wolfsage wants to merge 5 commits intocyrusimap:masterfrom
wolfsage:make-distcheck
Open

Make distcheck - possible fixes#881
wolfsage wants to merge 5 commits intocyrusimap:masterfrom
wolfsage:make-distcheck

Conversation

@wolfsage
Copy link

@wolfsage wolfsage commented Nov 4, 2025

This branch includes some "fixes" to get make distcheck almost working on master. I am unsure if any or all of these are the correct fixes, but they help point to the problems in building.

The make check that make distcheck calls still fails:

make[3]: Leaving directory '/srv/cyrus-sasl/cyrus-sasl-2.1.28/_build/sub/tests'
../../../tests/runtests.py 
SASLDB PLAIN:
    FAIL: CLI (0):  --> SRV (255): starting SASL negotiation: user not found
SASLDB PLAIN PASSWORD MISMATCH:
    FAIL: CLI (0):  --> SRV (255): starting SASL negotiation: user not found
Traceback (most recent call last):
  File "/srv/cyrus-sasl/cyrus-sasl-2.1.28/_build/sub/tests/../../../tests/runtests.py", line 530, in <module>
    err = gssapi_tests(T)
          ^^^^^^^^^^^^^^^
  File "/srv/cyrus-sasl/cyrus-sasl-2.1.28/_build/sub/tests/../../../tests/runtests.py", line 382, in gssapi_tests
    env = setup_socket_wrappers(testdir)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/cyrus-sasl/cyrus-sasl-2.1.28/_build/sub/tests/../../../tests/runtests.py", line 22, in setup_socket_wrappers
    raise Exception('Socket Wrappers not available')

and at this point I need to take a break :)

And with this hack:

diff --git a/lib/common.c b/lib/common.c
index a74d0ae7..fcf4311c 100644
--- a/lib/common.c
+++ b/lib/common.c
@@ -2098,6 +2098,8 @@ _sasl_log (sasl_conn_t *conn,
   if (result != SASL_OK) goto done;
   out[outlen]=0;
 
+  syslog(LOG_ERR, out);
+
   /* send log message */
   result = log_cb(log_ctx, level, out);

we see:

saslpasswd2: looking for plugins in '/srv/cyrus-sasl/cyrus-sasl-2.1.28/_inst/lib/sasl2', failed to open directory, error: No such file or directory
saslpasswd2: could not find auxprop plugin, was searching for [all]
saslpasswd2: secret not changed for test: no writable auxprop plugin or setpass callback found

This seems to be because of libdir?

cyrus-sasl-2.1.28/_build/sub/lib/libsasl2.la
41:libdir='/srv/cyrus-sasl/cyrus-sasl-2.1.28/_inst/lib'

...

There used to be an include/gai.h, but with that gone,
`make distcheck` would fail with:

    make[3]: Entering directory '/srv/cyrus-sasl/saslauthd'
    make  distdir-am
    make[4]: Entering directory '/srv/cyrus-sasl/saslauthd'
    make[4]: *** No rule to make target 'include', needed by 'distdir-am'.  Stop.
    make[4]: Leaving directory '/srv/cyrus-sasl/saslauthd'
    make[3]: *** [Makefile:642: distdir] Error 2
    make[3]: Leaving directory '/srv/cyrus-sasl/saslauthd'
    make[2]: *** [Makefile:796: distdir-am] Error 1
    make[2]: Leaving directory '/srv/cyrus-sasl'
    make[1]: *** [Makefile:790: distdir] Error 2
    make[1]: Leaving directory '/srv/cyrus-sasl'
    make: *** [Makefile:898: dist] Error 2
Without this, `make distcheck` doesn't succeed because:

    make[4]: *** No rule to make target 'libsasl2.map', needed by 'libsasl2.la'.  Stop.
    make[4]: Leaving directory '/srv/cyrus-sasl/cyrus-sasl-2.1.28/_build/sub/lib'
    make[3]: *** [Makefile:521: all] Error 2
    make[3]: Leaving directory '/srv/cyrus-sasl/cyrus-sasl-2.1.28/_build/sub/lib'
    make[2]: *** [Makefile:691: all-recursive] Error 1
    make[2]: Leaving directory '/srv/cyrus-sasl/cyrus-sasl-2.1.28/_build/sub'
    make[1]: *** [Makefile:559: all] Error 2
    make[1]: Leaving directory '/srv/cyrus-sasl/cyrus-sasl-2.1.28/_build/sub'
    make: *** [Makefile:910: distcheck] Error 1
With a distcheck build, t_common.h wasn't being copied over to
the build dir, so it couldn't be found causing:

    ../../../tests/t_common.c:4:10: fatal error: t_common.h: No such file or directory
        4 | #include <t_common.h>
          |          ^~~~~~~~~~~~
    compilation terminated.
    make[3]: *** [Makefile:525: t_common.o] Error 1
    make[3]: Leaving directory '/srv/cyrus-sasl/cyrus-sasl-2.1.28/_build/sub/tests'
    make[2]: *** [Makefile:691: all-recursive] Error 1
    make[2]: Leaving directory '/srv/cyrus-sasl/cyrus-sasl-2.1.28/_build/sub'
    make[1]: *** [Makefile:559: all] Error 2
    make[1]: Leaving directory '/srv/cyrus-sasl/cyrus-sasl-2.1.28/_build/sub'
    make: *** [Makefile:910: distcheck] Error 1
When tests try to run, they fail. If we add this hack so we get errors in
syslog:

    diff --git a/lib/common.c b/lib/common.c
    index a74d0ae..fcf4311c 100644
    --- a/lib/common.c
    +++ b/lib/common.c
    @@ -2098,6 +2098,8 @@ _sasl_log (sasl_conn_t *conn,
       if (result != SASL_OK) goto done;
       out[outlen]=0;

    +  syslog(LOG_ERR, out);
    +
       /* send log message */
       result = log_cb(log_ctx, level, out);

We see:

    t_gssapi_srv: looking for plugins in '../../../plugins/.libs', failed to open directory, error: No such file or directory
    t_gssapi_cli: looking for plugins in '../../../plugins/.libs', failed to open directory, error: No such file or directory

The tests are running out of:

    cyrus-sasl-2.1.28/_build/sub/tests

so that puts us in the source directory, but the actual plugins are in
_build/sub/plugins/.libs/, so we need to use that instead.
@wolfsage
Copy link
Author

wolfsage commented Nov 4, 2025

Mm, other failures actually from actual make distcheck output:

SASLDB PLAIN:
    FAIL: CLI (0):  --> SRV (255): starting SASL negotiation: user not found
SASLDB PLAIN PASSWORD MISMATCH:
    FAIL: CLI (0):  --> SRV (255): starting SASL negotiation: user not found
Traceback (most recent call last):
  File "/srv/cyrus-sasl/cyrus-sasl-2.1.28/_build/sub/tests/../../../tests/runtests.py", line 530, in <module>
    err = gssapi_tests(T)
          ^^^^^^^^^^^^^^^
  File "/srv/cyrus-sasl/cyrus-sasl-2.1.28/_build/sub/tests/../../../tests/runtests.py", line 382, in gssapi_tests
    env = setup_socket_wrappers(testdir)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/cyrus-sasl/cyrus-sasl-2.1.28/_build/sub/tests/../../../tests/runtests.py", line 22, in setup_socket_wrappers
    raise Exception('Socket Wrappers not available')

So I need... apt-get install libsocket-wrapper, and then:

    raise Exception('NSS Wrappers not available')
Exception: NSS Wrappers not available

Okay:

apt-get install libnss-wrapper

And then:

FileNotFoundError: [Errno 2] No such file or directory: 'kdb5_util'

apt-get install krb5-kdc
FileNotFoundError: [Errno 2] No such file or directory: 'kadmin.local'

(this is getting silly)

apt-get install krb5-admin-server
SASLDB PLAIN:
    FAIL: CLI (0):  --> SRV (255): starting SASL negotiation: user not found
SASLDB PLAIN PASSWORD MISMATCH:
    FAIL: CLI (0):  --> SRV (255): starting SASL negotiation: user not found
krb5kdc: starting...
GSSAPI BASIC:
    PASS: CLI(DONE) SRV(DONE)
GSSAPI ACCEPT ANY:
    PASS: CLI(DONE) SRV(DONE)
GSSAPI SERVICE PRINCIPAL:
    PASS: CLI(DONE) SRV(DONE)
GSSAPI KEYTAB:
    PASS: CLI(DONE) SRV(DONE)
GSSAPI CHANNEL BINDING:
    PASS: CLI(DONE) SRV(DONE)
GSSAPI CHANNEL BINDING MISMTACH:
    FAIL: This test should fail [CLI(DONE) SRV(DONE)]
GSS-SPNEGO BASIC:
    PASS: CLI(DONE) SRV(DONE)
GSS-SPNEGO 0 MAXSSF:
    PASS: CLI(DONE) SRV(DONE)
1 test(s) FAILED
make[2]: *** [Makefile:771: check] Error 255
make[2]: Leaving directory '/srv/cyrus-imapd/cyrus-sasl/cyrus-sasl-2.1.28/_build/sub/tests'
make[1]: *** [Makefile:691: check-recursive] Error 1
make[1]: Leaving directory '/srv/cyrus-imapd/cyrus-sasl/cyrus-sasl-2.1.28/_build/sub'
make: *** [Makefile:910: distcheck] Error 1

Okay! So... what's actually failing that needs fixing? Part of this might just be "For distcheck / make check, you need to install these libs..."

@wolfsage
Copy link
Author

wolfsage commented Nov 4, 2025

    FAIL: CLI (0):  --> SRV (255): starting SASL negotiation: user not found
SASLDB PLAIN PASSWORD MISMATCH:
    FAIL: CLI (0):  --> SRV (255): starting SASL negotiation: user not found

A make install + make check makes these two pass, so something definitely needs fixing there in the distcheck build with perhaps libdir...

@flowerysong
Copy link
Contributor

#855 has all of the changes needed to make tests pass. You're probably missing 50c02e7

Without this, when distcheck runs, it does:

 * make
 * make check
 * make install

... and the make check phase runs saslpasswd2 which requires
plugins to be in the plugindir. But without `make install` being
run, they aren't there, so we have tell configure to look elsewhere
when under distcheck.

This is a hack. The real solution is get `make check` working against
a non-installed build, somehow...
@wolfsage
Copy link
Author

wolfsage commented Nov 4, 2025

Okay the commit I've pushed "fixes" the libdir problem of make distcheck

@elliefm
Copy link
Contributor

elliefm commented Nov 5, 2025

IIRC the "DCO" check failure is a requirement that all commits have a signoff line in the commit message, which you get by passing the --signoff parameter to git commit. I remember we enabled this requirement briefly on cyrus-imapd too, but it was a nuisance so we got rid of it. I guess cyrus-sasl kept it.

@wolfsage
Copy link
Author

wolfsage commented Nov 5, 2025

#855 has all of the changes needed to make tests pass. You're probably missing 50c02e7

Good to know, thanks!

@flowerysong
Copy link
Contributor

The branch itself is a bit of a mess because of how I merged the various test and code fixes that are in flight, but I can confirm that with your changes (minus b126c51) plus one additional change,make distcheck seems to work: https://github.com/flowerysong/cyrus-sasl/actions/runs/19112845020

@wolfsage
Copy link
Author

wolfsage commented Nov 5, 2025

The branch itself is a bit of a mess because of how I merged the various test and code fixes that are in flight, but I can confirm that with your changes (minus b126c51)

Huh. I'm... curious why that works without this commit. I'll have to play with your branch.

@flowerysong
Copy link
Contributor

flowerysong commented Nov 5, 2025

Because, like I said before, 50c02e7 is the proper (or at least an alternative) fix for that issue.

@wolfsage
Copy link
Author

wolfsage commented Nov 5, 2025

Because, like I said before, 50c02e7 is the proper (or at least an alternative) fix for that issue.

Ah thank you. That commit message wasn't descriptive enough for me to realize these things were connected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants