From c395b416e030c78f61def0a3e912686203aacaaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= Date: Tue, 24 Oct 2023 14:25:14 +0200 Subject: [PATCH 1/5] curl: use existing configure command --- config/software/curl.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/config/software/curl.rb b/config/software/curl.rb index 1e37ae54b..d692d7c36 100644 --- a/config/software/curl.rb +++ b/config/software/curl.rb @@ -35,8 +35,7 @@ # curl requires pkg-config that is shipped with the agent env = { "PATH" => "#{install_dir}/embedded/bin" + File::PATH_SEPARATOR + ENV["PATH"] } - command ["./configure", - "--prefix=#{install_dir}/embedded", + configure_options = [ "--disable-manual", "--disable-debug", "--enable-optimize", @@ -53,7 +52,9 @@ "--without-libssh2", "--with-ssl=#{install_dir}/embedded", "--with-zlib=#{install_dir}/embedded", - "--with-nghttp2=#{install_dir}/embedded"].join(" "), env: env + "--with-nghttp2=#{install_dir}/embedded", + ] + configure(*configure_options, env: env) command "make -j #{workers}", env: { "LD_RUN_PATH" => "#{install_dir}/embedded/lib" } command "make install" From fbad896a0d034dbd0d7cb01aefc35098e3163991 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= Date: Wed, 25 Oct 2023 17:53:57 +0200 Subject: [PATCH 2/5] curl: don't provide path to dependencies Let pkg-config do its job instead. This fix a potential issue (most likely only in more recent toolchains than the one we use in the build images) where curl would explicitly depend on the absolute path to its dependencies, causing it to link with /path/to/libfoo.so instead of -lfoo When linking with an absolute path, the linker appears to not include the rpath information, which causes linking errors down the line: 2023-10-25T15:16:09+00:00 | /opt/toolchains/bin/../lib/gcc/x86_64-unknown-linux-gnu/11.4.0/../../../../x86_64-u nknown-linux-gnu/bin/ld.bfd: warning: libnghttp2.so.14, needed by ../lib/.libs/libcurl.so, not found (try using -rpath or -rpath-link) --- config/software/curl.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/software/curl.rb b/config/software/curl.rb index d692d7c36..991adbc52 100644 --- a/config/software/curl.rb +++ b/config/software/curl.rb @@ -50,9 +50,9 @@ "--without-gnutls", "--without-librtmp", "--without-libssh2", - "--with-ssl=#{install_dir}/embedded", - "--with-zlib=#{install_dir}/embedded", - "--with-nghttp2=#{install_dir}/embedded", + "--with-ssl", + "--with-zlib", + "--with-nghttp2", ] configure(*configure_options, env: env) From 6100e705977b3f991c3f86c15064cbf75f500361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= Date: Mon, 30 Oct 2023 09:27:26 +0100 Subject: [PATCH 3/5] curl: fix idn2 disabling It's not default enabled to this doesn't have include any behavior change, however we are now sure that libidn will not be enabled in curl if we were to start building it --- config/software/curl.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/software/curl.rb b/config/software/curl.rb index 991adbc52..b259322fe 100644 --- a/config/software/curl.rb +++ b/config/software/curl.rb @@ -46,7 +46,7 @@ "--enable-proxy", "--disable-dependency-tracking", "--enable-ipv6", - "--without-libidn", + "--without-libidn2", "--without-gnutls", "--without-librtmp", "--without-libssh2", From 6f51c0f6225b8170f8029bdd00017bfbb512582d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= Date: Mon, 30 Oct 2023 09:29:17 +0100 Subject: [PATCH 4/5] curl: use --with-openssl instead of deprecated --with-ssl with-ssl was deprecated in 7bdec2a08bf025d2f66c168111d47df6b21890d9 --- config/software/curl.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/software/curl.rb b/config/software/curl.rb index b259322fe..fb32514b7 100644 --- a/config/software/curl.rb +++ b/config/software/curl.rb @@ -50,7 +50,7 @@ "--without-gnutls", "--without-librtmp", "--without-libssh2", - "--with-ssl", + "--with-openssl", "--with-zlib", "--with-nghttp2", ] From 87c57cb4b421fa888437a82f210c2f914974dd66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= Date: Mon, 30 Oct 2023 11:37:22 +0100 Subject: [PATCH 5/5] curl: use standard compiler flags --- config/software/curl.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/software/curl.rb b/config/software/curl.rb index fb32514b7..a8f310792 100644 --- a/config/software/curl.rb +++ b/config/software/curl.rb @@ -33,8 +33,7 @@ FileUtils.rm_rf(File.join(project_dir, "src/tool_hugehelp.c")) end - # curl requires pkg-config that is shipped with the agent - env = { "PATH" => "#{install_dir}/embedded/bin" + File::PATH_SEPARATOR + ENV["PATH"] } + env = with_standard_compiler_flags(with_embedded_path) configure_options = [ "--disable-manual", "--disable-debug",