-
Notifications
You must be signed in to change notification settings - Fork 88
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
(PA-4844) Patch the autogenerated selinux C extension #620
Conversation
Calling into selinux from Ruby 3.2 generates a warning: selinux.so: warning: undefining the allocator of T_DATA class swig_runtime_data This is because ruby 3.2 requires C extensions to "either use rb_define_alloc_func() to overwrite it or rb_undef_alloc_func() to delete it."[1] The selinux C extension selinuxswig_ruby_wrap.c is autogenerated by swig from the selinuxswig_i template. swig 4.1.1 contains the fix for this[2] but we are using an older version on RHEL7. So patch the autogenerated C extension, which needs to happen after the code is generated and before it's compiled. [1] https://github.com/ruby/ruby/blob/6963f8f743b42f9004a0879cd66c550f18987352/doc/extension.rdoc#label-Write+the+C+Code [2] swig/swig@962f090
I built this manually and verified it doesn't generate the error we were seeing in https://tickets.puppetlabs.com/browse/PA-4844
|
|
This issue is very similar to PA-4844 (puppetlabs#620) except it affects augeas instead of selinux When puppet is run with Ruby 3.2, this warning is generated: `/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/augeas.rb:48: warning: undefining the allocator of T_DATA class Augeas` This commit patches the autogenerated augeas C extension so there is no warning for augeas
This issue is very similar to PA-4844 (puppetlabs#620) except it affects augeas instead of selinux When puppet is run with Ruby 3.2, this warning is generated: `/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/augeas.rb:48: warning: undefining the allocator of T_DATA class Augeas` This commit patches the autogenerated augeas C extension so there is no warning for augeas
This issue is very similar to PA-4844 (puppetlabs#620) except it affects augeas instead of selinux When puppet is run with Ruby 3.2, this warning is generated: `/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/augeas.rb:48: warning: undefining the allocator of T_DATA class Augeas` This commit patches the autogenerated augeas C extension so there is no warning for augeas
After puppetlabs/puppet#9349 was merged the warning: undefining the allocator of T_DATA class SWIG::TYPE_p_selabel_handle error popped up again on RHEL-8 x86_64. We ran into this previously and thought puppetlabs#620 fixed it completely. This issue was completely fixed in swig 4.2.0+. This commit patches selinuxswig_ruby_wrap.c with swig/swig@aa21014 and is applied after the patch from puppetlabs#620 since the fix in swig/swig@aa21014 came after.
After puppetlabs/puppet#9349 was merged the warning: undefining the allocator of T_DATA class SWIG::TYPE_p_selabel_handle error popped up again on RHEL-8 x86_64. We ran into this previously and thought puppetlabs#620 fixed it completely. This issue was completely fixed in swig 4.2.0+. This commit patches selinuxswig_ruby_wrap.c with swig/swig@aa21014 and is applied after the patch from puppetlabs#620 since the fix in swig/swig@aa21014 came after.
Calling into selinux from Ruby 3.2 generates a warning:
This is because ruby 3.2 requires C extensions to "either use rb_define_alloc_func() to overwrite it or rb_undef_alloc_func() to delete it."[1] The selinux C extension selinuxswig_ruby_wrap.c is autogenerated by swig from the selinuxswig_i template.
swig 4.1.1 contains the fix for this[2] but we are using an older version on RHEL7. So patch the autogenerated C extension, which needs to happen after the code is generated and before it's compiled.
[1] https://github.com/ruby/ruby/blob/6963f8f743b42f9004a0879cd66c550f18987352/doc/extension.rdoc#label-Write+the+C+Code
[2] swig/swig@962f090