summaryrefslogtreecommitdiff
path: root/pkgs/development/ruby-modules/gem
AgeCommit message (Collapse)Author
2026-04-01treewide: remove redundant name attrs and parseDrvName callsBen Siraphob
2026-02-21rubyPackages.gem: add structuredAttrs supportStefan Frijters
Also drop $gemFlags, which is no longer used in nixpkgs.
2026-01-15rubyPackage: seperate pname and versionjopejoe1
Makes it possible to query version and pname of ruby packages, making it to the standard level of nixpkgs
2025-10-18Revert "stdenv: pURL implementation (#421125)"d068328
This reverts commit 54271156702fc3a3f5d156df567a2a4a274bac6b, reversing changes made to 88ee2ac331edc3ce9f9df92aaf824592473ed868.
2025-10-17stdenv: pURL implementation (#421125)Arian van Putten
2025-10-10stdenv: pURL review suggestions - move all logic to mkDerivationHans Joachim Kliemeck
2025-10-10stdenv: pURL review suggestions - part 2Hans Joachim Kliemeck
2025-10-10stdenv: pURL review suggestionsHans Joachim Kliemeck
2025-10-04pkgs: remove optional builtins prefixes from prelude functionsNAHO
Remove optional builtins prefixes from prelude functions by running: builtins=( abort baseNameOf break derivation derivationStrict dirOf false fetchGit fetchMercurial fetchTarball fetchTree fromTOML import isNull map null placeholder removeAttrs scopedImport throw toString true ) fd \ --type file \ . \ pkgs \ --exec-batch sed --in-place --regexp-extended " s/\<builtins\.($( printf '%s\n' "${builtins[@]}" | paste --delimiter '|' --serial - ))\>/\1/g " nix fmt
2025-10-03stdenv: pURL speed optimizationHans Joachim Kliemeck
2025-10-03stdenv: pURL implementationh0nIg
2025-07-24treewide: run nixfmt 1.0.0Wolfgang Walther
2025-04-21treewide: remove references to deprecated `darwin.libobjc` stubEmily
This was done with booxter’s fantastic [nix-clean-apple_sdk] tool, simply modified to look for `libobjc` rather than the existing list he already used in <https://github.com/NixOS/nixpkgs/pull/398707>. Some manual work was applied, including cleaning up a string interpolation in the terrifying MacVim derivation, stray comments, empty lists, function parameters, and `inherit`s, including all of the references in `all-packages.nix`. [nix-clean-apple_sdk]: https://github.com/booxter/nix-clean-apple_sdk
2025-02-24treewide: fix typos in commentsPeder Bergebakken Sundt
Made with ```shell git restore . fd '\.nix$' pkgs/ --type f -j1 -x bash -xc "$(cat <<"EOF" typos --no-check-filenames --write-changes "$1" git diff --exit-code "$1" && exit #( git diff "$1" | grep -qE "^\+ +[^# ]") && git restore "$1" count1="$( bat --language nix --diff --style changes "$1" --theme "Monokai Extended" --color always | aha --no-header | grep -E '^<span style="color:olive;">~</span> ' | wc -l )" count2="$( bat --language nix --diff --style changes "$1" --theme "Monokai Extended" --color always | aha --no-header | grep -E '^<span style="color:olive;">~</span> (<span style="color:#f8f8f2;"> *</span>)?<span style="color:#75715e;">.*</span>$' | wc -l )" [[ $count1 -ne $count2 ]] && git restore "$1" EOF )" -- {} ``` and filtered with `GIT_DIFF_OPTS='--unified=15' git -c interactive.singleKey=true add --patch` I initially tried using the tree-sitter cli, python bindings and even ast-grep through various means, but this is what I ended up with.
2024-12-25ruby-grpc: gcc-14 fixes (#367783)Reno Dakota
* ruby-modules/gem: don't clobber NIX_CFLAGS_COMPILE * gem-config/grpc: apply patch for gcc-14 https://boringssl.googlesource.com/boringssl/+/c70190368c7040c37c1d655f0690bcde2b109a0d add -Wno-error=incompatible-pointer-types to NIX_CFLAGS_COMPILE and remove the other flags as NIX_CFLAGS_COMPILE were getting clobbered since 7121ef61da4ddd36f81480322bc2ae984c575b1d (2021)
2024-12-10treewide: format all inactive Nix filesSilvan Mosberger
After final improvements to the official formatter implementation, this commit now performs the first treewide reformat of Nix files using it. This is part of the implementation of RFC 166. Only "inactive" files are reformatted, meaning only files that aren't being touched by any PR with activity in the past 2 months. This is to avoid conflicts for PRs that might soon be merged. Later we can do a full treewide reformat to get the rest, which should not cause as many conflicts. A CI check has already been running for some time to ensure that new and already-formatted files are formatted, so the files being reformatted here should also stay formatted. This commit was automatically created and can be verified using nix-build https://github.com/infinisil/treewide-nixpkgs-reformat-script/archive/a08b3a4d199c6124ac5b36a889d9099b4383463f.tar.gz \ --argstr baseRev b32a0943687d2a5094a6d92f25a4b6e16a76b5b7 result/bin/apply-formatting $NIXPKGS_PATH
2024-09-25treewide: replace `stdenv.is` with `stdenv.hostPlatform.is`Artturin
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
2024-07-05buildRubyGem: do not override fixupPhase (#323587)Ivan Trubach
Oops, looks like we were overriding stdenv’s fixupPhase that runs fixupOutputHooks, including patchShebangsAuto.
2024-06-26Merge pull request #270242 from tie/ruby-crossArtturin
ruby-modules: improve cross-compilation support
2024-06-03buildRubyGem: do not patch shebangs in non-existent directoryIvan Trubach
2024-06-01buildRubyGem: Include platform in suffix for non-Ruby platforms (#299909)Andrew Marshall
This adheres to how Bundler handles such gems. We must also adjust the generated URL to use this full suffix.
2024-05-28ruby-modules: improve cross-compilation supportIvan Trubach
2024-01-15buildRubyGem: only use major minor in name (#229469)Sandro
This is similar to what pythonXxxPackages does and reduces the noise `nix store diff-closure`
2023-07-22Merge pull request #239624 from Stunkymonkey/use-optionalString-thenFelix Bühler
treewide: use optionalString instead of 'then ""'
2023-06-24treewide: use optionalString instead of 'then ""'Felix Buehler
2023-06-15nixos/ruby-modules: proper treatment to ruby modules of type git/urlAnimesh Sahu
2023-06-11buildRubyGem: only set NIX_CFLAGS_COMPILE on Ruby MRIMario Rodas
It's not needed on other implementations like JRuby
2023-02-22treewide: env.NIX_CFLAGS_COMPILE use toString on result of optionalsArtturin
env values must be strings
2023-02-22treewide: move NIX_CFLAGS_COMPILE to the env attrsetArtturin
with structuredAttrs lists will be bash arrays which cannot be exported which will be a issue with some patches and some wrappers like cc-wrapper this makes it clearer that NIX_CFLAGS_COMPILE must be a string as lists in env cause a eval failure
2023-01-21buildRubyGem: don't use the bash 'type' variable name (#211899)Yureka
https://github.com/NixOS/nixpkgs/issues/211671 There is also a fix with an stdenv rebuild in staging, but we don't want to wait so long...
2022-08-08rubyPackages: set meta.mainProgramilkecan
2022-07-01buildRubyGem: inherit libobjc from darwinArtturin
2022-07-01buildRubyGem: fix bundix crossArtturin
allows building bundix but most ruby gems still fail with ``` ++ gem install --local --force --http-proxy http://nodtd.invalid --ignore-dependencies --install-dir /nix/store/...-ruby-aarch64-unknown-linux-gnu2.7.6-nio4r-2.5.8-aarch64-unknown-linux-gnu/lib/ruby/gems/2.7.0 --build-root / --backtrace --no-env-shebang -N /nix/store/...-nio4r-2.5.8.gem -- /nix/store/...-ruby-aarch64-unknown-linux-gnu-2.7.6/bin/gem: line 8: require: command not found /nix/store/...-ruby-aarch64-unknown-linux-gnu-2.7.6/bin/gem: line 9: require: command not found /nix/store/...-ruby-aarch64-unknown-linux-gnu-2.7.6/bin/gem: line 10: require: command not found /nix/store/...-ruby-aarch64-unknown-linux-gnu-2.7.6/bin/gem: line 12: required_version: command not found /nix/store/...-ruby-aarch64-unknown-linux-gnu-2.7.6/bin/gem: line 14: unless: command not found /nix/store/...-ruby-aarch64-unknown-linux-gnu-2.7.6/bin/gem: line 15: abort: command not found /nix/store/...-ruby-aarch64-unknown-linux-gnu-2.7.6/bin/gem: line 16: end: command not found /nix/store/...-ruby-aarch64-unknown-linux-gnu-2.7.6/bin/gem: line 18: args: command not found /nix/store/...-ruby-aarch64-unknown-linux-gnu-2.7.6/bin/gem: line 20: begin: command not found /nix/store/...-ruby-aarch64-unknown-linux-gnu-2.7.6/bin/gem: line 21: Gem::GemRunner.new.run: command not found /nix/store/...-ruby-aarch64-unknown-linux-gnu-2.7.6/bin/gem: line 22: rescue: command not found /nix/store/...-ruby-aarch64-unknown-linux-gnu-2.7.6/bin/gem: line 23: exit: e.exit_code: numeric argument required ```
2022-01-28bundler: 2.2.24 -> 2.3.6FliegendeWurst
2021-07-16buildRubyGem: by default use Ruby's platformsMario Rodas
2021-04-05ruby: reproducibleThomas Bereknyei
Generated Makefile's were nested deeper than the existing rm would be able to remove.
2021-03-26Use minimal git for fetching gemsMichael Francis
2021-02-22buildRubyGem: update CFLAGS for ruby 3.0 on ClangMario Rodas
2020-11-30buildRubyGem: fix to support bundler cmds (#104977)Farid Zakaria
The way in which Nixpks builds Ruby gems means that certain operations by bundler *will not work*, namely `bundle install --redownload`. According to the source the _cache/_ directory should have been kept, however it seems through revisions to the file it has been purged. Here was the comment from the original commit that introduced buildRubyGem: ``` # Note: # We really do need to keep the $out/${ruby.gemPath}/cache. # This is very important in order for many parts of RubyGems/Bundler to not blow up. # See https://github.com/bundler/bundler/issues/3327 ``` Why is the _cache_ directory needed? Bundler and RubyGems uses the cache as a source of truth. When bundler executes `bundler install --redownload`, any gems it discovers in the _GEM_PATH_ it assums must have their _.gem_ file present in the cache (unaware it was installed from Nix). Rather than downloading the gem from RubyGems the bundler code forcibly re-installs the gem from the cache directory instead and **fails** if it does not exist. I've opened https://github.com/rubygems/rubygems/issues/4088 to see if this failure should be soft and not so explicit; or fallback to fetching the gem from scratch. Without this change the following is the error: ```bash > [nix-shell:~/code/nix/playground/jruby-bundler-rake]$ bundle install --force [DEPRECATED] The `--force` option has been renamed to `--redownload` WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.jruby.ext.openssl.SecurityHelper (file:/nix/store/fis6nzrpw9pmcivr84qh5byfgm07qn10-jruby-9.2.13.0/lib/ruby/stdlib/jopenssl.jar) to field java.security.MessageDigest.provider WARNING: Please consider reporting this to the maintainers of org.jruby.ext.openssl.SecurityHelper WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release Fetching gem metadata from https://rubygems.org/. Using bundler 2.1.4 Installing hello-world 1.2.0 Bundler::GemNotFound: Could not find hello-world-1.2.0.gem for installation An error occurred while installing hello-world (1.2.0), and Bundler cannot continue. Make sure that `gem install hello-world -v '1.2.0' --source 'https://rubygems.org/'` succeeds before bundling. ``` Wth the fix the following no woccurs: ```bash [nix-shell:~/code/nix/playground/jruby-bundler-rake]$ bundle install --redownload WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.jruby.ext.openssl.SecurityHelper (file:/nix/store/69wjlj4yirp48rv1q03zxgd4xvf0150d-jruby-9.2.13.0/lib/ruby/stdlib/jopenssl.jar) to field java.security.MessageDigest.provider WARNING: Please consider reporting this to the maintainers of org.jruby.ext.openssl.SecurityHelper WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release Fetching gem metadata from https://rubygems.org/. Using bundler 2.1.4 Installing hello-world 1.2.0 Bundle complete! 1 Gemfile dependency, 2 gems now installed. Use `bundle info [gemname]` to see where a bundled gem is installed. ``` ``` [nix-shell:~/code/nix/playground/jruby-bundler-rake]$ ls -l /nix/store/cwl9n5073hqgpfhnw4wic13nrrgg9dn8-gem-env/lib/jruby/gems/2.5.0/cache/ total 8 lrwxrwxrwx 1 fmzakari primarygroup 102 Dec 31 1969 bundler-2.1.4.gem -> /nix/store/ifc8a0gsfkrhkv953rd4rz8bcspahi8y-bundler-2.1.4/lib/jruby/gems/2.5.0/cache/bundler-2.1.4.gem lrwxrwxrwx 1 fmzakari primarygroup 110 Dec 31 1969 hello-world-1.2.0.gem -> /nix/store/xi9ln6n1mz2is5ppykjxqhhkpjq9zm6i-hello-world-1.2.0/lib/jruby/gems/2.5.0/cache/hello-world-1.2.0.gem ``` I have a minimal project that demonstrates this issue at https://github.com/fzakaria/jruby-bundler-nix-failure
2020-10-27buildRubyGem: remove Makefileszimbatm
The generated Makefile is not reproducible. The HDRS section is inode dependent. "sitearchdir" and "sitelibdir" contains a timestamp and random postfix. See https://r13y.com/diff/8350ec80865096f84705f3e000d97f151760e768bf626e52c84570413c5e1093-f9dea788fe62d683e90e12e166f29b778c39c699a5be39f9262e5cffb77d3e45.html Instead of trying to make it reproducible, remove it entirely. It was only useful for generating the .so file and it no longer needed. See also https://bugs.ruby-lang.org/issues/15304 Fixes the rubyPackages.nokogiry reproducibility for example.
2020-01-09buildRubyGem: remove more bloat filesAlyssa Ross
2020-01-09buildRubyGem: strip by defaultAlyssa Ross
I'm not sure why this was disabled, but it looks like a pretty harmless way to bring down closure size and remove references to compilers and stuff.
2019-12-17ruby-modules: parse build_flags correctly:Burke Libbey
In building a gem whose native extension is a Rakefile, the previous version of this code will call essentially `rake ""`, when it means to call `rake`. This change converts `""` into `[]` rather than `[""]`.
2019-11-01treewide: Make still dont* Variables are optional in most casesJohn Ericson
Go beyond the obvious setup hooks now, with a bit of sed, with a skipped case: - cc-wrapper's `dontlink`, because it already is handled. Also, in nix files escaping was manually added. EMP
2019-09-03ruby.withPackages: initMichael Fellinger
Co-authored-by: Alyssa Ross <hi@alyssa.is>
2019-04-03ruby-modules/gem: fix path to git checkoutJustin Humm
In case of the gem type 'git', nix-bundle-install.rb was called with wrong path to the git checkout. ${src} does contain the sources, but not the newly generated .git dir, which is created in the buildPhase of pkgs/development/ruby-modules/gem/default.nix In some rare cases, this .git dir is needed at installPhase.
2019-03-29(ruby-modules/gem): (refactor) (#53525)Judson Lester
* Changing leaveDotGit to git chacha on build * Removing debugging cruft * Simpler git handling * Can't clobber index after `add` * Update pkgs/development/ruby-modules/gem/default.nix Useful comments Co-Authored-By: nyarly <nyarly@users.noreply.github.com> * Update pkgs/development/ruby-modules/gem/default.nix Comments are useful Co-Authored-By: nyarly <nyarly@users.noreply.github.com>
2018-10-29buildRubyGem: Provide manpages for Ruby gems (#49334)Michael Fellinger
2018-03-03buildRubyGem: Make testing easierAneesh Agrawal
Don't default `doCheck` to false, and use the default set of phases so the phases list does not need to be overriden in order to add checkPhase or installCheckPhase.
2018-01-04ruby-modules: Add new url `source` typeAneesh Agrawal
This just defers to `fetchurl` for fetching. Additionally, update the `nix-bundle-install.rb` script to handle gems installed from a path, i.e. those with a `url` source. Some parts of that script have been disabled in the `path` case that likely shouldn't be, but cause errors and aren't necessary to get `vagrant` to work.