Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Commit

Permalink
(PA-6549) Fix warning:undefining the allocator of T_DATA class
Browse files Browse the repository at this point in the history
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 #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 #620 since the fix in
swig/swig@aa21014 came after.
  • Loading branch information
AriaXLi committed Jun 12, 2024
1 parent 2f23346 commit 1b6bc80
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions configs/components/_base-ruby-selinux.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#

pkg.add_source("file://resources/patches/ruby-selinux/selinuxswig_ruby_wrap.patch")
pkg.add_source("file://resources/patches/ruby-selinux/selinuxswig_ruby_undefining_allocator.patch")

# These can be overridden by the including component.
ruby_version ||= settings[:ruby_version]
Expand Down Expand Up @@ -81,6 +82,7 @@
unless platform.name =~ /^(debian-12|ubuntu-24|fedora-40)/
steps << "#{platform.patch} --strip=0 --fuzz=0 --ignore-whitespace --no-backup-if-mismatch < ../selinuxswig_ruby_wrap.patch"
end
steps << "#{platform.patch} --strip=0 --fuzz=0 --ignore-whitespace --no-backup-if-mismatch < ../selinuxswig_ruby_undefining_allocator.patch"
end

# libselinux 3.3 is the minimum version we want to build on RHEL 9, but the
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- selinuxswig_ruby_wrap.c.orig 2024-06-11 20:02:30.112707265 +0000
+++ selinuxswig_ruby_wrap.c 2024-06-11 22:34:16.000151780 +0000
@@ -1510,7 +1510,7 @@
_cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
}
- rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
+ rb_undef_alloc_func(rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer));
free((void *) klass_name);
}

0 comments on commit 1b6bc80

Please sign in to comment.