Skip to content
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
2 changes: 1 addition & 1 deletion doc/languages-frameworks/ruby.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ In the Nixpkgs tree, Ruby packages can be found throughout, depending on what th

There are two main approaches for using Ruby with gems. One is to use a specifically locked `Gemfile` for an application that has very strict dependencies. The other is to depend on the common gems, which we'll explain further down, and rely on them being updated regularly.

The interpreters have common attributes, namely `gems`, and `withPackages`. So you can refer to `ruby.gems.nokogiri`, or `ruby_3_2.gems.nokogiri` to get the Nokogiri gem already compiled and ready to use.
The interpreters have common attributes, namely `gems`, and `withPackages`. So you can refer to `ruby.gems.nokogiri`, or `ruby_3_4.gems.nokogiri` to get the Nokogiri gem already compiled and ready to use.

Since not all gems have executables like `nokogiri`, it's usually more convenient to use the `withPackages` function like this: `ruby.withPackages (p: with p; [ nokogiri ])`. This will also make sure that the Ruby in your environment will be able to find the gem and it can be used in your Ruby code (for example via `ruby` or `irb` executables) via `require "nokogiri"` as usual.

Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/misc/redmine.nix
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ in
enable = lib.mkEnableOption "Redmine, a project management web application";

package = lib.mkPackageOption pkgs "redmine" {
example = "redmine.override { ruby = pkgs.ruby_3_2; }";
example = "redmine.override { ruby = pkgs.ruby_3_4; }";
};

user = lib.mkOption {
Expand Down
38 changes: 33 additions & 5 deletions pkgs/applications/editors/vim/macvim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
gettext,
pkg-config,
cscope,
ruby_3_2,
ruby,
tcl,
perl540,
perl,
luajit,
darwin,
libiconv,
Expand All @@ -18,9 +18,9 @@

# Try to match MacVim's documented script interface compatibility
let
perl = perl540;
# Ruby 3.2
ruby = ruby_3_2;
#perl = perl540;
# Ruby 3.3
#ruby = ruby_3_3;

# Building requires a few system tools to be in PATH.
# Some of these we could patch into the relevant source files (such as xcodebuild and
Expand Down Expand Up @@ -215,5 +215,33 @@ stdenv.mkDerivation (finalAttrs: {
maintainers = [ ];
platforms = platforms.darwin;
hydraPlatforms = [ ]; # hydra can't build this as long as we rely on Xcode and sandboxProfile
# Needs updating to a newer MacVim for Python and Ruby version support
broken = true;
knownVulnerabilities = [
"CVE-2023-46246"
"CVE-2023-48231"
"CVE-2023-48232"
"CVE-2023-48233"
"CVE-2023-48234"
"CVE-2023-48235"
"CVE-2023-48236"
"CVE-2023-48237"
"CVE-2023-48706"
"CVE-2023-5344"
"CVE-2023-5441"
"CVE-2023-5535"
"CVE-2024-22667"
"CVE-2024-41957"
"CVE-2024-41965"
"CVE-2024-43374"
"CVE-2024-47814"
"CVE-2025-1215"
"CVE-2025-22134"
"CVE-2025-24014"
"CVE-2025-26603"
"CVE-2025-29768"
"CVE-2025-53905"
"CVE-2025-53906"
Comment on lines +220 to +244
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where did this list come from? Everything up to CVE-2024-22667 is about Vim 9.0.x versions, and MacVim r179 is Vim 9.1. The ones starting with CVE-2024-41957 are presumably valid, since that one is about Vim 9.1.x.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s from https://nvd.nist.gov/vuln/search#/nvd/home?cpeFilterMode=cpe&cpeName=cpe:2.3:a:vim:vim:9.0.1897:*:*:*:*:*:*:*&resultType=records; I think I mixed up the base Vim version with the previous one. The correct list is presumably https://nvd.nist.gov/vuln/search#/nvd/home?cpeFilterMode=cpe&cpeName=cpe:2.3:a:vim:vim:9.1.0000:*:*:*:*:*:*:*&resultType=records, which matches CVE-2024-41957 as the starting point. Sorry about that. Fix is #454720.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CPE are always a pleasure to work with 😩

];
};
})
14 changes: 10 additions & 4 deletions pkgs/by-name/so/sonic-pi/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
cmake,
pkg-config,
catch2_3,
ncurses,
kdePackages,
kissfftFloat,
crossguid,
reproc,
platform-folders,
ruby_3_2,
ruby,
beamPackages,
alsa-lib,
rtmidi,
Expand All @@ -31,11 +32,15 @@
gl3w,
SDL2,
fmt,
}:
}@args:

# Sonic Pi fails to build with Ruby 3.3.
let
ruby = ruby_3_2;
ruby = args.ruby.withPackages (ps: [
ps.prime
ps.racc
ps.rake
ps.rexml
]);
in

stdenv.mkDerivation (finalAttrs: {
Expand Down Expand Up @@ -72,6 +77,7 @@ stdenv.mkDerivation (finalAttrs: {
];

buildInputs = [
ncurses
kdePackages.qtbase
kdePackages.qtsvg
kdePackages.qttools
Expand Down
13 changes: 0 additions & 13 deletions pkgs/by-name/tr/tree-from-tags/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,13 +0,0 @@
GEM
remote: https://rubygems.org/
specs:
taglib-ruby (0.7.1)

PLATFORMS
ruby

DEPENDENCIES
taglib-ruby

BUNDLED WITH
2.1.4
6 changes: 4 additions & 2 deletions pkgs/by-name/tr/tree-from-tags/gemset.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
taglib-ruby = {
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "0r8g7zdncc6243d000jn0grc1n70rn9mx16vggy3q7c4wgsa37xi";
sha256 = "1bmirkz9lfhbykj3x48z1gv0jl1bfz60yscpl0hmjxrdmcihzfai";
type = "gem";
};
version = "0.7.1";
version = "2.0.0";
};
}
8 changes: 0 additions & 8 deletions pkgs/by-name/un/unit/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
php82,
withPerl ? true,
perl,
withRuby_3_1 ? true,
ruby_3_1,
withRuby_3_2 ? false,
ruby_3_2,
withSSL ? true,
openssl ? null,
withIPv6 ? true,
Expand Down Expand Up @@ -58,8 +54,6 @@ stdenv.mkDerivation rec {
]
++ optional withPHP82 php82-unit
++ optional withPerl perl
++ optional withRuby_3_1 ruby_3_1
++ optional withRuby_3_2 ruby_3_2
++ optional withSSL openssl;

configureFlags = [
Expand All @@ -79,8 +73,6 @@ stdenv.mkDerivation rec {
${optionalString withPython3 "./configure python --module=python3 --config=python3-config --lib-path=${python3}/lib"}
${optionalString withPHP82 "./configure php --module=php82 --config=${php82-unit.unwrapped.dev}/bin/php-config --lib-path=${php82-unit}/lib"}
${optionalString withPerl "./configure perl --module=perl --perl=${perl}/bin/perl"}
${optionalString withRuby_3_1 "./configure ruby --module=ruby31 --ruby=${ruby_3_1}/bin/ruby"}
${optionalString withRuby_3_2 "./configure ruby --module=ruby32 --ruby=${ruby_3_2}/bin/ruby"}
'';

passthru.tests = {
Expand Down
44 changes: 8 additions & 36 deletions pkgs/development/interpreters/ruby/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,9 @@ let
}:
let
ver = version;
atLeast31 = lib.versionAtLeast ver.majMin "3.1";
atLeast32 = lib.versionAtLeast ver.majMin "3.2";
# https://github.com/ruby/ruby/blob/v3_2_2/yjit.h#L21
yjitSupported =
atLeast32
&& (
stdenv.hostPlatform.isx86_64 || (!stdenv.hostPlatform.isWindows && stdenv.hostPlatform.isAarch64)
);
stdenv.hostPlatform.isx86_64 || (!stdenv.hostPlatform.isWindows && stdenv.hostPlatform.isAarch64);
rubyDrv = lib.makeOverridable (
{
stdenv,
Expand Down Expand Up @@ -188,25 +183,13 @@ let
# make: *** [uncommon.mk:373: do-install-all] Error 1
enableParallelInstalling = false;

patches =
op (lib.versionOlder ver.majMin "3.1") ./do-not-regenerate-revision.h.patch
++ op useBaseRuby (
if atLeast32 then ./do-not-update-gems-baseruby-3.2.patch else ./do-not-update-gems-baseruby.patch
)
++ ops (ver.majMin == "3.0") [
# Ruby 3.0 adds `-fdeclspec` to $CC instead of $CFLAGS. Fixed in later versions.
(fetchpatch {
url = "https://github.com/ruby/ruby/commit/0acc05caf7518cd0d63ab02bfa036455add02346.patch";
hash = "sha256-43hI9L6bXfeujgmgKFVmiWhg7OXvshPCCtQ4TxqK1zk=";
})
]
++ ops atLeast31 [
# When using a baseruby, ruby always sets "libdir" to the build
# directory, which nix rejects due to a reference in to /build/ in
# the final product. Removing this reference doesn't seem to break
# anything and fixes cross compilation.
./dont-refer-to-build-dir.patch
];
patches = op useBaseRuby ./do-not-update-gems-baseruby-3.2.patch ++ [
# When using a baseruby, ruby always sets "libdir" to the build
# directory, which nix rejects due to a reference in to /build/ in
# the final product. Removing this reference doesn't seem to break
# anything and fixes cross compilation.
./dont-refer-to-build-dir.patch
];

cargoRoot = opString yjitSupport "yjit";

Expand Down Expand Up @@ -410,17 +393,6 @@ in
mkRubyVersion = rubyVersion;
mkRuby = generic;

ruby_3_1 = generic {
version = rubyVersion "3" "1" "7" "";
hash = "sha256-BVas1p8UHdrOA/pd2NdufqDY9SMu3wEkKVebzaqzDns=";
};

ruby_3_2 = generic {
version = rubyVersion "3" "2" "9" "";
hash = "sha256-q7rZjbmusVJ3Ow01ho5QADuMRn89BhUld8Tf7Z2I7So=";
cargoHash = "sha256-CMVx5/+ugDNEuLAvyPN0nGHwQw6RXyfRsMO9I+kyZpk=";
};

ruby_3_3 = generic {
version = rubyVersion "3" "3" "9" "";
hash = "sha256-0ZkWkKThcjPsazx4RMHhJFwK3OPgDXE1UdBFhGe3J7E=";
Expand Down

This file was deleted.

This file was deleted.

6 changes: 4 additions & 2 deletions pkgs/development/ruby-modules/with-packages/test.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ let
lib = pkgs.lib;
stdenv = pkgs.stdenv;

rubyVersions = with pkgs; [
ruby_3_2
rubyVersions = [
# TODO FIXME: All versions listed here were dropped from Nixpkgs.
# Add current versions here or remove this file if it’s no longer
# being used.
];

gemTests = (lib.mapAttrs (name: gem: [ name ]) pkgs.ruby.gems) // (import ./require_exceptions.nix);
Expand Down
4 changes: 4 additions & 0 deletions pkgs/top-level/aliases.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2354,6 +2354,10 @@ mapAliases {
rquickshare-legacy = throw "The legacy version depends on insecure package libsoup2, please use the main version"; # Added 2025-10-09
rr-unstable = rr; # Added 2022-09-17
rtx = mise; # Added 2024-01-05
ruby_3_1 = throw "ruby_3_1 has been removed, as it is has reached end‐of‐life upstream"; # Added 2025-10-12
ruby_3_2 = throw "ruby_3_2 has been removed, as it will reach end‐of‐life upstream during Nixpkgs 25.11’s support cycle"; # Added 2025-10-12
rubyPackages_3_1 = throw "rubyPackages_3_1 has been removed, as it is has reached end‐of‐life upstream"; # Added 2025-10-12
rubyPackages_3_2 = throw "rubyPackages_3_2 has been removed, as it will reach end‐of‐life upstream during Nixpkgs 25.11’s support cycle"; # Added 2025-10-12
ruby-zoom = throw "'ruby-zoom' has been removed due to lack of maintaince and had not been updated since 2020"; # Added 2025-08-24
runCommandNoCC = runCommand; # Added 2021-08-15
runCommandNoCCLocal = runCommandLocal; # Added 2021-08-15
Expand Down
8 changes: 0 additions & 8 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6036,8 +6036,6 @@ with pkgs;
})
mkRubyVersion
mkRuby
ruby_3_1
ruby_3_2
ruby_3_3
ruby_3_4
ruby_3_5
Expand All @@ -6046,8 +6044,6 @@ with pkgs;
ruby = ruby_3_3;
rubyPackages = rubyPackages_3_3;

rubyPackages_3_1 = recurseIntoAttrs ruby_3_1.gems;
rubyPackages_3_2 = recurseIntoAttrs ruby_3_2.gems;
rubyPackages_3_3 = recurseIntoAttrs ruby_3_3.gems;
rubyPackages_3_4 = recurseIntoAttrs ruby_3_4.gems;
rubyPackages_3_5 = recurseIntoAttrs ruby_3_5.gems;
Expand Down Expand Up @@ -14891,10 +14887,6 @@ with pkgs;
libcpr = libcpr_1_10_5;
};

tree-from-tags = callPackage ../by-name/tr/tree-from-tags/package.nix {
ruby = ruby_3_1;
};

biblioteca = callPackage ../by-name/bi/biblioteca/package.nix {
webkitgtk = webkitgtk_6_0;
};
Expand Down
5 changes: 0 additions & 5 deletions pkgs/top-level/pkg-config/pkg-config-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -746,11 +746,6 @@
"python3"
]
},
"ruby-3.1": {
"attrPath": [
"ruby_3_1"
]
},
"sdl2": {
"attrPath": [
"SDL2"
Expand Down
Loading