Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fossil-2.22-1: error: use of undeclared identifiers 'C_IN' and 'T_MX' #1076

Open
cooljeanius opened this issue Oct 5, 2023 · 12 comments
Open

Comments

@cooljeanius
Copy link

cc -I/opt/sw/include -I. -I./src -I./extsrc -Ibld -Wall -Wdeclaration-after-statement -DFOSSIL_ENABLE_JSON -DFOSSIL_DYNAMIC_BUILD=1 -I/usr -I/opt/sw/include -Wdeprecated-declarations -MD -I/opt/sw/include -g -O2 -DHAVE_AUTOCONFIG_H -o bld/smtp.o -c bld/smtp_.c
./src/smtp.c:71:29: error: use of undeclared identifier 'C_IN'
  nDns = res_query(zDomain, C_IN, T_MX, aDns, sizeof(aDns));
                            ^
./src/smtp.c:71:35: error: use of undeclared identifier 'T_MX'
  nDns = res_query(zDomain, C_IN, T_MX, aDns, sizeof(aDns));
                                  ^
2 errors generated.
make: *** [src/main.mk:1849: bld/smtp.o] Error 1
make: *** Waiting for unfinished jobs....
### execution of CCACHE=none failed, exit code 2
### execution of /tmp/fink.IQad7 failed, exit code 2
Removing runtime build-lock...
Removing build-lock package...
/opt/sw/bin/dpkg-lockwait -r fink-buildlock-fossil-2.22-1
(Reading database ... 
dpkg: serious warning: files list file for package `fink-buildlock-ccp4-6.5-1' missing, assuming package has no files currently installed.
1029676 files and directories currently installed.)
Removing fink-buildlock-fossil-2.22-1 ...

I'm on Big Sur with Xcode 13. cc @danielj7

@nieder
Copy link
Member

nieder commented Oct 6, 2023

C_IN and T_MX are defined in arpa/nameser_compat.h, and that gets included from arpa/nameser.h. That gets included in this code in smtp.c:

#if (HAVE_DN_EXPAND || HAVE___NS_NAME_UNCOMPRESS || HAVE_NS_NAME_UNCOMPRESS) && \
    (HAVE_NS_PARSERR || HAVE___NS_PARSERR) && !defined(FOSSIL_OMIT_DNS)
#  include <sys/types.h>
#  include <netinet/in.h>
#  if defined(HAVE_BIND_RESOLV_H)
#    include <bind/resolv.h>
#    include <bind/arpa/nameser_compat.h>
#  else
#    include <arpa/nameser.h>
#    include <resolv.h>
#  endif
#  if defined(HAVENS_NAME_UNCOMPRESS) && !defined(dn_expand)
#    define dn_expand ns_name_uncompress
#  endif
#  if defined(HAVE__NS_NAME_UNCOMPRESS) && !defined(dn_expand)
#    define dn_expand __ns_name_uncompress
#  endif
#  define FOSSIL_UNIX_STYLE_DNS 1
#endif

Looks like one of those HAVE_* are not being defined as expected and so we never enter that part of the code. Can you check config.log in the build directory to see if any of them pop up with errors? I wonder if they're failing during ./configure for an implicit declaration error.

@cooljeanius
Copy link
Author

Can you check config.log in the build directory to see if any of them pop up with errors?

Herre you go: config.log. It doesn't look like your standard autoconf-created config.log, though...

I wonder if they're failing during ./configure for an implicit declaration error.

Yeah, that would make sense, but I searched, and "implicit" turned up zero hits in the log, so... I dunno...

@nieder
Copy link
Member

nieder commented Oct 6, 2023

spoiler: this built for me on 13.5 with Xcode 14.3

So in arpa/nameser.h, arpa/nameser_compat.h is #included with this code:

#ifdef BIND_8_COMPAT
#include <arpa/nameser_compat.h>
#endif

And in autoconfig.h, HAVE_BIND_RESOLV_H is undefined, so

But if I add some diagnostics to smtp.c:

 #include "config.h"
 #include "smtp.h"
 #include <assert.h>
+#if defined(BIND_8_COMPAT)
+# error "have bind 8"
+# else
+# error "no bind 8"
+#endif
 #if (HAVE_DN_EXPAND || HAVE___NS_NAME_UNCOMPRESS || HAVE_NS_NAME_UNCOMPRESS) && \
     (HAVE_NS_PARSERR || HAVE___NS_PARSERR) && !defined(FOSSIL_OMIT_DNS)
 #  include <sys/types.h>

The code goes through the "no bind 8" branch.

@nieder
Copy link
Member

nieder commented Oct 6, 2023

Looking closer at that large #if (HAVE_DN...) conditional, I wonder one of them is not being found the same.
It has 3 components:

  1. must have any of these "HAVE_DN_EXPAND || HAVE___NS_NAME_UNCOMPRESS || HAVE_NS_NAME_UNCOMPRESS"
  2. AND either of these two "HAVE_NS_PARSERR || HAVE___NS_PARSERR"
  3. AND not have FOSSIL_OMIT_DNS

@nieder
Copy link
Member

nieder commented Oct 6, 2023

I have HAVE_DN_EXPAND from (1), but none from (2), and (3). These are defined in autoconfig.h.
And this is what terminal shows during configure:

Checking for arpa/nameser.h...ok
Checking for bind/resolv.h...not found
Checking for resolv.h...ok
Checking libs for dn_expand...none needed
Checking libs for ns_parserr...no
Checking libs for __ns_parserr...no
WARNING: SMTP feature will not be able to look up local MX.

So that explains the build difference I think.

@nieder
Copy link
Member

nieder commented Oct 21, 2023

@cooljeanius can you post the part from your configure output that matches the same checks as my previous comment?

@cooljeanius
Copy link
Author

@cooljeanius can you post the part from your configure output that matches the same checks as my previous comment?

Hm, that's strange, I thought I had, but the comment where I did so seems to have disappeared now? Oh well, let me do it again...

@cooljeanius
Copy link
Author

Checking for arpa/nameser.h...ok
Checking for bind/resolv.h...not found
Checking for resolv.h...ok
Checking libs for dn_expand...none needed
Checking libs for ns_parserr...no
Checking libs for __ns_parserr...-lbind
Checking libs for res_query...none needed
Checking libs for res_9_ns_initparse...-lresolv

@dmacks
Copy link
Member

dmacks commented Oct 22, 2023

OS X 10.13 (Xcode 10.1):

Checking for arpa/nameser.h...ok
Checking for bind/resolv.h...not found
Checking for resolv.h...ok
Checking libs for dn_expand...none needed
Checking libs for ns_parserr...no
Checking libs for __ns_parserr...no
WARNING: SMTP feature will not be able to look up local MX.
Checking libs for res_9_ns_initparse...-lresolv

but the compiling does succeed. But then if I install libbind6-dev:

Checking for arpa/nameser.h...ok
Checking for bind/resolv.h...not found
Checking for resolv.h...ok
Checking libs for dn_expand...none needed
Checking libs for ns_parserr...no
Checking libs for __ns_parserr...-lbind
Checking libs for res_query...none needed
Checking libs for res_9_ns_initparse...-lresolv

and the build fails with the undeclared tokens. So detection of an unexpected fink package gives build-fail, and BuildConflicts:libbind6-dev would fix it. Our libbind looks like a quite old version, I guess fossil's test is for an older function rather than for the newer features of that lib.

@dmacks
Copy link
Member

dmacks commented Oct 22, 2023

Unrelated (probably:) to this bug, but to avoid some red herrings, I pushed a tweak to this package to remove some bogus flags (-I/usr -L/usr) . And (assuming you are using fink itself from git) there is another bogus flag (-L/opt/sw/lib/0) due to a fink bug that was been fixed a week ago.

@cooljeanius
Copy link
Author

OS X 10.13 (Xcode 10.1):

Checking for arpa/nameser.h...ok
Checking for bind/resolv.h...not found
Checking for resolv.h...ok
Checking libs for dn_expand...none needed
Checking libs for ns_parserr...no
Checking libs for __ns_parserr...no
WARNING: SMTP feature will not be able to look up local MX.
Checking libs for res_9_ns_initparse...-lresolv

but the compiling does succeed. But then if I install libbind6-dev:

Checking for arpa/nameser.h...ok
Checking for bind/resolv.h...not found
Checking for resolv.h...ok
Checking libs for dn_expand...none needed
Checking libs for ns_parserr...no
Checking libs for __ns_parserr...-lbind
Checking libs for res_query...none needed
Checking libs for res_9_ns_initparse...-lresolv

and the build fails with the undeclared tokens. So detection of an unexpected fink package gives build-fail, and BuildConflicts:libbind6-dev would fix it. Our libbind looks like a quite old version, I guess fossil's test is for an older function rather than for the newer features of that lib.

Confirming that doing fink remove libbind6-dev allows installation of fossil to proceed. Leaving open for the build conflict to be added...

@cooljeanius
Copy link
Author

Confirming that doing fink remove libbind6-dev allows installation of fossil to proceed. Leaving open for the build conflict to be added...

...which I guess means that this depends on #1092 (which might actually mean a build conflict wouldn't be necessary, if it were fixed?)

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

No branches or pull requests

3 participants