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

maxscale: init at 2.1.17 #33835

Merged
merged 1 commit into from Jun 10, 2018
Merged

maxscale: init at 2.1.17 #33835

merged 1 commit into from Jun 10, 2018

Conversation

Izorkin
Copy link
Contributor

@Izorkin Izorkin commented Jan 13, 2018

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

enableParallelBuilding = true;

postInstall = ''
patchelf --set-rpath ${stdenv.lib.makeLibraryPath [ curl gcc.cc.lib glibc jemalloc kerberos openssl pcre2 zlib ]}:${mariadb.connector-c}/lib/mariadb:$out/lib/maxscale $out/bin/dbfwchk
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be refactored somewhat before merging. I suggest lifting the makeLibraryPaths and use loops for common rpaths. That said I'm a little confused why all this patching is necessary to begin with?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the end of packet build the following message appears:
-- Installing: /nix/store/xgjzyvw7y1f4jh3sx1jkd46c51y5qf1y-maxscale-2.1.13/bin/maxadmin -- Set runtime path of "/nix/store/xgjzyvw7y1f4jh3sx1jkd46c51y5qf1y-maxscale-2.1.13/bin/maxadmin" to ":/nix/store/xgjzyvw7y1f4jh3sx1jkd46c51y5qf1y-maxscale-2.1.13//nix/store/xgjzyvw7y1f4jh3sx1jkd46c51y5qf1y-maxscale-2.1.13/lib/maxscale
And as result, incorrect path to libmaxscale-common.so.1.0.0 library is written. Maybe there's another way to avoid this problem?


preConfigure = ''
for i in `grep -l -R '#include <getopt.h>' .`; do
substituteInPlace $i --replace "#include <getopt.h>" "#include <${glibc.dev}/include/getopt.h>"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a properly configured toolchain, it seems odd to have to substitute in a full path to the libc headers; what motivated this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this patch, getopt.h provided with maxscale, was included instead of glibc getopt.h, and that caused weird errors, like:

`
[ 31%] Building CXX object server/core/CMakeFiles/maxscale.dir/gateway.cc.o
In file included from /nix/store/p2bkk31685y6b4l30bp9961g6kd133wd-glibc-2.26-115-dev/include/bits/getopt_posix.h:27:0,
from /nix/store/p2bkk31685y6b4l30bp9961g6kd133wd-glibc-2.26-115-dev/include/unistd.h:872,
from /tmp/nix-build-maxscale-2.1.13.drv-0/source/server/core/gateway.cc:47:
/nix/store/p2bkk31685y6b4l30bp9961g6kd133wd-glibc-2.26-115-dev/include/bits/getopt_core.h:91:12: error: declaration of 'int getopt(int, char* const*, const char*) throw ()' has a different exception specifier
extern int getopt (int ___argc, char const ___argv, const char __shortopts)
^~~~~~
In file included from /tmp/nix-build-maxscale-2.1.13.drv-0/source/server/core/gateway.cc:42:0:
/nix/store/b1mqlzdnp32bzhbmqsk99hjmkk19rdrq-mariadb-connector-c-2.3.4/include/mariadb/getopt.h:108:12: note: from previous declaration 'int getopt(int, char
const
, const char
)'
extern int getopt (int argc, char *const *argv, const char *shortopts);
^~~~~~
make[2]: *** [server/core/CMakeFiles/maxscale.dir/build.make:63: server/core/CMakeFiles/maxscale.dir/gateway.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:596: server/core/CMakeFiles/maxscale.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
builder for ‘/nix/store/x1if3dad7j0i24lckdz4jbyls9ifa6jg-maxscale-2.1.13.drv’ failed with exit code 2
error: build of ‘/nix/store/x1if3dad7j0i24lckdz4jbyls9ifa6jg-maxscale-2.1.13.drv’ failed

`

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh ... why would they do that?


postInstall = ''
patchelf --set-rpath ${libPath1}:${mariadb.connector-c}/lib/mariadb:$out/lib/maxscale $out/bin/dbfwchk
patchelf --set-rpath ${libPath2}:$out/lib/maxscale $out/bin/maxadmin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder, is the primary goal here to add $out/lib/... to the rpath? If so I think you could profitably change these calls to include patchelf --print-rpath ... instead of specifying the libpath yourself.

Copy link
Contributor Author

@Izorkin Izorkin Feb 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method does not work for binary files:
ldd /nix/store/m22fbx7l1g5s3s3y5lnb1p3b196bxyn5-maxscale-2.1.13/bin/maxscale
not a dynamic executable

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, rpath wouldn't work at all then. See

patchelf --set-rpath "$(patchelf --print-rpath "$elf"):$out/lib/deja-dup" "$elf"
for an example of what I'm talking about.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to -
patchelf --set-rpath "$(patchelf --print-rpath "$out/bin/maxscale"):$out/lib/maxscale" "$out/bin/maxscale"
Not worked -
ldd /nix/store/hn0lnffvfzqy0bnlmh30kgvxr7w8sxrq-maxscale-2.1.13/bin/maxscale
not a dynamic executable

@Izorkin Izorkin force-pushed the mariadb-maxscale branch 2 times, most recently from 3f43b94 to e1a5baa Compare February 17, 2018 20:24
@Izorkin Izorkin changed the title maxscale: init at 2.1.13 maxscale: init at 2.1.14 Mar 13, 2018
@joachifm
Copy link
Contributor

@GrahamcOfBorg build maxscale

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: maxscale

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Attempted: maxscale

Partial log (click to expand)

config.status: creating config.h
config.status: executing libtool commands
[ 44%] Performing build step for 'maxscale_sqlite'
make[3]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
[ 44%] No install step for 'maxscale_sqlite'
[ 44%] Completed 'maxscale_sqlite'
[ 44%] Built target maxscale_sqlite
make: *** [Makefile:141: all] Error 2
builder for '/nix/store/v3plhw3yjgwm38l64r6f6fgypg2qrbcj-maxscale-2.1.14.drv' failed with exit code 2
error: build of '/nix/store/v3plhw3yjgwm38l64r6f6fgypg2qrbcj-maxscale-2.1.14.drv' failed

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: maxscale

Partial log (click to expand)

config.status: creating config.h
config.status: executing libtool commands
[ 91%] Performing build step for 'maxscale_sqlite'
make[3]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
[ 91%] No install step for 'maxscale_sqlite'
[ 91%] Completed 'maxscale_sqlite'
[ 91%] Built target maxscale_sqlite
make: *** [Makefile:141: all] Error 2
builder for '/nix/store/y0v1jzy7hv5snbc7advzd15ifmwsg4r7-maxscale-2.1.14.drv' failed with exit code 2
�[31;1merror:�[0m build of '/nix/store/y0v1jzy7hv5snbc7advzd15ifmwsg4r7-maxscale-2.1.14.drv' failed

@joachifm
Copy link
Contributor

@GrahamcOfBorg build maxscale

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: maxscale

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Attempted: maxscale

Partial log (click to expand)

config.status: creating config.h
config.status: executing libtool commands
[ 48%] Performing build step for 'maxscale_sqlite'
make[3]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
[ 48%] No install step for 'maxscale_sqlite'
[ 48%] Completed 'maxscale_sqlite'
[ 48%] Built target maxscale_sqlite
make: *** [Makefile:141: all] Error 2
builder for '/nix/store/c9w3k14wmsamdnysmh7s4xnnagfwnxhg-maxscale-2.1.16.drv' failed with exit code 2
error: build of '/nix/store/c9w3k14wmsamdnysmh7s4xnnagfwnxhg-maxscale-2.1.16.drv' failed

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: maxscale

Partial log (click to expand)

       __bos (__s), __fmt, __va_arg_pack ());
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 94%] Linking CXX shared library libcache.so
[ 94%] Built target cache
cc1: all warnings being treated as errors
make[2]: *** [server/modules/routing/binlogrouter/CMakeFiles/maxbinlogcheck.dir/build.make:159: server/modules/routing/binlogrouter/CMakeFiles/maxbinlogcheck.dir/blr_slave.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:759: server/modules/routing/binlogrouter/CMakeFiles/maxbinlogcheck.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
builder for '/nix/store/rky2c2hpqqg4h4zvvr41aq538ax5f0xx-maxscale-2.1.16.drv' failed with exit code 2
�[31;1merror:�[0m build of '/nix/store/rky2c2hpqqg4h4zvvr41aq538ax5f0xx-maxscale-2.1.16.drv' failed

@Izorkin
Copy link
Contributor Author

Izorkin commented May 11, 2018

@joachifm please recheck PR. Fixed build with gcc6

@joachifm
Copy link
Contributor

@GrahamcOfBorg build maxscale

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: maxscale

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Attempted: maxscale

Partial log (click to expand)

glibPreFixupPhase
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/fcmqkl37i0x2dcaxk7bc3ykkm73m1432-libui-3.1a
shrinking /nix/store/fcmqkl37i0x2dcaxk7bc3ykkm73m1432-libui-3.1a/lib/libui.so.0
strip is /nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/fcmqkl37i0x2dcaxk7bc3ykkm73m1432-libui-3.1a/lib
patching script interpreter paths in /nix/store/fcmqkl37i0x2dcaxk7bc3ykkm73m1432-libui-3.1a
checking for references to /build in /nix/store/fcmqkl37i0x2dcaxk7bc3ykkm73m1432-libui-3.1a...
cannot build derivation '/nix/store/q3brzkabfdz9q5bqy5w4hhnv7j6znjzj-maxscale-2.1.16.drv': 1 dependencies couldn't be built
error: build of '/nix/store/q3brzkabfdz9q5bqy5w4hhnv7j6znjzj-maxscale-2.1.16.drv' failed

@Izorkin
Copy link
Contributor Author

Izorkin commented May 11, 2018

https://pastebin.com/W2n7YF3z - my build log

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: maxscale

Partial log (click to expand)

shrinking /nix/store/iigm707qwrh70gcsq5yissddz06vl115-maxscale-2.1.16/lib/maxscale/libcli.so.1.0.0
shrinking /nix/store/iigm707qwrh70gcsq5yissddz06vl115-maxscale-2.1.16/lib/maxscale/libbinlogrouter.so.2.0.0
shrinking /nix/store/iigm707qwrh70gcsq5yissddz06vl115-maxscale-2.1.16/lib/maxscale/libmaxscale-common.so.1.0.0
shrinking /nix/store/iigm707qwrh70gcsq5yissddz06vl115-maxscale-2.1.16/lib/maxscale/libqc_dummy.so.1.0.0
shrinking /nix/store/iigm707qwrh70gcsq5yissddz06vl115-maxscale-2.1.16/lib/maxscale/libqc_sqlite.so.1.0.0
gzipping man pages under /nix/store/iigm707qwrh70gcsq5yissddz06vl115-maxscale-2.1.16/share/man/
patching script interpreter paths in /nix/store/iigm707qwrh70gcsq5yissddz06vl115-maxscale-2.1.16
/nix/store/iigm707qwrh70gcsq5yissddz06vl115-maxscale-2.1.16/bin/create_grants: interpreter directive changed from "/bin/bash" to "/nix/store/a4qslf0yfs44mhnbagarn232sjnckhy0-bash-4.4-p19/bin/bash"
checking for references to /build in /nix/store/iigm707qwrh70gcsq5yissddz06vl115-maxscale-2.1.16...
/nix/store/iigm707qwrh70gcsq5yissddz06vl115-maxscale-2.1.16

@xeji
Copy link
Contributor

xeji commented Jun 10, 2018

@GrahamcOfBorg build maxscale

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: maxscale

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: maxscale

Partial log (click to expand)

shrinking /nix/store/imaxrz76alx3y8wd64q0pfxf9jja7xch-maxscale-2.1.16/lib/maxscale/libtopfilter.so.1.0.1
shrinking /nix/store/imaxrz76alx3y8wd64q0pfxf9jja7xch-maxscale-2.1.16/lib/maxscale/libMySQLBackendAuth.so.1.0.0
shrinking /nix/store/imaxrz76alx3y8wd64q0pfxf9jja7xch-maxscale-2.1.16/lib/maxscale/libGSSAPIBackendAuth.so.1.0.0
shrinking /nix/store/imaxrz76alx3y8wd64q0pfxf9jja7xch-maxscale-2.1.16/lib/maxscale/libluafilter.so.1.0.0
shrinking /nix/store/imaxrz76alx3y8wd64q0pfxf9jja7xch-maxscale-2.1.16/lib/maxscale/libreadwritesplit.so.1.0.2
shrinking /nix/store/imaxrz76alx3y8wd64q0pfxf9jja7xch-maxscale-2.1.16/lib/maxscale/libmasking.so.1.0.0
gzipping man pages under /nix/store/imaxrz76alx3y8wd64q0pfxf9jja7xch-maxscale-2.1.16/share/man/
patching script interpreter paths in /nix/store/imaxrz76alx3y8wd64q0pfxf9jja7xch-maxscale-2.1.16
/nix/store/imaxrz76alx3y8wd64q0pfxf9jja7xch-maxscale-2.1.16/bin/create_grants: interpreter directive changed from "/bin/bash" to "/nix/store/qckzjk3406va7h6s40cy9s75z2w715rq-bash-4.4-p19/bin/bash"
checking for references to /build in /nix/store/imaxrz76alx3y8wd64q0pfxf9jja7xch-maxscale-2.1.16...

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: maxscale

Partial log (click to expand)

config.status: creating config.h
config.status: executing libtool commands
[ 92%] Performing build step for 'maxscale_sqlite'
make[3]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
[ 92%] No install step for 'maxscale_sqlite'
[ 92%] Completed 'maxscale_sqlite'
[ 92%] Built target maxscale_sqlite
make: *** [Makefile:141: all] Error 2
builder for '/nix/store/m8hk3z3s15rbpgr5rxs895sadw543mfc-maxscale-2.1.16.drv' failed with exit code 2
error: build of '/nix/store/m8hk3z3s15rbpgr5rxs895sadw543mfc-maxscale-2.1.16.drv' failed

@Izorkin
Copy link
Contributor Author

Izorkin commented Jun 10, 2018

How to test build on an architecture aarch64-linux?

@xeji
Copy link
Contributor

xeji commented Jun 10, 2018

Difficult unless you have an aarch64 machine. You can guess a fix and we can try it on ofborg.
Or you can limit your package to x86_64-linux. If someone else needs it on aarch64 they can fix it later.

@Izorkin Izorkin changed the title maxscale: init at 2.1.16 maxscale: init at 2.1.17 Jun 10, 2018
@Izorkin
Copy link
Contributor Author

Izorkin commented Jun 10, 2018

@xeji Update config

@xeji
Copy link
Contributor

xeji commented Jun 10, 2018

@GrahamcOfBorg build maxscale

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: maxscale

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: maxscale

Partial log (click to expand)

shrinking /nix/store/nl2ldhis1mfywzpg4x9b8w91dad4r109-maxscale-2.1.17/lib/maxscale/libtopfilter.so.1.0.1
shrinking /nix/store/nl2ldhis1mfywzpg4x9b8w91dad4r109-maxscale-2.1.17/lib/maxscale/libMySQLBackendAuth.so.1.0.0
shrinking /nix/store/nl2ldhis1mfywzpg4x9b8w91dad4r109-maxscale-2.1.17/lib/maxscale/libGSSAPIBackendAuth.so.1.0.0
shrinking /nix/store/nl2ldhis1mfywzpg4x9b8w91dad4r109-maxscale-2.1.17/lib/maxscale/libluafilter.so.1.0.0
shrinking /nix/store/nl2ldhis1mfywzpg4x9b8w91dad4r109-maxscale-2.1.17/lib/maxscale/libreadwritesplit.so.1.0.2
shrinking /nix/store/nl2ldhis1mfywzpg4x9b8w91dad4r109-maxscale-2.1.17/lib/maxscale/libmasking.so.1.0.0
gzipping man pages under /nix/store/nl2ldhis1mfywzpg4x9b8w91dad4r109-maxscale-2.1.17/share/man/
patching script interpreter paths in /nix/store/nl2ldhis1mfywzpg4x9b8w91dad4r109-maxscale-2.1.17
/nix/store/nl2ldhis1mfywzpg4x9b8w91dad4r109-maxscale-2.1.17/bin/create_grants: interpreter directive changed from "/bin/bash" to "/nix/store/qckzjk3406va7h6s40cy9s75z2w715rq-bash-4.4-p19/bin/bash"
checking for references to /build in /nix/store/nl2ldhis1mfywzpg4x9b8w91dad4r109-maxscale-2.1.17...

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: maxscale

Partial log (click to expand)

shrinking /nix/store/ni1jpxcvdzn36nmcchj7i4ns2251jpg2-maxscale-2.1.17/lib/maxscale/libcli.so.1.0.0
shrinking /nix/store/ni1jpxcvdzn36nmcchj7i4ns2251jpg2-maxscale-2.1.17/lib/maxscale/libbinlogrouter.so.2.0.0
shrinking /nix/store/ni1jpxcvdzn36nmcchj7i4ns2251jpg2-maxscale-2.1.17/lib/maxscale/libmaxscale-common.so.1.0.0
shrinking /nix/store/ni1jpxcvdzn36nmcchj7i4ns2251jpg2-maxscale-2.1.17/lib/maxscale/libqc_dummy.so.1.0.0
shrinking /nix/store/ni1jpxcvdzn36nmcchj7i4ns2251jpg2-maxscale-2.1.17/lib/maxscale/libqc_sqlite.so.1.0.0
gzipping man pages under /nix/store/ni1jpxcvdzn36nmcchj7i4ns2251jpg2-maxscale-2.1.17/share/man/
patching script interpreter paths in /nix/store/ni1jpxcvdzn36nmcchj7i4ns2251jpg2-maxscale-2.1.17
/nix/store/ni1jpxcvdzn36nmcchj7i4ns2251jpg2-maxscale-2.1.17/bin/create_grants: interpreter directive changed from "/bin/bash" to "/nix/store/9rv2bzx7jz6wjbaxij5qq580qvzksj4i-bash-4.4-p19/bin/bash"
checking for references to /build in /nix/store/ni1jpxcvdzn36nmcchj7i4ns2251jpg2-maxscale-2.1.17...
/nix/store/ni1jpxcvdzn36nmcchj7i4ns2251jpg2-maxscale-2.1.17

@xeji
Copy link
Contributor

xeji commented Jun 10, 2018

Thank you, looks good now.

@xeji xeji merged commit 35ce5c1 into NixOS:master Jun 10, 2018
@Izorkin Izorkin deleted the mariadb-maxscale branch June 10, 2018 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants