Commit Graph

38 Commits

Author SHA1 Message Date
Yueh-Shun Li
b93d8fb3bd bundled-common: use structured attributes 2026-07-09 11:00:07 +08:00
Wolfgang Walther
5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
Silvan Mosberger
84d4f874c2 treewide: format all inactive Nix files
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 a08b3a4d19.tar.gz \
      --argstr baseRev 78e9caf153
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:23:58 +01:00
jopejoe1
b497dfa184 bundler-{app,env}: expose pname and version in derivation 2024-11-15 23:57:00 +01:00
Artturin
897e070df7 Merge pull request #270242 from tie/ruby-cross
ruby-modules: improve cross-compilation support
2024-06-26 01:37:12 +03:00
Andrew Marshall
f299debaac bundlerEnv: Fix passthru not being passed-through
E.g. `pkgs.bundlerEnv { passthru = { ... }; ... }` previously would not
result in the `passthru` attrs not being concatenated onto the returned
derivation. Now it will be.
2024-06-03 23:41:29 -04:00
Ivan Trubach
30971173ab ruby-modules: improve cross-compilation support 2024-05-28 21:07:20 +03:00
Philip Taron
73b8a831f9 Avoid top-level with ...; in pkgs/development/ruby-modules/bundled-common/default.nix 2024-03-25 18:12:29 -07:00
Sergei Trofimovich
38b39dd404 ruby-modules/bundled-common: do not define gemType for null packages
Without the change `gemType` gets defined via `null` attrset that
exposes unevaluatable attribute:

    nix-repl> ronin.gemType
    error:
       … while evaluating the attribute 'gemType'

         at pkgs/development/ruby-modules/bundled-common/default.nix:122:30:

          121|       inherit ruby bundler gems confFiles envPaths;
          122|       inherit (gems.${pname}) gemType;
             |                              ^
          123|

       … while evaluating an attribute name

       error: value is null while a string was expected

After the change `passthru` does not expose a `gemType` if `pname` is
`null`.
2024-01-11 17:25:31 +00:00
Felix Bühler
0a2745684e Merge pull request #239624 from Stunkymonkey/use-optionalString-then
treewide: use optionalString instead of 'then ""'
2023-07-22 13:02:47 +02:00
Felix Buehler
f3719756b5 treewide: use optionalString instead of 'then ""' 2023-06-24 20:19:19 +02:00
Animesh Sahu
6077061403 nixos/ruby-modules: proper treatment to ruby modules of type git/url 2023-06-15 17:18:11 +05:30
Felix Buehler
cdb39a86e0 treewide: use optionalString 2023-02-13 21:52:34 +01:00
Artturin
f97c3252e8 bundlerApp: accept nativeBuildInputs
69dcb1a2c0

added support for buildInputs with the intention of adding makeWrapper
but makeWrapper should be in nativeBuildInputs
2022-08-16 13:14:19 +03:00
Winter
8fb9c2cdd7 bundlerEnv: allow copying additional paths alongside config files 2022-08-11 13:26:34 -04:00
Sandro Jäckel
a734cbbd5d wrappedRuby: add test for binaryWrapper 2022-03-09 16:13:59 +01:00
Tobias Bergkvist
e377a4d312 ruby-modules/bundler-env: Replace makeWrapper with makeBinaryWrapper to make bundled ruby apps work on macOS 2022-02-22 01:12:57 +01:00
Michael Fellinger
973639dcf1 bundlerEnv.wrappedRuby: inherit gemPath and meta 2021-10-07 12:03:26 +02:00
Alyssa Ross
aafa2db61a bundlerEnv: fix documentation argument
This was ignored before.  Now that it's passed through, it's possible
to do

    (bundlerEnv {
      name = "...";
      gemdir = ./.;
      document = [ "ri" ];
    }).env

and get an environment where ri can be used to read gem documentation.
2021-09-18 10:58:24 +00:00
Michael Fellinger
a2e73b062a bundler: 1.17.3 -> 2.1.4 2020-04-03 23:52:14 +02:00
talyz
affcf9ba1e bundlerEnv: Add option to copy gem files instead of symlinking
The way ruby loads gems and keeps track of their paths seems to not
always work very well when the gems are accessed through
symlinks. Ruby will then complain that the same files are loaded
multiple times; it relies on the file's full path to determine whether
the file is loaded or not.

This adds an option to simply copy all gem files into the environment
instead, which gets rid of this issue, but may instead result in major
file duplication.
2020-03-03 21:19:01 +01:00
volth
35d68ef143 treewide: remove redundant quotes 2019-08-26 21:40:19 +00:00
Alyssa Ross
83a2d993d4 bundlerEnv: include all groups by default
This wasn't really an issue until the latest minor release of Bundix
(2.4), because prior to then Bundix didn't emit group attributes, and so
this functionality of bundlerEnv wasn't really used. However, it is now
apparent that a better default for bundlerEnv would be to include all
gem groups by default, not just the default group. This matches the
behavior of Bundler, and makes more sense, because the default group
alone isn't necessarily useful for anything -- consider a Rails app with
production, development, and test groups. It has the additional benefit
of being backwards compatible with how this would have worked before the
Bundix update.
2018-12-11 21:26:08 +00:00
Judson Lester
2d5bd339da Bugfix: gemsets didn't handle paths correctly (#51002) 2018-11-25 13:38:38 +01:00
Alyssa Ross
69dcb1a2c0 bundlerApp: take buildInputs (#45435)
It would be reasonable to have a Ruby program that depends on some other
program being in the PATH. In this case, the obvious thing to do would
be something like this:

    bundlerApp {
      # ...
      buildInputs = [ makeWrapper ];
      postBuild = ''
        wrapProgram "$out/bin/foo" \
          --prefix PATH : ${lib.makeBinPath [ dep ]}
      '';
    }

However, this doesn't work, because even though it just forwards most of
its arguments to `runCommand`, `bundlerApp` won't take a `buildInputs`
parameter. It doesn't even specify its own `buildInputs`, which means
that the `scripts` parameter to `bundlerApp` (which depends on
`makeWrapper`) is completely broken, and, as far as I can tell, has been
since its inception. I've added a `makeWrapper` build input if the
scripts parameter is present to fix this.

I've added a `buildInputs` option to `bundlerApp`. It's also passed
through to bundled-common because `postBuild` scripts are run there as
well. This actually means that in this example we'd end up going through
two layers of wrappers (one from `bundlerApp` and one from
bundled-common), but that has always been the case and isn't likely to
break anything. That oddity does suggest that it might be prudent to
not forward `postBuild` to bundled-common (or to at least use a
different option) though...

FWIW, as far as I can tell no package in nixpkgs uses either the
`scripts` or `postBuild` options to `bundlerApp`.
2018-10-29 22:39:51 +01:00
volth
dda95bae35 [bot] treewide: remove unused 'args@' in lambdas 2018-07-20 19:54:05 +00:00
Raitis Veinbahs
a6a2e75804 ruby-modules: Import gemset if it's a path OR a string. (#38959)
This fixes the bug introduced by 8686b98612 which broke bundlerEnv
exprs when gemdir was a string (thus making gemset a string by
`gemset = gemdir + "/gemset.nix"`) which made it being treated as a
set.
2018-04-15 11:53:15 +01:00
Aneesh Agrawal
8686b98612 ruby-modules: Allow overriding gemset
This allows patching the gemset output by bundix from a default.nix
file, making it easier to perform updates since the bundix update no
longer has to be manually updated.
2018-01-04 02:28:33 -05:00
Robin Gloster
0154d1b03f fix evaluation
cc @nyarly
2017-07-30 00:03:24 +02:00
Judson
0641253ae6 Small changes in response to review. 2017-07-02 17:18:58 -07:00
Judson
e149f02344 Using pname and fetching versions 2017-06-27 22:33:18 -07:00
Judson
70e7e543c5 A few cleanups and renames. One feature remains... 2017-06-27 10:56:36 -07:00
Judson
603e84caef Fixing an overload of "pname" 2017-06-25 17:40:22 -07:00
Judson
964d9b7a06 Made gemdir handling into a common function 2017-06-09 09:04:33 -07:00
Judson
0bde4071fc Merge branch 'bundlerenv_usecases' of github.com:nyarly/nixpkgs into bundlerenv_usecases 2017-05-31 09:53:03 -07:00
Judson
c4fc70f53c Starting to add tool builder. Extracting bundler file computation. 2017-05-31 09:44:46 -07:00
zimbatm
2b7cfdd6e9 fix missing variable in bundler-env 2017-05-29 13:27:41 +01:00
Judson
998d011e42 Restructuring files 2017-05-27 15:19:34 -07:00