NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.68k stars 13.82k forks source link

Build failure: evil-winrm #340969

Open D3vil0p3r opened 4 weeks ago

D3vil0p3r commented 4 weeks ago

Steps To Reproduce

Steps to reproduce the behavior:

  1. nix-shell -p evil-winrm

Build log

these 4 derivations will be built:
  /nix/store/pq9zs860rhcb2q8szs28yc25ax1fbf3j-ruby3.3-stringio-0.0.2.drv
  /nix/store/km736v1rskkxni4l2gd6i75ilk7fkjpr-evil-winrm.drv
  /nix/store/szvlma15ivrf06v0q8lrfd2zr9s3rwld-wrapped-ruby-evil-winrm.drv
  /nix/store/lilk686fn8zd5169cyigqsvnjjwzb2q1-evil-winrm-3.5.drv
building '/nix/store/pq9zs860rhcb2q8szs28yc25ax1fbf3j-ruby3.3-stringio-0.0.2.drv'...
Running phase: unpackPhase
Running phase: patchPhase
Running phase: updateAutotoolsGnuConfigScriptsPhase
Running phase: configurePhase
no configure script, doing nothing
Running phase: installPhase
buildFlags: 
WARNING:  You build with buildroot.
  Build root: /
  Bin dir: /nix/store/spv5fw4myvfdsr6bjva1x96j9vj8sy2q-ruby3.3-stringio-0.0.2/lib/ruby/gems/3.3.0/bin
  Gem home: /nix/store/spv5fw4myvfdsr6bjva1x96j9vj8sy2q-ruby3.3-stringio-0.0.2/lib/ruby/gems/3.3.0
  Plugins dir: /nix/store/spv5fw4myvfdsr6bjva1x96j9vj8sy2q-ruby3.3-stringio-0.0.2/lib/ruby/gems/3.3.0/plugins
Building native extensions. This could take a while...
ERROR:  Error installing /nix/store/ws7m9agmpnkwvhvh0gkfsggm6r176a40-stringio-0.0.2.gem:
        ERROR: Failed to build gem native extension.

    current directory: /nix/store/spv5fw4myvfdsr6bjva1x96j9vj8sy2q-ruby3.3-stringio-0.0.2/lib/ruby/gems/3.3.0/gems/stringio-0.0.2/ext/stringio
/nix/store/r0ypxm1x0jf2v1837j7kcz56kjsc7rkp-ruby-3.3.4/bin/ruby extconf.rb
creating Makefile

current directory: /nix/store/spv5fw4myvfdsr6bjva1x96j9vj8sy2q-ruby3.3-stringio-0.0.2/lib/ruby/gems/3.3.0/gems/stringio-0.0.2/ext/stringio
make DESTDIR\= sitearchdir\=./.gem.20240910-31-c38rsc sitelibdir\=./.gem.20240910-31-c38rsc clean

current directory: /nix/store/spv5fw4myvfdsr6bjva1x96j9vj8sy2q-ruby3.3-stringio-0.0.2/lib/ruby/gems/3.3.0/gems/stringio-0.0.2/ext/stringio
make DESTDIR\= sitearchdir\=./.gem.20240910-31-c38rsc sitelibdir\=./.gem.20240910-31-c38rsc
compiling stringio.c
stringio.c: In function 'strio_copy':
stringio.c:483:5: warning: 'RB_OBJ_INFECT' is deprecated: taintedness turned out to be a wrong idea. [-Wdeprecated-declarations]
  483 |     OBJ_INFECT(copy, orig);
      |     ^~~~~~~~~~
In file included from /nix/store/r0ypxm1x0jf2v1837j7kcz56kjsc7rkp-ruby-3.3.4/include/ruby-3.3.0/ruby/internal/core/rstring.h:30,
                 from /nix/store/r0ypxm1x0jf2v1837j7kcz56kjsc7rkp-ruby-3.3.4/include/ruby-3.3.0/ruby/internal/arithmetic/char.h:29,
                 from /nix/store/r0ypxm1x0jf2v1837j7kcz56kjsc7rkp-ruby-3.3.4/include/ruby-3.3.0/ruby/internal/arithmetic.h:24,
                 from /nix/store/r0ypxm1x0jf2v1837j7kcz56kjsc7rkp-ruby-3.3.4/include/ruby-3.3.0/ruby/ruby.h:28,
                 from /nix/store/r0ypxm1x0jf2v1837j7kcz56kjsc7rkp-ruby-3.3.4/include/ruby-3.3.0/ruby.h:38,
                 from stringio.c:14:
/nix/store/r0ypxm1x0jf2v1837j7kcz56kjsc7rkp-ruby-3.3.4/include/ruby-3.3.0/ruby/internal/fl_type.h:859:1: note: declared here
  859 | RB_OBJ_INFECT(VALUE dst, VALUE src)
      | ^~~~~~~~~~~~~
stringio.c: In function 'strio_write':
stringio.c:1295:13: warning: 'RB_OBJ_INFECT' is deprecated: taintedness turned out to be a wrong idea. [-Wdeprecated-declarations]
 1295 |             OBJ_INFECT(ptr->string, str);
      |             ^~~~~~~~~~
/nix/store/r0ypxm1x0jf2v1837j7kcz56kjsc7rkp-ruby-3.3.4/include/ruby-3.3.0/ruby/internal/fl_type.h:859:1: note: declared here
  859 | RB_OBJ_INFECT(VALUE dst, VALUE src)
      | ^~~~~~~~~~~~~
stringio.c:1304:9: warning: 'RB_OBJ_INFECT' is deprecated: taintedness turned out to be a wrong idea. [-Wdeprecated-declarations]
 1304 |         OBJ_INFECT(ptr->string, str);
      |         ^~~~~~~~~~
/nix/store/r0ypxm1x0jf2v1837j7kcz56kjsc7rkp-ruby-3.3.4/include/ruby-3.3.0/ruby/internal/fl_type.h:859:1: note: declared here
  859 | RB_OBJ_INFECT(VALUE dst, VALUE src)
      | ^~~~~~~~~~~~~
stringio.c:1306:5: warning: 'RB_OBJ_INFECT' is deprecated: taintedness turned out to be a wrong idea. [-Wdeprecated-declarations]
 1306 |     OBJ_INFECT(ptr->string, self);
      |     ^~~~~~~~~~
/nix/store/r0ypxm1x0jf2v1837j7kcz56kjsc7rkp-ruby-3.3.4/include/ruby-3.3.0/ruby/internal/fl_type.h:859:1: note: declared here
  859 | RB_OBJ_INFECT(VALUE dst, VALUE src)
      | ^~~~~~~~~~~~~
stringio.c: In function 'Init_stringio':
stringio.c:1626:50: error: 'rb_cData' undeclared (first use in this function)
 1626 |     VALUE StringIO = rb_define_class("StringIO", rb_cData);
      |                                                  ^~~~~~~~
stringio.c:1626:50: note: each undeclared identifier is reported only once for each function it appears in
make: *** [Makefile:248: stringio.o] Error 1

make failed, exit code 2

Gem files will remain installed in /nix/store/spv5fw4myvfdsr6bjva1x96j9vj8sy2q-ruby3.3-stringio-0.0.2/lib/ruby/gems/3.3.0/gems/stringio-0.0.2 for inspection.
Results logged to /nix/store/spv5fw4myvfdsr6bjva1x96j9vj8sy2q-ruby3.3-stringio-0.0.2/lib/ruby/gems/3.3.0/extensions/x86_64-linux/3.3.0/stringio-0.0.2/gem_make.out
error: builder for '/nix/store/pq9zs860rhcb2q8szs28yc25ax1fbf3j-ruby3.3-stringio-0.0.2.drv' failed with exit code 1;
       last 10 log lines:
       > stringio.c:1626:50: error: 'rb_cData' undeclared (first use in this function)
       >  1626 |     VALUE StringIO = rb_define_class("StringIO", rb_cData);
       >       |                                                  ^~~~~~~~
       > stringio.c:1626:50: note: each undeclared identifier is reported only once for each function it appears in
       > make: *** [Makefile:248: stringio.o] Error 1
       >
       > make failed, exit code 2
       >
       > Gem files will remain installed in /nix/store/spv5fw4myvfdsr6bjva1x96j9vj8sy2q-ruby3.3-stringio-0.0.2/lib/ruby/gems/3.3.0/gems/stringio-0.0.2 for inspection.
       > Results logged to /nix/store/spv5fw4myvfdsr6bjva1x96j9vj8sy2q-ruby3.3-stringio-0.0.2/lib/ruby/gems/3.3.0/extensions/x86_64-linux/3.3.0/stringio-0.0.2/gem_make.out
       For full logs, run 'nix log /nix/store/pq9zs860rhcb2q8szs28yc25ax1fbf3j-ruby3.3-stringio-0.0.2.drv'.
error: 1 dependencies of derivation '/nix/store/km736v1rskkxni4l2gd6i75ilk7fkjpr-evil-winrm.drv' failed to build
error: 1 dependencies of derivation '/nix/store/lilk686fn8zd5169cyigqsvnjjwzb2q1-evil-winrm-3.5.drv' failed to build

Additional context

Add any other context about the problem here.

Notify maintainers

Missing maintainers inside .nix file.

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.42, Athena OS, 24.11 (Vicuna), 24.11pre677397.574d1eac1c20`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.5`
 - channels(root): `"nixos"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Add a :+1: reaction to issues you find important.

Random936 commented 2 weeks ago

Hey, I had the same issue when switching from 24.05 to unstable today. I'm not super experienced with Nixos, so I just pulled the package code down locally to attempt to fix it.

It seems like the issue is related to the package using super old versions of the evil-winrm dependencies. From what I understand, this was likely based on the library requirement descriptions from the readme. Whatever the case, I managed to fix it by updating the stringio version from 0.0.2 to 3.1.1 in gemset.nix.

  stringio = {
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "sha256-U0VuFBdcWU4OjrIgahvjPzl01P4hwTHmKJCLBcjCrh4=";
      type = "gem";
    };
    version = "3.1.1";
  };

Running a quick help command:

$ evil-winrm

Evil-WinRM shell v3.5

Error: missing argument: ip, user

Usage: evil-winrm -i IP -u USER [-s SCRIPTS_PATH] [-e EXES_PATH] [-P PORT] [-p PASS] [-H HASH] [-U URL] [-S] [-c PUBLIC_KEY_PATH ] [-k PRIVATE_KEY_PATH ] [-r REALM] [--spn SPN_PREFIX] [-l]
    -S, --ssl                        Enable ssl
    -c, --pub-key PUBLIC_KEY_PATH    Local path to public key certificate
    -k, --priv-key PRIVATE_KEY_PATH  Local path to private key certificate
    -r, --realm DOMAIN               Kerberos auth, it has to be set also in /etc/krb5.conf file using this format -> CONTOSO.COM = { kdc = fooserver.contoso.com }
    -s, --scripts PS_SCRIPTS_PATH    Powershell scripts local path
        --spn SPN_PREFIX             SPN prefix for Kerberos auth (default HTTP)
    -e, --executables EXES_PATH      C# executables local path
    -i, --ip IP                      Remote host IP or hostname. FQDN for Kerberos auth (required)
    -U, --url URL                    Remote url endpoint (default /wsman)
    -u, --user USER                  Username (required if not using kerberos)
    -p, --password PASS              Password
    -H, --hash HASH                  NTHash
    -P, --port PORT                  Remote host port (default 5985)
    -V, --version                    Show version
    -n, --no-colors                  Disable colors
    -N, --no-rpath-completion        Disable remote path completion
    -l, --log                        Log the WinRM session
    -h, --help                       Display this help message

My nix info:

$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.52, NixOS, 24.11 (Vicuna), 24.11.20240921.9357f4f`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.7`
 - channels(root): `"nixos-24.05"`
 - nixpkgs: `/nix/store/y6205wq8hxvpqvl8l9d1n9xah01kg0lq-source`
D3vil0p3r commented 2 weeks ago

Thank you very much @Random936 Feel free to create a proper PR on it. If you cannot, I will do once I back home.

Mag1cByt3s commented 4 days ago

I just encountered the same issue with evil-winrm after updating my flake inputs. I am also running on nixos-unstable.

stringio.c: In function 'Init_stringio':
stringio.c:1626:50: error: 'rb_cData' undeclared (first use in this function)
 1626 |     VALUE StringIO = rb_define_class("StringIO", rb_cData);
      |                                                  ^~~~~~~~
stringio.c:1626:50: note: each undeclared identifier is reported only once for each function it appears in
make: *** [Makefile:248: stringio.o] Error 1

make failed, exit code 
nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.9.11-xanmod1, Red Flake, rolling, rolling`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.5`
 - nixpkgs: `/nix/store/bcghcr9qwqmanpds017w75mcqda4fgab-source`
Mag1cByt3s commented 4 days ago

There is a pull request already which should fix this issue: https://github.com/NixOS/nixpkgs/pull/345974