@@ -39,18 +39,17 @@ check_and_install_perl()
39
39
PERL_OK=yes
40
40
PERL_MINOR_VERSION=$( $PERL -e ' print "$]"."\n"' | cut -d. -f2)
41
41
if [ " $PERL_MINOR_VERSION " -lt 013004 ]; then
42
- echo " $PERL version is $PERL_MINOR_VERSION ," \
43
- " too old"
42
+ log_debug $PERL version is too old (minor version $PERL_MINOR_VERSION )
44
43
PERL_OK=" no"
45
44
fi
46
45
47
46
if ! $PERL -e ' use List::Util qw(pairs);' ; then
48
- echo " $PERL has List::Util that does not export pairs. Needs to be at least version 1.29 for OpenSSL version 3.3.2."
47
+ log_debug $PERL has List::Util that does not export pairs. Needs to be at least version 1.29 for OpenSSL version 3.3.2.
49
48
PERL_OK=" no"
50
49
fi
51
50
52
51
if [ " $PERL_OK " != " yes" ]; then
53
- echo " $PERL is too old or modules are missing, building new one from source..."
52
+ log_debug $PERL is too old or modules are missing, building new one from source...
54
53
55
54
# -fno-stack-protector: Ensure built perl will not depend on libssp.so
56
55
if echo | gcc -E -fno-stack-protector - > /dev/null 2>&1 ; then
@@ -77,16 +76,26 @@ check_and_install_perl()
77
76
# from the perl dev team - they are only intended for development
78
77
PERL_VERSION=5.40.1
79
78
PERL_SHA256=02f8c45bb379ed0c3de7514fad48c714fd46be8f0b536bfd5320050165a1ee26
80
- wget https://www.cpan.org/src/5.0/perl-${PERL_VERSION} .tar.gz
79
+
80
+ log_debug Fetching perl tarball...
81
+ run_and_print_on_failure wget https://www.cpan.org/src/5.0/perl-${PERL_VERSION} .tar.gz
81
82
if [ " $( func_sha256 perl-${PERL_VERSION} .tar.gz) " != " ${PERL_SHA256} " ]; then
82
83
fatal " perl checksum error"
83
84
fi
85
+
86
+ log_debug Extracting perl tarball...
84
87
gzip -dc perl-${PERL_VERSION} .tar.gz | tar xf -
85
88
cd perl-${PERL_VERSION}
86
- ./Configure -des -Dprefix=" $HOME " /perl-my -Dcc=gcc -Dmake=" $MAKE " \
89
+
90
+ log_debug Running ./Configure on perl project...
91
+ run_and_print_on_failure ./Configure -des -Dprefix=" $HOME " /perl-my -Dcc=gcc -Dmake=" $MAKE " \
87
92
" $PERL_EXTRA_FLAGS " " $PERL_CFLAGS " " $PERL_LDFLAGS " " $PERL_LDDLFLAGS "
88
- $MAKE
89
- $MAKE install
93
+
94
+ log_debug Running make on perl project...
95
+ run_and_print_on_failure $MAKE
96
+
97
+ log_debug Running make install on perl project...
98
+ run_and_print_on_failure $MAKE install
90
99
PERL=$HOME /perl-my/bin/perl
91
100
fi
92
101
111
120
112
121
# Override for manual testing
113
122
if [ -n " $1 " ]; then
123
+ log_debug " Overriding dependency list (manual testing)"
114
124
DEPS=" $* "
115
125
fi
116
126
130
140
tests=yes
131
141
;;
132
142
* )
133
- echo " Unknown build type: $BUILD_TYPE "
134
- exit 42
143
+ fatal " Unknown build type: $BUILD_TYPE "
135
144
;;
136
145
esac
137
146
146
155
;;
147
156
esac
148
157
158
+ # Add $PREFIX to version of built dependencies so they get different package names and are distinguishable from each
149
159
revision=$( cat " $BASEDIR " /buildscripts/deps-packaging/revision)
150
160
if [ " $BUILDPREFIX " != " /var/cfengine" ]; then
151
161
safe_prefix=" +$( echo " $PREFIX " | sed ' s:/::g' ) "
157
167
158
168
# If package cache did not have the packages
159
169
if [ -z " $package_files " ]; then
170
+ log_debug Building package $dep ...
160
171
# BUILD the packages
161
172
if [ " $dep " = " lmdb" ] && [ " $BUILD_TYPE " != " RELEASE" ]; then
162
- # Always build LMDB with debug symbols in non-release builds
173
+ # Always build LMDB with debug symbols in non-release builds.
174
+ # The reason is an ongoing issue where we fail to open database transactions.
175
+ # See ENT-10777 for more info.
163
176
" $BASEDIR /buildscripts/deps-packaging/pkg-build-$DEP_PACKAGING " \
164
177
" $dep " " $tests " " $cross " " $optimize " yes " $version "
165
178
else
166
179
" $BASEDIR /buildscripts/deps-packaging/pkg-build-$DEP_PACKAGING " \
167
180
" $dep " " $tests " " $cross " " $optimize " " $debugsym " " $version "
168
181
fi
169
182
183
+ # Make sure package is there after building it
170
184
package_files=$( " pkg-find-$DEP_PACKAGING " " $BASEDIR /$dep " )
171
-
172
185
if [ -z " $package_files " ]; then
173
186
fatal " Empty output dir after building dependency: $dep "
174
187
fi
175
188
176
189
# CACHE the newly built package
177
190
# shellcheck disable=SC2086
191
+ log_debug Caching package $dep ...
178
192
pkg-cache putpkg " $dep -$version " $package_files
179
193
180
194
# CLEAN UP
181
195
# shellcheck disable=SC2086
196
+ log_debug Removing package files for $dep ...
182
197
rm -f $package_files
183
198
184
199
# Now the package should be in the local cache
190
205
191
206
# INSTALL the packages
192
207
# shellcheck disable=SC2086
208
+ log_debug Installing package files for $dep ...
193
209
install_pkg_files $package_files
194
210
195
211
# keep 50 most recent packages to preserve disk space
0 commit comments