I'm trying to build a Debian package for Ruby, but checkinstall is freezing during "make install"

Hello,

I have a question about compiling and packaging Ruby.

I'm compiling Ruby 2.5.5 with jemalloc in a Docker container, and I'm
trying to build a Debian package with checkinstall
<https://mailtrack.io/trace/link/2bd58d769ee1cfcbd8c05e558542f45495357d27?url=https%3A%2F%2Fwiki.debian.org%2FCheckInstall&userId=2274821&signature=3aafc1d2bc6c7b16>.
This tool runs "make install", records a list of changed files, and then
saves all of these files into a deb package. However, checkinstall is
getting stuck after this line: "generating x86_64-linux-fake.rb". If I run
"make install" by itself, then everything works as normal.

I have prepared a gist that contains my Dockerfile and build script:

<https://mailtrack.io/trace/link/5b3eced0dd4abea0bad044d823cfc28d15e8dbd2?url=https%3A%2F%2Fgist.github.com%2Fndbroadbent%2F2b03ea2c9c6ed08500cd844234205e55&userId=2274821&signature=545631d43e929c5e>

Steps to reproduce:

# Requirements: Docker, curl

mkdir -p /tmp/docker-ruby
cd docker-ruby
curl -sfLO https://gist.githubusercontent.com/ndbroadbent/2b03ea2c9c6ed08500cd844234205e55/raw/bd7f72bbf77dc6840b9e32c02166ce0f3489e306/build_ruby.sh
<https://mailtrack.io/trace/link/1d042cd8478f9986faa576df21efc06828be96a4?url=https%3A%2F%2Fgist.githubusercontent.com%2Fndbroadbent%2F2b03ea2c9c6ed08500cd844234205e55%2Fraw%2Fbd7f72bbf77dc6840b9e32c02166ce0f3489e306%2Fbuild_ruby.sh&userId=2274821&signature=d713db586a66f627>
curl -sfLO https://gist.githubusercontent.com/ndbroadbent/2b03ea2c9c6ed08500cd844234205e55/raw/bd7f72bbf77dc6840b9e32c02166ce0f3489e306/Dockerfile.ruby
<https://mailtrack.io/trace/link/8af225d8ee4ab0cf00144eb36fc63efc906e4528?url=https%3A%2F%2Fgist.githubusercontent.com%2Fndbroadbent%2F2b03ea2c9c6ed08500cd844234205e55%2Fraw%2Fbd7f72bbf77dc6840b9e32c02166ce0f3489e306%2FDockerfile.ruby&userId=2274821&signature=a66386a39ba16a38>
chmod +x build_ruby.sh
./build_ruby.sh

You should see that "checkinstall" gets permanently stuck on Step 14/15.

Unfortunately there is no output or error messages, and I couldn't see
anything in the Makefile that might be causing it (but I don't have too
much relevant experience in this area.)

A few questions:

   - Is there a checkinstall flag that I could use to solve this problem?
   - Is there a way that I could wrap or modify the "make install" command
   to avoid getting stuck? (I tried bash -c "make install", but that didn't
   help.)
   - Is there a different tool I should be using to prepare the deb package?

Thanks very much for your time!

Best Regards,
Nathan Broadbent

P.S. I have also asked this same question on the Unix StackExchange site:
https://unix.stackexchange.com/questions/518505/why-is-checkinstall-freezing-when-i-try-to-run-make-install-for-ruby-2-5-5
<https://mailtrack.io/trace/link/778e2073c94aeac97674f6638e8d147d27dd22b5?url=https%3A%2F%2Funix.stackexchange.com%2Fquestions%2F518505%2Fwhy-is-checkinstall-freezing-when-i-try-to-run-make-install-for-ruby-2-5-5&userId=2274821&signature=226c455f3715a3b0>