voxpupuli / puppet-zabbix

Puppet module for creating and maintaining zabbix components with puppet.
https://forge.puppet.com/puppet/zabbix
Apache License 2.0
79 stars 229 forks source link

Drop Debian mkdir symlink hack #918

Closed evgeni closed 4 months ago

evgeni commented 6 months ago

Pull Request (PR) description

This Pull Request (PR) fixes the following issues

evgeni commented 6 months ago

"fun" fact? this only fails inside Puppet. Native Ruby from Debian installs it fine. Puppet's Ruby does not. :eyes:

smortex commented 6 months ago

This seems to be caused by the way Ruby is build by Vanagon to be bundled in AIO packages: at build time, mkdir(1) is found as /usr/bin/mkdir for (bad?) reasons, and this path is saved in rbconfig.rb (part of Ruby) that is used to generate Makefiles when building native gems.

romain@ns3006942 ~ % dpkg -S rbconfig.rb
puppet-agent: /opt/puppetlabs/puppet/lib/ruby/3.2.0/x86_64-linux/rbconfig.rb
libruby2.7:amd64: /usr/lib/x86_64-linux-gnu/ruby/2.7.0/rbconfig.rb
gitlab-ce: /opt/gitlab/embedded/lib/ruby/3.1.0/x86_64-linux/rbconfig.rb
romain@ns3006942 ~ % grep mkdir /opt/puppetlabs/puppet/lib/ruby/3.2.0/x86_64-linux/rbconfig.rb /usr/lib/x86_64-linux-gnu/ruby/2.7.0/rbconfig.rb /opt/gitlab/embedded/lib/ruby/3.1.0/x86_64-linux/rbconfig.rb
/opt/puppetlabs/puppet/lib/ruby/3.2.0/x86_64-linux/rbconfig.rb:  CONFIG["MKDIR_P"] = "/usr/bin/mkdir -p"
/opt/puppetlabs/puppet/lib/ruby/3.2.0/x86_64-linux/rbconfig.rb:  CONFIG["MAKEDIRS"] = "/usr/bin/mkdir -p"
/usr/lib/x86_64-linux-gnu/ruby/2.7.0/rbconfig.rb:  CONFIG["MAKEDIRS"] = "/bin/mkdir -p"
/usr/lib/x86_64-linux-gnu/ruby/2.7.0/rbconfig.rb:  CONFIG["MKDIR_P"] = "/bin/mkdir -p"
/opt/gitlab/embedded/lib/ruby/3.1.0/x86_64-linux/rbconfig.rb:  CONFIG["MAKEDIRS"] = "/bin/mkdir -p"
/opt/gitlab/embedded/lib/ruby/3.1.0/x86_64-linux/rbconfig.rb:  CONFIG["MKDIR_P"] = "/bin/mkdir -p"
evgeni commented 6 months ago

Ah, thanks for tracking that down!