tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

mongodb3 fails to build after update, contains SSPL code



"Adam Ciarcinski" <adam%netbsd.org@localhost> writes:

> Module Name:	pkgsrc
> Committed By:	adam
> Date:		Tue Jul  9 07:28:30 UTC 2019
>
> Modified Files:
> 	pkgsrc/databases/mongodb3: Makefile distinfo options.mk
> 	pkgsrc/databases/mongodb3/patches: patch-SConstruct
> 	    patch-src_mongo_base_initializer.h
> 	    patch-src_mongo_platform_random.cpp
> 	    patch-src_mongo_platform_stack__locator__netbsd.cpp
> 	    patch-src_mongo_shell_linenoise__utf8.h
> 	    patch-src_mongo_util_processinfo__netbsd.cpp
> Removed Files:
> 	pkgsrc/databases/mongodb3/patches: patch-debian_mongod.conf
> 	    patch-src_mongo_db_dbwebserver.cpp
> 	    patch-src_mongo_db_fts_unicode_string.cpp
> 	    patch-src_mongo_platform_stack__locator__dragonfly.cpp
> 	    patch-src_mongo_util_net_miniwebserver.cpp
>
> Log Message:
> mongodb3: updated to 3.4.21

I am having two problems with this update.  One is about the build
system and non-obvious; I'm including tech-pkg in the hopes that someone
can spot the trouble.  The other is the inclusion of a file under the
SSPL.

Building under netbsd-8 amd64, I get:

  Checking if C compiler is GCC 5.3.0 or newer...yes
  Checking if C++ compiler is GCC 5.3.0 or newer...no
  ERROR: Refusing to build with compiler that does not meet requirements
  AttributeError: 'str' object has no attribute 'abspath':
    File "/tmp/work/databases/mongodb3/work/mongodb-src-r3.4.21/SConstruct", line 3010:
      env = doConfigure( env )
    File "/tmp/work/databases/mongodb3/work/mongodb-src-r3.4.21/SConstruct", line 1786:
      env.ConfError("ERROR: Refusing to build with compiler that does not meet requirements")
    File "/usr/pkg/lib/scons/SCons/Environment.py", line 224:
      return self.method(*nargs, **kwargs)
    File "/tmp/work/databases/mongodb3/work/mongodb-src-r3.4.21/SConstruct", line 921:
      print("See {0} for details".format(env['CONFIGURELOG'].abspath))
  *** Error code 2

which is odd, because the compiler is indeed 5.3.0.  Looking at the
logs, I see strange quotes which appears to confuse gcc into thinking
that it has a long argument to -O that includes not only "2" but spaces
and other flags:

  scons: Configure: Checking if C compiler is GCC 5.3.0 or newer...
  build/scons/opt/sconf_temp/conftest_7.c <-
    |
    |#if !defined(__GNUC__) || defined(__clang__)
    |#error
    |#endif
    |
    |#if (__GNUC__ < 5) || (__GNUC__ == 5 && __GNUC_MINOR__ < 3) || (__GNUC__ == 5 && __GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ < 0)
    |#error GCC 5.3.0 or newer is required to build MongoDB
    |#endif
    |
    |int main(int argc, char* argv[]) {
    |    return 0;
    |}
    |
  gcc -o build/scons/opt/sconf_temp/conftest_7.o -c -O2 -D_FORTIFY_SOURCE=2 -pthread -I/usr/pkg/include -I/usr/include -fno-omit-frame-pointer -fno-strict-aliasing -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -O2 -DNDEBUG -D__netbsd__ -DXP_UNIX=1 -I/dist/pkg/include build/scons/opt/sconf_temp/conftest_7.c
  scons: Configure: yes

  scons: Configure: Checking if C++ compiler is GCC 5.3.0 or newer...
  build/scons/opt/sconf_temp/conftest_8.cpp <-
    |
    |#if !defined(__GNUC__) || defined(__clang__)
    |#error
    |#endif
    |
    |#if (__GNUC__ < 5) || (__GNUC__ == 5 && __GNUC_MINOR__ < 3) || (__GNUC__ == 5 && __GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ < 0)
    |#error GCC 5.3.0 or newer is required to build MongoDB
    |#endif
    |
    |int main(int argc, char* argv[]) {
    |    return 0;
    |}
    |
  c++ -o build/scons/opt/sconf_temp/conftest_8.o -c -O2 -D_FORTIFY_SOURCE=2 -pthread -I/usr/pkg/include -I/usr/include -Woverloaded-virtual "-O2 -D_FORTIFY_SOURCE=2 -pthread -I/usr/pkg/include -I/usr/include" -fno-omit-frame-pointer -fno-strict-aliasing -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -O2 -DNDEBUG -D__netbsd__ -DXP_UNIX=1 -I/dist/pkg/include build/scons/opt/sconf_temp/conftest_8.cpp
  cc1plus: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  scons: Configure: no

I looked at SConstruct, and while I think I can almost see how this
happens (possible confusion about a variable with multiple options
versus word splitting), I don't see how it would start failing.

Any ideas?  Did you test on netbsd-8?  (The point of this package is to
be acceptable in situations where mongodb4 has build and licensing
problems, so while micro updates seem in general good, working on
netbsd-8 is a hard requirement.)

The other issue is that the new version has a file licensed under the
Server Side Public License.  I can certainly understand that this was
overlooked because it is not mentioned in the upstream changes and
unexpected:

  src/mongo/util/net/ssl_options_test.cpp

I wonder if we have to roll back to a version without that, or if we can
rm this file post-extract because it is not used in the build.

Please let me know your thoughts on fixing these problems.


Home | Main Index | Thread Index | Old Index