Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Add openssl version 3 support #1541

Merged
merged 17 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@
path = source/ext/jemalloc
url = ../../jemalloc/jemalloc.git
branch = stable-4
[submodule "source/ext/ruby_sslv3"]
path = source/ext/ruby_sslv3
url = ../../ruby/ruby.git
branch = ruby_3_1
ignore = dirty
108 changes: 99 additions & 9 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ AUOMS_KITS_RELEASE_DIR := $(AUOMS_KITS_DIR)/release/2.5.2-52-ND
AUOMS_KITS_RELEASE_1_3_DIR := $(AUOMS_KITS_DIR)/release/1.3.0-3

RUBY_DIR := $(BASE_DIR)/source/ext/ruby
RUBY_SSLV3_DIR := $(BASE_DIR)/source/ext/ruby_sslv3
# This Ruby version number refers only to the major/minor version (not teeny)
# of the Ruby installed with the OMSAgent
RUBY_VER := $(RUBY_VERSION_MAJOR_MINOR)
Expand Down Expand Up @@ -83,6 +84,10 @@ else
INSTALLER_DATAFILES_CURRENT := $(INSTALLER_DATAFILES_DPKG)
endif

INSTALLER_DATAFILES3 := base_omsagent.data linux.data ruby3.data
INSTALLER_DATAFILES3_RPM := $(INSTALLER_DATAFILES3) linux_rpm.data
INSTALLER_DATAFILES3_DPKG := $(INSTALLER_DATAFILES3) linux_dpkg.data

ifeq ("$(wildcard /usr/bin/dpkg-deb)","")
DPKG_LOCATION="--DPKG_LOCATION=$(PAL_DIR)/installer/InstallBuilder/tools/bin/dpkg-deb-$(PF_ARCH)"
else
Expand Down Expand Up @@ -127,7 +132,8 @@ SYSTEST_CONFIG := $(BASE_DIR)/test/config/systest.conf
all : $(OMI_LIBRARY_LIB_BASE) $(DSC_TARGET_DIR) $(RUBY_DEST_DIR) $(IN_PLUGINS_LIB) sepolicy kit
# After a successful make, undo the Ruby patches for sequential builds from old branches
@echo "Cleaning patched Ruby files..."
cd $(BASE_DIR)/source/ext/ruby; git clean -dfx; git reset --hard
cd $(RUBY_DIR); git clean -dfx; git reset --hard
cd $(RUBY_SSLV3_DIR); git clean -dfx; git reset --hard

compile_only : $(OMI_LIBRARY_LIB_BASE) $(DSC_TARGET_DIR) $(RUBY_DEST_DIR) $(IN_PLUGINS_LIB) sepolicy

Expand All @@ -150,11 +156,13 @@ clean : clean-status
clean-ruby : clean
sudo $(RMDIR) $(BASE_DIR)/intermediate
sudo $(RMDIR) $(RUBY_DIR)/.ext
sudo $(RMDIR) $(RUBY_SSLV3_DIR)/.ext
#
# Warning: This step will clean out checked out files from Ruby directory
#
@echo "Cleaning RUBY source directory ..."
cd $(RUBY_DIR); git clean -dfx; git reset --hard
cd $(RUBY_SSLV3_DIR); git clean -dfx; git reset --hard
#
# Warning: This step will clean out checked out files from fluentd directory
#
Expand Down Expand Up @@ -212,6 +220,9 @@ ifeq ($(PF_ARCH),x64)
cd $(OMI_ROOT); $(RMDIR) output; ln -s output_openssl_1.1.0 output
$(MAKE) -C $(DSC_DIR) dsc110
$(MAKE) -C $(DSC_DIR) dsckit110
cd $(OMI_ROOT); $(RMDIR) output; ln -s output_openssl_3.0.0 output
NarineM marked this conversation as resolved.
Show resolved Hide resolved
$(MAKE) -C $(DSC_DIR) dsc300
$(MAKE) -C $(DSC_DIR) dsckit300
endif
cd $(OMI_ROOT); $(RMDIR) output
endif
Expand Down Expand Up @@ -266,6 +277,8 @@ ifeq ($(ULINUX),1)
ifeq ($(PF_ARCH),x64)
@$(ECHO) "========================= Performing Building Ruby for SSL v1.1.0 ..."
$(BASE_DIR)/build/buildRuby.sh 110
@$(ECHO) "========================= Performing Building Ruby for SSL v3.0.0 ..."
$(BASE_DIR)/build/buildRuby.sh 300
endif
else
@$(ECHO) "========================= Performing Building Ruby"
Expand Down Expand Up @@ -345,12 +358,13 @@ $(TARGET_DIR)/$(OUTPUT_PACKAGE_PREFIX_DEB).sh : $(INTERMEDIATE_DIR)/$(OUTPUT_PAC
ifeq ($(PF_ARCH),x64)
$(INTERMEDIATE_DIR)/$(OUTPUT_PACKAGE_PREFIX).tar : $(RUBY_DEST_DIR) $(IN_PLUGINS_LIB) \
$(INTERMEDIATE_DIR)/100/$(OUTPUT_PACKAGE_PREFIX).rpm $(INTERMEDIATE_DIR)/100/$(OUTPUT_PACKAGE_PREFIX).deb \
$(INTERMEDIATE_DIR)/110/$(OUTPUT_PACKAGE_PREFIX).rpm $(INTERMEDIATE_DIR)/110/$(OUTPUT_PACKAGE_PREFIX).deb
$(INTERMEDIATE_DIR)/110/$(OUTPUT_PACKAGE_PREFIX).rpm $(INTERMEDIATE_DIR)/110/$(OUTPUT_PACKAGE_PREFIX).deb \
$(INTERMEDIATE_DIR)/300/$(OUTPUT_PACKAGE_PREFIX).rpm $(INTERMEDIATE_DIR)/300/$(OUTPUT_PACKAGE_PREFIX).deb

@echo "========================= Performing Building .tar file"

# Gather the DSC bits that we need
$(RM) $(INTERMEDIATE_DIR)/100/omsconfig-*.{rpm,deb} $(INTERMEDIATE_DIR)/110/omsconfig-*.{rpm,deb}
$(RM) $(INTERMEDIATE_DIR)/100/omsconfig-*.{rpm,deb} $(INTERMEDIATE_DIR)/110/omsconfig-*.{rpm,deb} $(INTERMEDIATE_DIR)/300/omsconfig-*.{rpm,deb}

cd $(DSC_DIR)/release; $(COPY) `ls omsconfig-*.ssl_100.*.rpm | sort | tail -1` $(INTERMEDIATE_DIR)/100
cd $(DSC_DIR)/release; $(COPY) `ls omsconfig-*.ssl_100.*.deb | sort | tail -1` $(INTERMEDIATE_DIR)/100
Expand All @@ -360,6 +374,10 @@ $(INTERMEDIATE_DIR)/$(OUTPUT_PACKAGE_PREFIX).tar : $(RUBY_DEST_DIR) $(IN_PLUGINS
cd $(DSC_DIR)/release; $(COPY) `ls omsconfig-*.ssl_110.*.deb | sort | tail -1` $(INTERMEDIATE_DIR)/110
cd $(INTERMEDIATE_DIR)/110; for f in omsconfig-*.{rpm,deb}; do SOURCE=$$f; DEST=`echo $$SOURCE | sed 's/.ssl_110././'` ; $(MV) $$SOURCE $$DEST; done

cd $(DSC_DIR)/release; $(COPY) `ls omsconfig-*.ssl_300.*.rpm | sort | tail -1` $(INTERMEDIATE_DIR)/300
cd $(DSC_DIR)/release; $(COPY) `ls omsconfig-*.ssl_300.*.deb | sort | tail -1` $(INTERMEDIATE_DIR)/300
cd $(INTERMEDIATE_DIR)/300; for f in omsconfig-*.{rpm,deb}; do SOURCE=$$f; DEST=`echo $$SOURCE | sed 's/.ssl_300././'` ; $(MV) $$SOURCE $$DEST; done

# Pick up the OSS (Open Source) providers
$(RMDIR) $(INTERMEDIATE_DIR)/oss-kits
$(MKPATH) $(INTERMEDIATE_DIR)/oss-kits
Expand Down Expand Up @@ -388,40 +406,46 @@ $(INTERMEDIATE_DIR)/$(OUTPUT_PACKAGE_PREFIX).tar : $(RUBY_DEST_DIR) $(IN_PLUGINS
# Gather SCX packages
cd $(INTERMEDIATE_DIR)/scxbundle.*; $(COPY) 100/scx-*.universal.s.$(PF_ARCH).{deb,rpm} $(INTERMEDIATE_DIR)/100
cd $(INTERMEDIATE_DIR)/scxbundle.*; $(COPY) 110/scx-*.universal.s.$(PF_ARCH).{deb,rpm} $(INTERMEDIATE_DIR)/110
cd $(INTERMEDIATE_DIR)/scxbundle.*; $(COPY) 300/scx-*.universal.s.$(PF_ARCH).{deb,rpm} $(INTERMEDIATE_DIR)/300

# Gather apache and mysql cimprov bundle scripts from SCX
cd $(INTERMEDIATE_DIR)/scxbundle.*; $(COPY) *.sh $(INTERMEDIATE_DIR)/oss-kits

# Gather OMI packages from omi-kits
cd $(OMI_KITS); $(COPY) release/omi-*.ssl_100.ulinux.s.$(PF_ARCH).{deb,rpm} $(INTERMEDIATE_DIR)/100
cd $(OMI_KITS); $(COPY) release/omi-*.ssl_110.ulinux.s.$(PF_ARCH).{deb,rpm} $(INTERMEDIATE_DIR)/110
cd $(OMI_KITS); $(COPY) release/omi-*.ssl_300.ulinux.s.$(PF_ARCH).{deb,rpm} $(INTERMEDIATE_DIR)/300

# Remove ssl_100 and ssl_110 from omi filenames
# Remove ssl_100, ssl_110, ssl_300 from omi filenames
cd $(INTERMEDIATE_DIR)/100; mv omi-*.deb `ls omi-*.deb | sed "s/\.ssl_100\./\./g"`
cd $(INTERMEDIATE_DIR)/100; mv omi-*.rpm `ls omi-*.rpm | sed "s/\.ssl_100\./\./g"`
cd $(INTERMEDIATE_DIR)/110; mv omi-*.deb `ls omi-*.deb | sed "s/\.ssl_110\./\./g"`
cd $(INTERMEDIATE_DIR)/110; mv omi-*.rpm `ls omi-*.rpm | sed "s/\.ssl_110\./\./g"`
cd $(INTERMEDIATE_DIR)/300; mv omi-*.deb `ls omi-*.deb | sed "s/\.ssl_300\./\./g"`
cd $(INTERMEDIATE_DIR)/300; mv omi-*.rpm `ls omi-*.rpm | sed "s/\.ssl_300\./\./g"`

chmod +x $(INTERMEDIATE_DIR)/bundles/**/*.sh

# Build the tar file containing both .rpm and .deb packages
cd $(INTERMEDIATE_DIR); tar cvf $(OUTPUT_PACKAGE_PREFIX).tar 100/*.{deb,rpm} 110/*.{deb,rpm} oss-kits/* bundles/*
cd $(INTERMEDIATE_DIR); tar cvf $(OUTPUT_PACKAGE_PREFIX).tar 100/*.{deb,rpm} 110/*.{deb,rpm} 300/*.{deb,rpm} oss-kits/* bundles/*

$(INTERMEDIATE_DIR)/$(OUTPUT_PACKAGE_PREFIX_RPM).tar : $(RUBY_DEST_DIR) $(IN_PLUGINS_LIB) \
$(INTERMEDIATE_DIR)/100/$(OUTPUT_PACKAGE_PREFIX).rpm $(INTERMEDIATE_DIR)/110/$(OUTPUT_PACKAGE_PREFIX).rpm
$(INTERMEDIATE_DIR)/100/$(OUTPUT_PACKAGE_PREFIX).rpm $(INTERMEDIATE_DIR)/110/$(OUTPUT_PACKAGE_PREFIX).rpm \
$(INTERMEDIATE_DIR)/300/$(OUTPUT_PACKAGE_PREFIX).rpm

@echo "========================= Performing Building RPM .tar file"

# Build the tar file containing .rpm packages
cd $(INTERMEDIATE_DIR); tar cvf $(OUTPUT_PACKAGE_PREFIX_RPM).tar 100/*.rpm 110/*.rpm oss-kits/*
cd $(INTERMEDIATE_DIR); tar cvf $(OUTPUT_PACKAGE_PREFIX_RPM).tar 100/*.rpm 110/*.rpm 300/*.rpm oss-kits/*

$(INTERMEDIATE_DIR)/$(OUTPUT_PACKAGE_PREFIX_DEB).tar : $(RUBY_DEST_DIR) $(IN_PLUGINS_LIB) \
$(INTERMEDIATE_DIR)/100/$(OUTPUT_PACKAGE_PREFIX).deb $(INTERMEDIATE_DIR)/110/$(OUTPUT_PACKAGE_PREFIX).deb
$(INTERMEDIATE_DIR)/100/$(OUTPUT_PACKAGE_PREFIX).deb $(INTERMEDIATE_DIR)/110/$(OUTPUT_PACKAGE_PREFIX).deb \
$(INTERMEDIATE_DIR)/300/$(OUTPUT_PACKAGE_PREFIX).deb

@echo "========================= Performing Building DEB .tar file"

# Build the tar file containing .deb packages
cd $(INTERMEDIATE_DIR); tar cvf $(OUTPUT_PACKAGE_PREFIX_DEB).tar 100/*.deb 110/*.deb oss-kits/*
cd $(INTERMEDIATE_DIR); tar cvf $(OUTPUT_PACKAGE_PREFIX_DEB).tar 100/*.deb 110/*.deb 300/*.deb oss-kits/*

else
$(INTERMEDIATE_DIR)/$(OUTPUT_PACKAGE_PREFIX).tar : $(RUBY_DEST_DIR) $(IN_PLUGINS_LIB) \
Expand Down Expand Up @@ -610,6 +634,63 @@ $(INTERMEDIATE_DIR)/110/$(OUTPUT_PACKAGE_PREFIX).deb:
--OUTPUTFILE=$(OUTPUT_PACKAGE_PREFIX) \
$(INSTALLER_DATAFILES_DPKG)
mv $(INTERMEDIATE_DIR)/$(OUTPUT_PACKAGE_PREFIX).deb $(INTERMEDIATE_DIR)/110

$(INTERMEDIATE_DIR)/300/$(OUTPUT_PACKAGE_PREFIX).rpm:
@echo "========================= Performing Building RPM package (SSL 3.0)"
$(MKPATH) $(INSTALLER_TMPDIR)
$(MKPATH) $(INTERMEDIATE_DIR)/300

sudo $(RMDIR) $(STAGING_DIR)
python $(PAL_DIR)/installer/InstallBuilder/installbuilder.py \
--BASE_DIR=$(BASE_DIR) \
--TARGET_DIR=$(INTERMEDIATE_DIR) \
--INTERMEDIATE_DIR=$(INSTALLER_TMPDIR) \
--STAGING_DIR=$(STAGING_DIR) \
--BUILD_TYPE=$(BUILD_TYPE) \
--BUILD_CONFIGURATION=$(BUILD_CONFIGURATION) \
--RUBY_INT=intermediate/$(BUILD_CONFIGURATION)/300/ruby \
--RUBY_ARCH=$(RUBY_ARCH) \
--RUBY_ARCM=$(RUBY_ARCM) \
--PFARCH=$(PF_ARCH) \
--PFDISTRO=$(PF_DISTRO) \
--PFMAJOR=$(PF_MAJOR) \
--PFMINOR=$(PF_MINOR) \
--VERSION=$(OMS_BUILDVERSION_MAJOR).$(OMS_BUILDVERSION_MINOR).$(OMS_BUILDVERSION_PATCH) \
--RELEASE=$(OMS_BUILDVERSION_BUILDNR) \
--VERSION_IDENT="$(OMS_BUILDVERSION_DATE) $(OMS_BUILDVERSION_STATUS)" \
--DATAFILE_PATH=$(BASE_DIR)/installer/datafiles \
--OUTPUTFILE=$(OUTPUT_PACKAGE_PREFIX) \
$(INSTALLER_DATAFILES3_RPM)
mv $(INTERMEDIATE_DIR)/$(OUTPUT_PACKAGE_PREFIX).rpm $(INTERMEDIATE_DIR)/300

$(INTERMEDIATE_DIR)/300/$(OUTPUT_PACKAGE_PREFIX).deb:
@echo "========================= Performing Building DEB package (SSL 3.0)"
$(MKPATH) $(INSTALLER_TMPDIR)
$(MKPATH) $(INTERMEDIATE_DIR)/300

sudo $(RMDIR) $(STAGING_DIR)
python $(PAL_DIR)/installer/InstallBuilder/installbuilder.py \
--BASE_DIR=$(BASE_DIR) \
--TARGET_DIR=$(INTERMEDIATE_DIR) \
--INTERMEDIATE_DIR=$(INSTALLER_TMPDIR) \
--STAGING_DIR=$(STAGING_DIR) \
--BUILD_TYPE=$(BUILD_TYPE) \
--BUILD_CONFIGURATION=$(BUILD_CONFIGURATION) \
--RUBY_INT=intermediate/$(BUILD_CONFIGURATION)/300/ruby \
--RUBY_ARCH=$(RUBY_ARCH) \
--RUBY_ARCM=$(RUBY_ARCM) \
--PFARCH=$(PF_ARCH) \
--PFDISTRO=$(PF_DISTRO) \
--PFMAJOR=$(PF_MAJOR) \
--PFMINOR=$(PF_MINOR) \
--VERSION=$(OMS_BUILDVERSION_MAJOR).$(OMS_BUILDVERSION_MINOR).$(OMS_BUILDVERSION_PATCH) \
--RELEASE=$(OMS_BUILDVERSION_BUILDNR) \
--VERSION_IDENT="$(OMS_BUILDVERSION_DATE) $(OMS_BUILDVERSION_STATUS)" \
$(DPKG_LOCATION) \
--DATAFILE_PATH=$(BASE_DIR)/installer/datafiles \
--OUTPUTFILE=$(OUTPUT_PACKAGE_PREFIX) \
$(INSTALLER_DATAFILES3_DPKG)
mv $(INTERMEDIATE_DIR)/$(OUTPUT_PACKAGE_PREFIX).deb $(INTERMEDIATE_DIR)/300
endif
else

Expand Down Expand Up @@ -658,6 +739,10 @@ set_ruby_test_ssl_110:
$(eval RUBY_TESTING_TARGET_NAME = test_110)
@echo "RUBY_TESTING_TARGET_NAME=${RUBY_TESTING_TARGET_NAME}"

set_ruby_test_ssl_300:
$(eval RUBY_TESTING_TARGET_NAME = test_300)
@echo "RUBY_TESTING_TARGET_NAME=${RUBY_TESTING_TARGET_NAME}"

tests : test

unittest : $(RUBY_TESTING_DIR)
Expand Down Expand Up @@ -692,15 +777,20 @@ test : omstest

tests_100: set_ruby_test_ssl_100 tests
tests_110: set_ruby_test_ssl_110 tests
tests_300: set_ruby_test_ssl_300 tests

unittest_100: set_ruby_test_ssl_100 unittest
unittest_110: set_ruby_test_ssl_110 unittest
unittest_300: set_ruby_test_ssl_300 unittest

systemtest_100: set_ruby_test_ssl_100 systemtest
systemtest_110: set_ruby_test_ssl_110 systemtest
systemtest_300: set_ruby_test_ssl_300 systemtest

omstest_100: set_ruby_test_ssl_100 omstest
omstest_110: set_ruby_test_ssl_110 omstest
omstest_300: set_ruby_test_ssl_300 omstest

test_100: set_ruby_test_ssl_100 test
test_110: set_ruby_test_ssl_110 test
test_300: set_ruby_test_ssl_300 test
35 changes: 32 additions & 3 deletions build/buildRuby.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# Usage: buildRuby.sh <parameter>
#
# Parameter may be one of:
# "300": Build for SSL v3.0.0
# "110": Build for SSL v1.1.0
# "101": Build for SSL v1.0.1
# "100": Build for SSL v1.0.0
Expand Down Expand Up @@ -112,6 +113,15 @@ case $RUBY_BUILD_TYPE in
export PKG_CONFIG_PATH=${SSL_110_LIBPATH}/pkgconfig:$PKG_CONFIG_PATH
;;

test_300)
RUBY_CONFIGURE_QUALS=( "${RUBY_CONFIGURE_QUALS_300[@]}" "${RUBY_CONFIGURE_QUALS[@]}" "${RUBY_CONFIGURE_QUALS_TESTINS}" )
RUNNING_FOR_TEST=1
RUBY_SRCDIR=${BASE_DIR}/source/ext/ruby_sslv3

export LD_LIBRARY_PATH=$SSL_300_LIBPATH:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH=${SSL_300_LIBPATH}/pkgconfig:$PKG_CONFIG_PATH
;;

# 100)
# INT_APPEND_DIR="/${RUBY_BUILD_TYPE}"
# RUBY_CONFIGURE_QUALS=( "${RUBY_CONFIGURE_QUALS_100[@]}" "${RUBY_CONFIGURE_QUALS[@]}" "${RUBY_CONFIGURE_QUALS_SYSINS}" )
Expand All @@ -136,12 +146,22 @@ case $RUBY_BUILD_TYPE in
export PKG_CONFIG_PATH=${SSL_110_LIBPATH}/pkgconfig:$PKG_CONFIG_PATH
;;

300)
INT_APPEND_DIR="/${RUBY_BUILD_TYPE}"
RUBY_CONFIGURE_QUALS=( "${RUBY_CONFIGURE_QUALS_300[@]}" "${RUBY_CONFIGURE_QUALS[@]}" "${RUBY_CONFIGURE_QUALS_SYSINS}" )
# Do not configure ruby for 300 with "--with-openssl-dir=/usr/local_ssl_3.0.0" to workaround https://bugs.ruby-lang.org/issues/19844
RUBY_SRCDIR=${BASE_DIR}/source/ext/ruby_sslv3

export LD_LIBRARY_PATH=$SSL_300_LIBPATH:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH=${SSL_300_LIBPATH}/pkgconfig:$PKG_CONFIG_PATH
;;

*)
INT_APPEND_DIR=""
RUBY_CONFIGURE_QUALS=( "${RUBY_CONFIGURE_QUALS[@]}" "${RUBY_CONFIGURE_QUALS_SYSINS}" )

if [ -n "$RUBY_BUILD_TYPE" ]; then
echo "Invalid parameter passed (${RUBY_BUILD_TYPE}): Must be test, test_100, test_110, 100, 110 or blank" >& 2
echo "Invalid parameter passed (${RUBY_BUILD_TYPE}): Must be test, test_100, test_110, test_300, 100, 110, 300, or blank" >& 2
exit 1
fi
esac
Expand Down Expand Up @@ -188,7 +208,7 @@ git clean -q -dfx

# Configure and build Ruby
cd ${RUBY_SRCDIR}
echo "========================= Performing Running Ruby configure"
echo "========================= Performing Running Ruby configure ${RUBY_SRCDIR}"
echo " Building Ruby with configuration: ${RUBY_CONFIGURE_QUALS[@]} ..."
# Restore the configure script
autoconf
Expand Down Expand Up @@ -263,7 +283,16 @@ if [ $RUNNING_FOR_TEST -eq 1 ]; then
fi

echo "Installing Bundler into Ruby ..."
elevate ${RUBY_DESTDIR}/bin/gem install ${BASE_DIR}/source/ext/gems/bundler-1.17.3.gem
if [ $RUBY_BUILD_TYPE -eq 300 ]; then
elevate ${RUBY_DESTDIR}/bin/gem install ${BASE_DIR}/source/ext/gems/bundler-2.3.3.gem
echo "Installing openssl gem into Ruby 3.1.0 to workaround ruby build issues when compiling it with openssl v3 includes..."
elevate ${RUBY_DESTDIR}/bin/gem install ${BASE_DIR}/source/ext/gems/openssl-3.1.0.gem
echo "Installing webrick and scanf gems into Ruby 3.1.0 to workaround fluentd dependency issue since they have been removed from ruby 3.1.0."
elevate ${RUBY_DESTDIR}/bin/gem install ${BASE_DIR}/source/ext/gems/webrick-1.8.1.gem
elevate ${RUBY_DESTDIR}/bin/gem install ${BASE_DIR}/source/ext/gems/scanf-1.0.0.gem
else
elevate ${RUBY_DESTDIR}/bin/gem install ${BASE_DIR}/source/ext/gems/bundler-1.17.3.gem
fi

echo "Installing Builder into Ruby ..."
elevate ${RUBY_DESTDIR}/bin/gem install ${BASE_DIR}/source/ext/gems/builder-3.2.3.gem
Expand Down
10 changes: 10 additions & 0 deletions build/configure
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,11 @@ if [ "$ULINUX" = "1" ]; then
ssl_110_dirpath=/usr/local_ssl_1.1.0
ruby_configure_quals_110=( --with-openssl-dir=$ssl_110_dirpath
\"LDFLAGS=-Wl,-rpath=/opt/omi/lib\" )

ssl_300_dirpath=/usr/local_ssl_3.0.0
# Used in buildRuby.sh. For only openssl v3 do not configure ruby with "--with-openssl-dir=/usr/local_ssl_3.0.0" to workaround https://bugs.ruby-lang.org/issues/19844
ruby_configure_quals_300=(
\"LDFLAGS=-Wl,-rpath=/opt/omi/lib\" )
fi

# Do we have a version file from the super project? If not, make one
Expand Down Expand Up @@ -530,15 +535,20 @@ if [ "$ULINUX" = "1" ]; then
ssl_101_libpath=`eval echo ${ssl_101_dirpath}/lib*`
if [ `uname -m` = "x86_64" ]; then
ssl_110_libpath=`eval echo ${ssl_110_dirpath}/lib*`
ssl_300_libpath=`eval echo ${ssl_300_dirpath}/lib*`
fi
echo "SSL_100_LIBPATH=${ssl_100_libpath}" >> config.mak
echo "SSL_101_LIBPATH=${ssl_101_libpath}" >> config.mak

echo "RUBY_CONFIGURE_QUALS_100=( ${ruby_configure_quals_100[@]} )" >> config.mak
echo "RUBY_CONFIGURE_QUALS_101=( ${ruby_configure_quals_101[@]} )" >> config.mak

if [ `uname -m` = "x86_64" ]; then
echo "SSL_110_LIBPATH=${ssl_110_libpath}" >> config.mak
echo "SSL_300_LIBPATH=${ssl_300_libpath}" >> config.mak

echo "RUBY_CONFIGURE_QUALS_110=( ${ruby_configure_quals_110[@]} )" >> config.mak
echo "RUBY_CONFIGURE_QUALS_300=( ${ruby_configure_quals_300[@]} )" >> config.mak
fi
fi

Expand Down
2 changes: 1 addition & 1 deletion docs/Development.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ When the build is completed, the bundle will be built out in Build-OMS-Agent-for
You can run unit tests locally with:
```
# 100 means run unittests against SSL 1.0.0
# you can also do 'make unittest_110' to target SSL 1.1.0
# you can also do 'make unittest_110' to target SSL 1.1.0 or 'make unittest_300' to target SSL 3.0.0
make unittest_100
```

Expand Down
5 changes: 4 additions & 1 deletion installer/bundle/bundle_skel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -302,15 +302,18 @@ ulinux_detect_openssl_version()
OPENSSL_SYSTEM_VERSION_10X=`echo $OPENSSL_SYSTEM_VERSION_FULL | grep -Eq '^1.0.'; echo $?`
OPENSSL_SYSTEM_VERSION_100_ONLY=`echo $OPENSSL_SYSTEM_VERSION_FULL | grep -Eq '^1.0.0'; echo $?`
OPENSSL_SYSTEM_VERSION_11X=`echo $OPENSSL_SYSTEM_VERSION_FULL | grep -Eq '^1.1.'; echo $?`
OPENSSL_SYSTEM_VERSION_30X=`echo $OPENSSL_SYSTEM_VERSION_FULL | grep -Eq '^3.0.'; echo $?`
NarineM marked this conversation as resolved.
Show resolved Hide resolved

if [ $OPENSSL_SYSTEM_VERSION_100_ONLY = 1 ] && [ $OPENSSL_SYSTEM_VERSION_10X = 0 ]; then
TMPBINDIR=100
elif [ $OPENSSL_SYSTEM_VERSION_11X = 0 ]; then
TMPBINDIR=110
elif [ $OPENSSL_SYSTEM_VERSION_30X = 0 ]; then
TMPBINDIR=300
else
echo "Error: This system does not have a supported version of OpenSSL installed."
echo "This system's OpenSSL version: $OPENSSL_SYSTEM_VERSION_FULL"
echo "Supported versions: 1.0.1 onward (1.0.0 was deprecated), 1.1.*"
echo "Supported versions: 1.0.1 onward (1.0.0 was deprecated), 1.1.*, 3.0.*"
cleanup_and_exit $UNSUPPORTED_OPENSSL
fi
}
Expand Down
4 changes: 2 additions & 2 deletions installer/bundle/create_bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ usage()
echo "only on Linux, and only for universal installations. As such, package names"
echo "are determined via directory lookups."
echo
echo "Note that the \"directory\" parameter must contain \"100\" and \"110\""
echo "directories (for SSL 1.0.0 and SSL 1.1.0), so that we have .rpm and .deb"
echo "Note that the \"directory\" parameter must contain \"100\", \"110\", and \"300\""
echo "directories (for SSL 1.0.0, 1.1.0, and 3.0.0), so that we have .rpm and .deb"
echo "files for each of the SSL-sensitive files."
exit 1
}
Expand Down
Loading
Loading