Skip to content

Commit

Permalink
Add openssl test (#71)
Browse files Browse the repository at this point in the history
As mentioned in #6, there are Ruby versions where openssl does not
correctly work.
The intention is to add tests for loading the openssl gem so that we can
detect for which versions openssl does and does not work.

After that it is likely that overrides are needed to change the openssl
version for specific Ruby versions.
  • Loading branch information
bobvanderlinden authored Apr 22, 2023
2 parents 05d0064 + f171b8d commit c8d2178
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,18 @@
ruby -e 'puts "ok"' > $out
'';
};
} // (lib.optionalAttrs (with import ./lib/version-comparison.nix rubyVersion; greaterOrEqualTo "2.2") {
} // (lib.optionalAttrs (with versionComparison rubyVersion; greaterOrEqualTo "2.4") {
# Ruby <2.4 only supports openssl 1.0 and not openssl1.1. openssl 1.0 is not supported by nixpkgs
# anymore, so we will not support it here.
"${rubyName}-openssl" = {
nativeBuildInputs = [
ruby
];
command = ''
ruby -e 'require "openssl"; puts OpenSSL::OPENSSL_VERSION' > $out
'';
};
}) // (lib.optionalAttrs (with versionComparison rubyVersion; greaterOrEqualTo "2.2") {
"${rubyName}-bundlerEnv" = let
gems = pkgs.bundlerEnv {
name = "gemset";
Expand Down
2 changes: 1 addition & 1 deletion ruby/overrides.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}
{
condition = version: with versionComparison version;
lessThan "3.0.3";
lessThan "3.1";
override = pkg: pkg.override { openssl = openssl_1_1; };
}
{
Expand Down

0 comments on commit c8d2178

Please sign in to comment.