From 7b4845412184db1e4c608ce7127a66d5fd9c1a4f Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Thu, 20 May 2021 00:00:40 +0000 Subject: [PATCH] rubygems: ensure temporary directories are cleaned up see #123718 Signed-off-by: Arthur Gautier --- pkgs/development/interpreters/ruby/default.nix | 2 +- pkgs/development/interpreters/ruby/rubygems/default.nix | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix index 9179866fe9e3..9386eb75abdd 100644 --- a/pkgs/development/interpreters/ruby/default.nix +++ b/pkgs/development/interpreters/ruby/default.nix @@ -12,7 +12,7 @@ let opString = lib.optionalString; patchSet = import ./rvm-patchsets.nix { inherit fetchFromGitHub; }; config = import ./config.nix { inherit fetchFromSavannah; }; - rubygems = import ./rubygems { inherit stdenv lib fetchurl; }; + rubygems = import ./rubygems { inherit stdenv lib fetchurl fetchpatch; }; # Contains the ruby version heuristics rubyVersion = import ./ruby-version.nix { inherit lib; }; diff --git a/pkgs/development/interpreters/ruby/rubygems/default.nix b/pkgs/development/interpreters/ruby/rubygems/default.nix index db508caae310..cf2ca1b766ea 100644 --- a/pkgs/development/interpreters/ruby/rubygems/default.nix +++ b/pkgs/development/interpreters/ruby/rubygems/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchurl }: +{ stdenv, lib, fetchurl, fetchpatch }: stdenv.mkDerivation rec { name = "rubygems"; @@ -13,6 +13,12 @@ stdenv.mkDerivation rec { ./0001-add-post-extract-hook.patch ./0002-binaries-with-env-shebang.patch ./0003-gem-install-default-to-user.patch + # Ensure tmp directory are not left behind + # https://github.com/rubygems/rubygems/pull/4610 + (fetchpatch { + url = "https://github.com/rubygems/rubygems/commit/2c2ffde6e4a9f7f571d38af687034fb8507a833d.patch"; + sha256 = "sha256-bs2dXALKiJvMgk7lKjMx0NzGqlEqDYBBO35UrzNifms="; + }) ]; installPhase = ''