From 31a0c5fbbd6f8957f6eb2dd7ec124dd0c13d8252 Mon Sep 17 00:00:00 2001 From: Shubham Shinde Date: Wed, 24 Apr 2024 22:43:56 +0530 Subject: [PATCH] (PA-6350) Enable agent-runtime main builds for fedora 40 Intel - Add Fedora 40 (Intel) platform definition file - Patch swig generated interface patch for Fedora 40 - Apply ruby-augeas patch to remove unused sibling parameter for all platforms using building ruby-augeas. It breaks Fedora 40 and generates a warning for other platforms. --- configs/components/_base-ruby-augeas.rb | 4 ++++ configs/components/_base-ruby-selinux.rb | 2 +- configs/platforms/fedora-40-x86_64.rb | 3 +++ ...-augeas-0.5.0-patch_remove_unused_parameter.patch | 12 ++++++++++++ 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 configs/platforms/fedora-40-x86_64.rb create mode 100644 resources/patches/augeas/ruby-augeas-0.5.0-patch_remove_unused_parameter.patch diff --git a/configs/components/_base-ruby-augeas.rb b/configs/components/_base-ruby-augeas.rb index 8a40798c5..47ffc5c3c 100644 --- a/configs/components/_base-ruby-augeas.rb +++ b/configs/components/_base-ruby-augeas.rb @@ -5,6 +5,9 @@ pkg.add_source("file://resources/patches/augeas/ruby-augeas-0.5.0-patch_c_extension.patch") +# We can remove the below patch after https://github.com/hercules-team/ruby-augeas/pull/17 is merged. +pkg.add_source("file://resources/patches/augeas/ruby-augeas-0.5.0-patch_remove_unused_parameter.patch") + # These can be overridden by the including component. ruby_version ||= settings[:ruby_version] host_ruby ||= settings[:host_ruby] @@ -75,6 +78,7 @@ if ruby_version =~ /^3/ build_commands << "#{platform.patch} --strip=2 --fuzz=0 --ignore-whitespace --no-backup-if-mismatch < ../ruby-augeas-0.5.0-patch_c_extension.patch" end + build_commands << "#{platform.patch} --strip=2 --fuzz=0 --ignore-whitespace --no-backup-if-mismatch < ../ruby-augeas-0.5.0-patch_remove_unused_parameter.patch" build_commands << "#{ruby} ext/augeas/extconf.rb" build_commands << "#{platform[:make]} -e -j$(shell expr $(shell #{platform[:num_cores]}) + 1)" diff --git a/configs/components/_base-ruby-selinux.rb b/configs/components/_base-ruby-selinux.rb index c542918b1..868565ef3 100644 --- a/configs/components/_base-ruby-selinux.rb +++ b/configs/components/_base-ruby-selinux.rb @@ -78,7 +78,7 @@ if ruby_version =~ /^3/ # swig 4.1 generated interface does not need patching - unless platform.name =~ /^(debian-12|ubuntu-24)/ + 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 end diff --git a/configs/platforms/fedora-40-x86_64.rb b/configs/platforms/fedora-40-x86_64.rb new file mode 100644 index 000000000..b6e95eee2 --- /dev/null +++ b/configs/platforms/fedora-40-x86_64.rb @@ -0,0 +1,3 @@ +platform 'fedora-40-x86_64' do |plat| + plat.inherit_from_default +end diff --git a/resources/patches/augeas/ruby-augeas-0.5.0-patch_remove_unused_parameter.patch b/resources/patches/augeas/ruby-augeas-0.5.0-patch_remove_unused_parameter.patch new file mode 100644 index 000000000..416ac7b11 --- /dev/null +++ b/resources/patches/augeas/ruby-augeas-0.5.0-patch_remove_unused_parameter.patch @@ -0,0 +1,12 @@ +diff --git a/ext/augeas/_augeas.c b/ext/augeas/_augeas.c +index f9b49d1..7ef0d7d 100644 +--- a/ruby-augeas-0.5.0/ext/augeas/_augeas.c ++++ b/ruby-augeas-0.5.0/ext/augeas/_augeas.c +@@ -184,7 +184,7 @@ VALUE augeas_mv(VALUE s, VALUE src, VALUE dst) { + * + * Remove path and all its children. Returns the number of entries removed + */ +-VALUE augeas_rm(VALUE s, VALUE path, VALUE sibling) { ++VALUE augeas_rm(VALUE s, VALUE path) { + augeas *aug = aug_handle(s); + const char *cpath = StringValueCStr(path) ;