Bug 240758 - sysutils/bareos-server 18.2.6 ndmp_address_translate_test.cc:29:20: error: no type named 'smc_element_address_assignment'
Summary: sysutils/bareos-server 18.2.6 ndmp_address_translate_test.cc:29:20: error: no...
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Jose Alonso Cardenas Marquez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-22 19:48 UTC by skillcoder
Modified: 2020-07-17 02:21 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (acm)


Attachments
My bareos port config (2.22 KB, image/png)
2019-12-31 13:57 UTC, skillcoder
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description skillcoder 2019-09-22 19:48:43 UTC
FreeBSD 12.0-RELEASE-p10

[44/209] : && /usr/bin/c++  -O2 -pipe -march=core2 -fstack-protector-strong -fno-strict-aliasing -Wall -Wno-deprecated-register -O2 -pipe -march=core2 -fstack-protector-strong -fno-strict-aliasing  -L/usr/local/lib -L/usr/local/lib -Wl,-rpath,/usr/local/lib -fstack-protector-strong core/src/tools/CMakeFiles/drivetype.dir/drivetype.cc.o  -o core/src/tools/drivetype -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lbareos -lbareosfind /usr/local/lib/libjansson.so && :
[45/209] /usr/bin/c++  -DCERTDIR=\"/usr/ports/sysutils/bareos-server/work/bareos-Release-18.2.6/core/../regress/configs/BASE/tls\" -DPROJECT_SOURCE_DIR=\"/usr/ports/sysutils/bareos-server/work/bareos-Release-18.2.6/core\" -DTEST_SMALL_HTABLE -DVERSION=\"18.2.6\" -D_FILE_OFFSET_BITS=64 -I/usr/local/include -Icore/src -O2 -pipe -march=core2 -fstack-protector-strong -fno-strict-aliasing -Wall -Wno-deprecated-register -O2 -pipe -march=core2 -fstack-protector-strong -fno-strict-aliasing   -std=gnu++11 -MD -MT core/src/tests/CMakeFiles/test_ndmp_address_translate.dir/ndmp_address_translate_test.cc.o -MF core/src/tests/CMakeFiles/test_ndmp_address_translate.dir/ndmp_address_translate_test.cc.o.d -o core/src/tests/CMakeFiles/test_ndmp_address_translate.dir/ndmp_address_translate_test.cc.o -c core/src/tests/ndmp_address_translate_test.cc
FAILED: core/src/tests/CMakeFiles/test_ndmp_address_translate.dir/ndmp_address_translate_test.cc.o
/usr/bin/c++  -DCERTDIR=\"/usr/ports/sysutils/bareos-server/work/bareos-Release-18.2.6/core/../regress/configs/BASE/tls\" -DPROJECT_SOURCE_DIR=\"/usr/ports/sysutils/bareos-server/work/bareos-Release-18.2.6/core\" -DTEST_SMALL_HTABLE -DVERSION=\"18.2.6\" -D_FILE_OFFSET_BITS=64 -I/usr/local/include -Icore/src -O2 -pipe -march=core2 -fstack-protector-strong -fno-strict-aliasing -Wall -Wno-deprecated-register -O2 -pipe -march=core2 -fstack-protector-strong -fno-strict-aliasing   -std=gnu++11 -MD -MT core/src/tests/CMakeFiles/test_ndmp_address_translate.dir/ndmp_address_translate_test.cc.o -MF core/src/tests/CMakeFiles/test_ndmp_address_translate.dir/ndmp_address_translate_test.cc.o.d -o core/src/tests/CMakeFiles/test_ndmp_address_translate.dir/ndmp_address_translate_test.cc.o -c core/src/tests/ndmp_address_translate_test.cc
core/src/tests/ndmp_address_translate_test.cc:29:20: error: no type named 'smc_element_address_assignment' in namespace 'directordaemon'; did you mean simply 'smc_element_address_assignment'?
void print_smc_aa (directordaemon::smc_element_address_assignment smc_elem_aa) {
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                   smc_element_address_assignment
core/src/ndmp/smc.h:82:8: note: 'smc_element_address_assignment' declared here
struct smc_element_address_assignment {
       ^
core/src/tests/ndmp_address_translate_test.cc:36:19: error: no type named 'smc_element_address_assignment' in namespace 'directordaemon'; did you mean simply 'smc_element_address_assignment'?
void init_smc_aa (directordaemon::smc_element_address_assignment& smc_elem_aa) {
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  smc_element_address_assignment
core/src/ndmp/smc.h:82:8: note: 'smc_element_address_assignment' declared here
struct smc_element_address_assignment {
       ^
core/src/tests/ndmp_address_translate_test.cc:82:3: error: no type named 'smc_element_address_assignment' in namespace 'directordaemon'; did you mean simply 'smc_element_address_assignment'?
  directordaemon::smc_element_address_assignment smc_elem_aa;
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  smc_element_address_assignment
core/src/ndmp/smc.h:82:8: note: 'smc_element_address_assignment' declared here
struct smc_element_address_assignment {
       ^
core/src/tests/ndmp_address_translate_test.cc:109:3: error: no type named 'smc_element_address_assignment' in namespace 'directordaemon'; did you mean simply 'smc_element_address_assignment'?
  directordaemon::smc_element_address_assignment smc_elem_aa;
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  smc_element_address_assignment
core/src/ndmp/smc.h:82:8: note: 'smc_element_address_assignment' declared here
struct smc_element_address_assignment {
       ^
4 errors generated.
ninja: build stopped: subcommand failed.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/sysutils/bareos-server
*** Error code 1

Stop.
make: stopped in /usr/ports/sysutils/bareos-server
Comment 1 skillcoder 2019-09-28 10:03:03 UTC
I have empty /etc/make.conf
 but
Problem still exists
Comment 2 skillcoder 2019-12-21 18:10:48 UTC
still relevant, after pkg upgrade
Comment 3 Jose Alonso Cardenas Marquez freebsd_committer 2019-12-29 20:51:09 UTC
- Could you test new version of bareos? I have commited a new version with some modifications
Comment 4 skillcoder 2019-12-31 13:54:14 UTC
~~~
$ uname -mrs
FreeBSD 12.0-RELEASE-p10 amd64
~~~
bareos-server-18.2.7 the same error:
```
[48/209] /usr/bin/c++  -DPROJECT_SOURCE_DIR=\"/usr/ports/sysutils/bareos-server/work/bareos-Release-18.2.7/core\" -DVERSION=\"18.2.7\" -D_FILE_OFFSET_BITS=64 -I/usr/local/include -Icore/src -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -Wall -Wno-deprecated-register -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -std=gnu++11 -MD -MT core/src/tests/CMakeFiles/test_ndmp_address_translate.dir/ndmp_address_translate_test.cc.o -MF core/src/tests/CMakeFiles/test_ndmp_address_translate.dir/ndmp_address_translate_test.cc.o.d -o core/src/tests/CMakeFiles/test_ndmp_address_translate.dir/ndmp_address_translate_test.cc.o -c core/src/tests/ndmp_address_translate_test.cc
FAILED: core/src/tests/CMakeFiles/test_ndmp_address_translate.dir/ndmp_address_translate_test.cc.o
/usr/bin/c++  -DPROJECT_SOURCE_DIR=\"/usr/ports/sysutils/bareos-server/work/bareos-Release-18.2.7/core\" -DVERSION=\"18.2.7\" -D_FILE_OFFSET_BITS=64 -I/usr/local/include -Icore/src -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -Wall -Wno-deprecated-register -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -std=gnu++11 -MD -MT core/src/tests/CMakeFiles/test_ndmp_address_translate.dir/ndmp_address_translate_test.cc.o -MF core/src/tests/CMakeFiles/test_ndmp_address_translate.dir/ndmp_address_translate_test.cc.o.d -o core/src/tests/CMakeFiles/test_ndmp_address_translate.dir/ndmp_address_translate_test.cc.o -c core/src/tests/ndmp_address_translate_test.cc
core/src/tests/ndmp_address_translate_test.cc:29:20: error: no type named 'smc_element_address_assignment' in namespace 'directordaemon'; did you mean simply 'smc_element_address_assignment'?
void print_smc_aa (directordaemon::smc_element_address_assignment smc_elem_aa) {
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                   smc_element_address_assignment
core/src/ndmp/smc.h:82:8: note: 'smc_element_address_assignment' declared here
struct smc_element_address_assignment {
       ^
core/src/tests/ndmp_address_translate_test.cc:36:19: error: no type named 'smc_element_address_assignment' in namespace 'directordaemon'; did you mean simply 'smc_element_address_assignment'?
void init_smc_aa (directordaemon::smc_element_address_assignment& smc_elem_aa) {
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  smc_element_address_assignment
core/src/ndmp/smc.h:82:8: note: 'smc_element_address_assignment' declared here
struct smc_element_address_assignment {
       ^
core/src/tests/ndmp_address_translate_test.cc:82:3: error: no type named 'smc_element_address_assignment' in namespace 'directordaemon'; did you mean simply 'smc_element_address_assignment'?
  directordaemon::smc_element_address_assignment smc_elem_aa;
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  smc_element_address_assignment
core/src/ndmp/smc.h:82:8: note: 'smc_element_address_assignment' declared here
struct smc_element_address_assignment {
       ^
core/src/tests/ndmp_address_translate_test.cc:109:3: error: no type named 'smc_element_address_assignment' in namespace 'directordaemon'; did you mean simply 'smc_element_address_assignment'?
  directordaemon::smc_element_address_assignment smc_elem_aa;
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  smc_element_address_assignment
core/src/ndmp/smc.h:82:8: note: 'smc_element_address_assignment' declared here
struct smc_element_address_assignment {
       ^
4 errors generated.
ninja: build stopped: subcommand failed.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/sysutils/bareos-server
*** Error code 1

Stop.
make: stopped in /usr/ports/sysutils/bareos-server
```
Comment 5 skillcoder 2019-12-31 13:57:33 UTC
Created attachment 210356 [details]
My bareos port config
Comment 6 systemdlete@fastmail.com 2020-07-17 00:20:36 UTC
[Please note I am not a BSD user/dev/porter, but I came across this error while porting bareos 18.2.8 to adelie linux.  It may help BSD.]

I found at least part of the solution.  The error shown is actually exactly correct.  In dird.h, #ifdef HAVE_NDMP fails because HAVE_NDMP was not set.  I had assumed (as the OP probably did also) that HAVE_NDMP was set since one has to assume that bareos would not ship a tarball that breaks by default during a normal build (aside from the other changes and patches that must be made).

I decided to patch the dird.h file to define HAVE_NDMP, but one could just as easily remove the bracketing #ifdef/#endif.   Another way would be to pass -DHAVE_NDMP to the compiler, but that would be done via the cmake tools (or other tools the porter might choose to use).

There may still be some errors remaining but at least this problem is solved.  I hope this can save your team some grief in case you, like me, didn't see this very easy fix.
Comment 7 systemdlete@fastmail.com 2020-07-17 02:21:49 UTC
And still yet another way is to look at the cmake files...  <headslap>.  It looks like they might be trying to do that there already.