From e02e26ee0ade6df7ce3e74e8254a9021be393adb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Wed, 14 Aug 2024 15:38:04 +0200 Subject: [PATCH 1/7] Add docs for lib bindings with supported library versions --- src/big/lib_gmp.cr | 6 ++++++ src/compiler/crystal/ffi/lib_ffi.cr | 5 +++++ src/crystal/lib_iconv.cr | 5 +++++ src/crystal/system/unix/lib_event2.cr | 5 +++++ src/gc/boehm.cr | 5 +++++ src/lib_c.cr | 11 +++++++++++ src/lib_z/lib_z.cr | 5 +++++ src/llvm/lib_llvm.cr | 5 +++++ src/openssl/lib_crypto.cr | 6 ++++++ src/openssl/lib_ssl.cr | 6 ++++++ src/regex/lib_pcre.cr | 5 +++++ src/regex/lib_pcre2.cr | 5 +++++ src/xml/libxml2.cr | 5 +++++ src/yaml/lib_yaml.cr | 5 +++++ 14 files changed, 79 insertions(+) diff --git a/src/big/lib_gmp.cr b/src/big/lib_gmp.cr index 00834598d9d2..d88a9fc02e2a 100644 --- a/src/big/lib_gmp.cr +++ b/src/big/lib_gmp.cr @@ -1,3 +1,9 @@ +# Supported library versions: +# +# * libgmp +# * libmpir +# +# See https://crystal-lang.org/reference/man/required_libraries.html#big-numbers {% if flag?(:win32) %} @[Link("mpir")] {% else %} diff --git a/src/compiler/crystal/ffi/lib_ffi.cr b/src/compiler/crystal/ffi/lib_ffi.cr index 97163c989ee5..2b8ced7f615e 100644 --- a/src/compiler/crystal/ffi/lib_ffi.cr +++ b/src/compiler/crystal/ffi/lib_ffi.cr @@ -1,3 +1,8 @@ +# Supported library versions: +# +# * libffi +# +# See https://crystal-lang.org/reference/man/required_libraries.html#compiler-dependencies module Crystal @[Link("ffi")] {% if compare_versions(Crystal::VERSION, "1.11.0-dev") >= 0 %} diff --git a/src/crystal/lib_iconv.cr b/src/crystal/lib_iconv.cr index 5f1506758454..050a7b34b436 100644 --- a/src/crystal/lib_iconv.cr +++ b/src/crystal/lib_iconv.cr @@ -4,6 +4,11 @@ require "c/stddef" {% raise "The `without_iconv` flag is preventing you to use the LibIconv module" %} {% end %} +# Supported library versions: +# +# * libiconv-gnu +# +# See https://crystal-lang.org/reference/man/required_libraries.html#big-numbers @[Link("iconv")] {% if compare_versions(Crystal::VERSION, "1.11.0-dev") >= 0 %} @[Link(dll: "libiconv.dll")] diff --git a/src/crystal/system/unix/lib_event2.cr b/src/crystal/system/unix/lib_event2.cr index 2cd3e4635194..e8e44b0f7473 100644 --- a/src/crystal/system/unix/lib_event2.cr +++ b/src/crystal/system/unix/lib_event2.cr @@ -7,6 +7,11 @@ require "c/netdb" @[Link("rt")] {% end %} +# Supported library versions: +# +# * libevent2 +# +# See https://crystal-lang.org/reference/man/required_libraries.html#other-runtime-libraries {% if flag?(:openbsd) %} @[Link("event_core")] @[Link("event_extra")] diff --git a/src/gc/boehm.cr b/src/gc/boehm.cr index 0ce6a1366b6d..660c88a2f303 100644 --- a/src/gc/boehm.cr +++ b/src/gc/boehm.cr @@ -32,6 +32,11 @@ require "crystal/tracing" @[Link("gc", pkg_config: "bdw-gc")] {% end %} +# Supported library versions: +# +# * libgc (8.2.0+; earlier versions require a patch for MT support) +# +# See https://crystal-lang.org/reference/man/required_libraries.html#other-runtime-libraries {% if compare_versions(Crystal::VERSION, "1.11.0-dev") >= 0 %} @[Link(dll: "gc.dll")] {% end %} diff --git a/src/lib_c.cr b/src/lib_c.cr index 0bd8d2c2cc35..7a6503d7d0f5 100644 --- a/src/lib_c.cr +++ b/src/lib_c.cr @@ -1,3 +1,14 @@ +# Supported library versions: +# +# * glibc (2.26+) +# * musl libc (1.2+) +# * system libraries of several BSDs +# * macOS system library (11+) +# * MSVCRT +# * WASI +# * bionic libc +# +# See https://crystal-lang.org/reference/man/required_libraries.html#system-library {% if flag?(:win32) %} @[Link({{ flag?(:static) ? "libucrt" : "ucrt" }})] {% end %} diff --git a/src/lib_z/lib_z.cr b/src/lib_z/lib_z.cr index 1c88cb67bba8..47de2981e2f6 100644 --- a/src/lib_z/lib_z.cr +++ b/src/lib_z/lib_z.cr @@ -1,3 +1,8 @@ +# Supported library versions: +# +# * zlib +# +# See https://crystal-lang.org/reference/man/required_libraries.html#other-stdlib-libraries @[Link("z")] {% if compare_versions(Crystal::VERSION, "1.11.0-dev") >= 0 %} @[Link(dll: "zlib1.dll")] diff --git a/src/llvm/lib_llvm.cr b/src/llvm/lib_llvm.cr index 976cedc90df5..509c93c44936 100644 --- a/src/llvm/lib_llvm.cr +++ b/src/llvm/lib_llvm.cr @@ -40,6 +40,11 @@ end {% end %} +# Supported library versions: +# +# * LLVM (8-18; aarch64 requires 12+) +# +# See https://crystal-lang.org/reference/man/required_libraries.html#other-stdlib-libraries {% begin %} lib LibLLVM IS_180 = {{LibLLVM::VERSION.starts_with?("18.0")}} diff --git a/src/openssl/lib_crypto.cr b/src/openssl/lib_crypto.cr index 8d450b28ff17..576c669b73e8 100644 --- a/src/openssl/lib_crypto.cr +++ b/src/openssl/lib_crypto.cr @@ -1,3 +1,9 @@ +# Supported library versions: +# +# * openssl (1.1.0+) +# * libressl +# +# See https://crystal-lang.org/reference/man/required_libraries.html#tls {% begin %} lib LibCrypto {% if flag?(:win32) %} diff --git a/src/openssl/lib_ssl.cr b/src/openssl/lib_ssl.cr index 6adb3f172a3b..b37be1952074 100644 --- a/src/openssl/lib_ssl.cr +++ b/src/openssl/lib_ssl.cr @@ -4,6 +4,12 @@ require "./lib_crypto" {% raise "The `without_openssl` flag is preventing you to use the LibSSL module" %} {% end %} +# Supported library versions: +# +# * openssl (1.1.0+) +# * libressl +# +# See https://crystal-lang.org/reference/man/required_libraries.html#tls {% begin %} lib LibSSL {% if flag?(:win32) %} diff --git a/src/regex/lib_pcre.cr b/src/regex/lib_pcre.cr index da3ac3beb764..8502e5531d3e 100644 --- a/src/regex/lib_pcre.cr +++ b/src/regex/lib_pcre.cr @@ -1,3 +1,8 @@ +# Supported library versions: +# +# * libpcre +# +# See https://crystal-lang.org/reference/man/required_libraries.html#regular-expression-engine @[Link("pcre", pkg_config: "libpcre")] {% if compare_versions(Crystal::VERSION, "1.11.0-dev") >= 0 %} @[Link(dll: "pcre.dll")] diff --git a/src/regex/lib_pcre2.cr b/src/regex/lib_pcre2.cr index 651a1c95bef2..6f45a4465219 100644 --- a/src/regex/lib_pcre2.cr +++ b/src/regex/lib_pcre2.cr @@ -1,3 +1,8 @@ +# Supported library versions: +# +# * libpcre2 (recommended: 10.36+) +# +# See https://crystal-lang.org/reference/man/required_libraries.html#regular-expression-engine @[Link("pcre2-8", pkg_config: "libpcre2-8")] {% if compare_versions(Crystal::VERSION, "1.11.0-dev") >= 0 %} @[Link(dll: "pcre2-8.dll")] diff --git a/src/xml/libxml2.cr b/src/xml/libxml2.cr index e1c2b8d12372..78cb4d3ee307 100644 --- a/src/xml/libxml2.cr +++ b/src/xml/libxml2.cr @@ -4,6 +4,11 @@ require "./parser_options" require "./html_parser_options" require "./save_options" +# Supported library versions: +# +# * libxml2 +# +# See https://crystal-lang.org/reference/man/required_libraries.html#other-stdlib-libraries @[Link("xml2", pkg_config: "libxml-2.0")] {% if compare_versions(Crystal::VERSION, "1.11.0-dev") >= 0 %} @[Link(dll: "libxml2.dll")] diff --git a/src/yaml/lib_yaml.cr b/src/yaml/lib_yaml.cr index 0b4248afc793..d1527db63be2 100644 --- a/src/yaml/lib_yaml.cr +++ b/src/yaml/lib_yaml.cr @@ -1,5 +1,10 @@ require "./enums" +# Supported library versions: +# +# * libyaml +# +# See https://crystal-lang.org/reference/man/required_libraries.html#other-stdlib-libraries @[Link("yaml", pkg_config: "yaml-0.1")] {% if compare_versions(Crystal::VERSION, "1.11.0-dev") >= 0 %} @[Link(dll: "yaml.dll")] From 71378d435a39909d07edd34fc8b152139c1af08c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Wed, 14 Aug 2024 15:49:13 +0200 Subject: [PATCH 2/7] Update src/llvm/lib_llvm.cr Co-authored-by: Quinton Miller --- src/llvm/lib_llvm.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llvm/lib_llvm.cr b/src/llvm/lib_llvm.cr index 509c93c44936..2af8d93499f7 100644 --- a/src/llvm/lib_llvm.cr +++ b/src/llvm/lib_llvm.cr @@ -42,7 +42,7 @@ # Supported library versions: # -# * LLVM (8-18; aarch64 requires 12+) +# * LLVM (8-18; aarch64 requires 13+) # # See https://crystal-lang.org/reference/man/required_libraries.html#other-stdlib-libraries {% begin %} From 5d024c4faa6ef1c85d4d6ed4e92924d00ce18cbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Tue, 24 Sep 2024 12:44:43 +0200 Subject: [PATCH 3/7] Update lib_crypto.cr --- src/openssl/lib_crypto.cr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openssl/lib_crypto.cr b/src/openssl/lib_crypto.cr index 576c669b73e8..4da5c5289bf2 100644 --- a/src/openssl/lib_crypto.cr +++ b/src/openssl/lib_crypto.cr @@ -1,7 +1,7 @@ # Supported library versions: # -# * openssl (1.1.0+) -# * libressl +# * openssl (1.1.0–3.3+) +# * libressl (2.0–3.8+) # # See https://crystal-lang.org/reference/man/required_libraries.html#tls {% begin %} From e21c56a839d13fca85a257ec047a30e8bfb8f6d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Tue, 24 Sep 2024 13:04:18 +0200 Subject: [PATCH 4/7] LLVM 19 --- src/llvm/lib_llvm.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llvm/lib_llvm.cr b/src/llvm/lib_llvm.cr index 2af8d93499f7..6239c611dd22 100644 --- a/src/llvm/lib_llvm.cr +++ b/src/llvm/lib_llvm.cr @@ -42,7 +42,7 @@ # Supported library versions: # -# * LLVM (8-18; aarch64 requires 13+) +# * LLVM (8-19; aarch64 requires 13+) # # See https://crystal-lang.org/reference/man/required_libraries.html#other-stdlib-libraries {% begin %} From 62d8470fc0e7871b0ec388b4cb897be49aa99276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Tue, 24 Sep 2024 13:04:42 +0200 Subject: [PATCH 5/7] update lib_crypto --- src/openssl/lib_ssl.cr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openssl/lib_ssl.cr b/src/openssl/lib_ssl.cr index b37be1952074..eaca5134d1de 100644 --- a/src/openssl/lib_ssl.cr +++ b/src/openssl/lib_ssl.cr @@ -6,8 +6,8 @@ require "./lib_crypto" # Supported library versions: # -# * openssl (1.1.0+) -# * libressl +# * openssl (1.1.0–3.3+) +# * libressl (2.0–3.8+) # # See https://crystal-lang.org/reference/man/required_libraries.html#tls {% begin %} From e1b4d2a8637c927e84e01fb592fb605a4d21a8fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Tue, 8 Oct 2024 10:44:03 +0200 Subject: [PATCH 6/7] Fix URL --- src/crystal/lib_iconv.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crystal/lib_iconv.cr b/src/crystal/lib_iconv.cr index 050a7b34b436..ddccf3ec5280 100644 --- a/src/crystal/lib_iconv.cr +++ b/src/crystal/lib_iconv.cr @@ -8,7 +8,7 @@ require "c/stddef" # # * libiconv-gnu # -# See https://crystal-lang.org/reference/man/required_libraries.html#big-numbers +# See https://crystal-lang.org/reference/man/required_libraries.html#internationalization-conversion @[Link("iconv")] {% if compare_versions(Crystal::VERSION, "1.11.0-dev") >= 0 %} @[Link(dll: "libiconv.dll")] From e2e6da4f7dc71058a5b52aead45483afa6068485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Sun, 10 Nov 2024 22:15:50 +0100 Subject: [PATCH 7/7] Attest support for LibreSSL 4.0 (no CI yet) --- src/openssl/lib_ssl.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openssl/lib_ssl.cr b/src/openssl/lib_ssl.cr index dc2790f8fb85..5a7c7ec76cd0 100644 --- a/src/openssl/lib_ssl.cr +++ b/src/openssl/lib_ssl.cr @@ -7,7 +7,7 @@ require "./lib_crypto" # Supported library versions: # # * openssl (1.1.0–3.3+) -# * libressl (2.0–3.8+) +# * libressl (2.0–4.0+) # # See https://crystal-lang.org/reference/man/required_libraries.html#tls {% begin %}