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

Add CentOS 7 + Devtoolset 7 image #8

Merged
merged 2 commits into from
Oct 3, 2019

Conversation

rvagg
Copy link
Contributor

@rvagg rvagg commented Oct 2, 2019

Ref: Level/leveldown#672

$ docker run --rm prebuild/centos7-devtoolset7:latest node -v
v12.10.0
$ docker run --rm prebuild/centos7-devtoolset7:latest gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/opt/rh/devtoolset-7/root/usr --mandir=/opt/rh/devtoolset-7/root/usr/share/man --infodir=/opt/rh/devtoolset-7/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --enable-plugin --with-linker-hash-style=gnu --enable-initfini-array --with-default-libstdcxx-abi=gcc4-compatible --with-isl=/builddir/build/BUILD/gcc-7.3.1-20180303/obj-x86_64-redhat-linux/isl-install --enable-libmpx --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 7.3.1 20180303 (Red Hat 7.3.1-5) (GCC)

The neat thing about this is that you get to compile with gcc 7 but glibc 2.17, so binaries are compatible for Ubuntu 14.04 and Debian 8.

@vweevers
Copy link
Member

vweevers commented Oct 2, 2019

To be sure: the binaries are forward compatible as well, right? So they can replace the ones we currently build on Travis Ubuntu.

centos7-devtoolset7/Dockerfile Outdated Show resolved Hide resolved
@rvagg
Copy link
Contributor Author

rvagg commented Oct 2, 2019

To be sure: the binaries are forward compatible as well, right

yep, like magic. The RHEL folks put in a ton of work to make the devtoolsets work on their older base systems (libc mainly), which involves shipping a delta library that contains the new stuff that can be statically linked in where it's used. We use this method for building Node binary releases.

Of course it would be worth producing a test prebuild if possible to have complete confidence in it.

rvagg added a commit to Level/leveldown that referenced this pull request Oct 2, 2019
* Remove prebuild settings from standard "linux" job
* Add centos7 job with prebuild settings
* Add centos7-devtoolset7 docker image prebuild script

Ref: prebuild/docker-images#8
rvagg added a commit to Level/leveldown that referenced this pull request Oct 2, 2019
* Remove prebuild settings from standard "linux" job
* Add centos7 job with prebuild settings
* Add centos7-devtoolset7 docker image prebuild script

Ref: prebuild/docker-images#8
Ref: #672
Copy link
Member

@vweevers vweevers left a comment

Choose a reason for hiding this comment

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

LGTM! I'll add it to Docker Hub, and do some tests, later this week.

@ralphtheninja ralphtheninja merged commit 95a981c into prebuild:master Oct 3, 2019
@ralphtheninja
Copy link
Member

@rvagg Invited you to prebuild org. Join if you like 😄

@vweevers
Copy link
Member

vweevers commented Oct 3, 2019

Added to Docker Hub, it's building now.

@vweevers
Copy link
Member

vweevers commented Oct 3, 2019

Build completed. But it seems make is missing:

$ cd leveldown
$ docker run --rm -v $(pwd):/app prebuild/centos7-devtoolset7 npm run prebuild

> leveldown@5.2.1 prebuild /app
> prebuildify -t 8.14.0 --napi --strip

gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack     at getNotFoundError (/app/node_modules/which/which.js:13:12)
gyp ERR! stack     at F (/app/node_modules/which/which.js:68:19)
gyp ERR! stack     at E (/app/node_modules/which/which.js:80:29)
gyp ERR! stack     at /app/node_modules/which/which.js:89:16
gyp ERR! stack     at /app/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /app/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqCallback.oncomplete (fs.js:169:21)

@vweevers
Copy link
Member

vweevers commented Oct 3, 2019

After yum install -y make it works.

$ file prebuilds/*/*
prebuilds/linux-x64/node.napi.node: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=53300a0038f931b4be5609f88bf050ee66d12471, stripped
$ readelf -p .comment prebuilds/*/*

String dump of section '.comment':
  [     0]  GCC: (GNU) 7.3.1 20180303 (Red Hat 7.3.1-5)

npm run test-prebuild passes.

Symbols:

Click to expand
$ objdump -T prebuilds/*/* | grep -i glibc
0000000000000000      DF *UND*  0000000000000000  GLIBCXX_3.4 _ZNSs6appendEPKcm
0000000000000000      DF *UND*  0000000000000000  GLIBCXX_3.4 _ZSt20__throw_length_errorPKc
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 fileno
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.3.2 pthread_cond_destroy
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 memset
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 snprintf
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 mmap64
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 close
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 abort
0000000000000000      DF *UND*  0000000000000000  GLIBCXX_3.4 _ZNSsC1EPKcmRKSaIcE
0000000000000000      DF *UND*  0000000000000000  GLIBCXX_3.4 _Znam
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 fseek
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.3.2 pthread_cond_signal
0000000000000000      DF *UND*  0000000000000000  GLIBCXX_3.4 _ZdlPv
0000000000000000      DF *UND*  0000000000000000  GLIBCXX_3.4 _ZNSs7reserveEm
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 __assert_fail
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 gettimeofday
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 malloc
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 unlink
0000000000000000      DF *UND*  0000000000000000  GLIBCXX_3.4 _ZSt18_Rb_tree_decrementPSt18_Rb_tree_node_base
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 rmdir
0000000000000000      DF *UND*  0000000000000000  GLIBCXX_3.4 _ZNSsC1ERKSs
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 pthread_mutex_init
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 geteuid
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 free
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 fread_unlocked
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 strlen
0000000000000000      DF *UND*  0000000000000000  GLIBCXX_3.4 _ZNSs4_Rep10_M_destroyERKSaIcE
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 pthread_create
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 opendir
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.3.2 pthread_cond_init
0000000000000000  w   DF *UND*  0000000000000000  GLIBC_2.2.5 __cxa_finalize
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 fdatasync
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 strrchr
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 fsync
0000000000000000      DF *UND*  0000000000000000  GLIBCXX_3.4 _ZSt18_Rb_tree_incrementPKSt18_Rb_tree_node_base
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 pthread_self
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 fwrite_unlocked
0000000000000000      DF *UND*  0000000000000000  GLIBCXX_3.4 _ZNKSs7compareEPKc
0000000000000000      DF *UND*  0000000000000000  GLIBCXX_3.4 _ZNSsC1EPKcRKSaIcE
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 usleep
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 strerror
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 open64
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 memmove
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 vsnprintf
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 getrlimit64
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 getenv
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 pread64
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 __errno_location
0000000000000000      DF *UND*  0000000000000000  GLIBCXX_3.4 _ZSt29_Rb_tree_insert_and_rebalancebPSt18_Rb_tree_node_baseS0_RS_
0000000000000000      DF *UND*  0000000000000000  GLIBCXX_3.4 _ZSt28_Rb_tree_rebalance_for_erasePSt18_Rb_tree_node_baseRS_
0000000000000000      DF *UND*  0000000000000000  GLIBCXX_3.4 _ZNSs6assignEPKcm
0000000000000000      DF *UND*  0000000000000000  GLIBCXX_3.4 _ZNSs6assignERKSs
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.3.2 pthread_cond_wait
0000000000000000      DF *UND*  0000000000000000  GLIBCXX_3.4 _ZdaPv
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 pthread_once
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 memcmp
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 munmap
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 feof
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 fclose
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 __xstat64
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 localtime_r
0000000000000000      DF *UND*  0000000000000000  GLIBCXX_3.4 _ZSt18_Rb_tree_incrementPSt18_Rb_tree_node_base
0000000000000000      DF *UND*  0000000000000000  GLIBCXX_3.4 _ZSt17__throw_bad_allocv
0000000000000000      DO *UND*  0000000000000000  GLIBCXX_3.4 _ZNSs4_Rep20_S_empty_rep_storageE
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 closedir
0000000000000000      DF *UND*  0000000000000000  GLIBCXX_3.4 _ZNSs6resizeEmc
0000000000000000      DO *UND*  0000000000000000  GLIBC_2.2.5 stderr
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 access
0000000000000000  w   DF *UND*  0000000000000000  GLIBC_2.2.5 __pthread_key_create
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 fopen64
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 fwrite
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 pthread_mutex_lock
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 fprintf
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 pthread_mutex_destroy
0000000000000000      DF *UND*  0000000000000000  GLIBCXX_3.4 _Znwm
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.3.2 pthread_cond_broadcast
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 pthread_mutex_unlock
0000000000000000      DF *UND*  0000000000000000  GLIBCXX_3.4 _ZNSs12_M_leak_hardEv
0000000000000000      DF *UND*  0000000000000000  GLIBCXX_3.4 _ZNSs4swapERSs
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.14  memcpy
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 fcntl
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 fflush_unlocked
0000000000000000      DF *UND*  0000000000000000  GLIBCXX_3.4 _ZNSs6appendERKSs
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 rename
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 readdir64
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 mkdir
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 fflush

@vweevers
Copy link
Member

vweevers commented Oct 3, 2019

Also works in Debian 8! At least when tested with:

docker run -it --rm -v $(pwd):/app -w /app node:lts-jessie npm run test-prebuild

As well as on Node.js 13 (using a nightly build from a few days ago, same one I used to test the current leveldown prebuilds).

@rvagg rvagg deleted the rvagg/centos7 branch October 4, 2019 02:52
@rvagg
Copy link
Contributor Author

rvagg commented Oct 4, 2019

Awesome, that means it'll even run on Ubuntu 14.04 (I'm ashamed to say I still maintain a 14.04 system), RHEL 7, and of course CentOS 7. So, all major still-supported Linux distro versions are supported by these binaries.
This might be worth documenting somewhere in prebuild I suppose if there are other consumers of this org's images?

@vweevers
Copy link
Member

vweevers commented Oct 4, 2019

Agree, see #1. AFAIK there are no other consumers yet. That can change if we invest some time in documentation (and perhaps additional tooling) for native addon authors. The platform support of leveldown is quite good and its setup can serve as an inspiration, ultimately benefiting end users.

vweevers pushed a commit to Level/leveldown that referenced this pull request Oct 4, 2019
* Remove prebuild settings from standard "linux" job
* Add centos7 job with prebuild settings
* Add centos7-devtoolset7 docker image prebuild script

Ref: prebuild/docker-images#8
Ref: #672
@vweevers
Copy link
Member

Some docs now available here: https://github.com/prebuild/prebuildify-cross#images. I'll move that to prebuild-images later.

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