Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libvmi: init at 0.12 #42683

Merged
merged 8 commits into from Jul 4, 2018
Merged

libvmi: init at 0.12 #42683

merged 8 commits into from Jul 4, 2018

Conversation

lschuermann
Copy link
Member

Motivation for this change

With #26162 there already is an attempt to create a nix derivation for libvmi, which seems to have stagnated. This work is based off of this original pull request but resolves merge conflicts and updates the library to its current release, v0.12.

It also adds an option to disable Xen support entirely.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

I'm currently investigating whether it is also possible and makes sense to provide an option for disabling KVM support.
Additionally, for libvmi to work fast on KVM, they provide a patch for QEMU which integrates further debug interfaces. I'll test this patch and try to create another QEMU derivation with the libvmi integrations.

Copy link
Member

@infinisil infinisil left a comment

Choose a reason for hiding this comment

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

@GrahamcOfBorg build libvmi

src = fetchFromGitHub {
owner = "libvmi";
repo = "libvmi";
rev = "6934e8a4758018983ec53ec791dd14a7d6ac31a9";
Copy link
Member

Choose a reason for hiding this comment

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

You can set version = "0.12.0", then use rev = "v${version}"

'';
license = with licenses; [ gpl3 lgpl3 ];
maintainers = with maintainers; [ lschuermann ];
};
Copy link
Member

Choose a reason for hiding this comment

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

Can you add the platforms attribute as well?

@ryantm
Copy link
Member

ryantm commented Jul 3, 2018

@GrahamcOfBorg build libvmi

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: libvmi

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: libvmi

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: libvmi

Partial log (click to expand)

shrinking /nix/store/78yg6ld6wny4ypp6kiqlx2jnhrllib3p-libvmi-0.12/lib/libvmi.so.0.0.12
shrinking /nix/store/78yg6ld6wny4ypp6kiqlx2jnhrllib3p-libvmi-0.12/bin/vmi-process-list
shrinking /nix/store/78yg6ld6wny4ypp6kiqlx2jnhrllib3p-libvmi-0.12/bin/vmi-module-list
shrinking /nix/store/78yg6ld6wny4ypp6kiqlx2jnhrllib3p-libvmi-0.12/bin/vmi-win-guid
shrinking /nix/store/78yg6ld6wny4ypp6kiqlx2jnhrllib3p-libvmi-0.12/bin/vmi-dump-memory
strip is /nix/store/4qvrxzxa535y8304mk195x50b6p9607d-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/78yg6ld6wny4ypp6kiqlx2jnhrllib3p-libvmi-0.12/lib  /nix/store/78yg6ld6wny4ypp6kiqlx2jnhrllib3p-libvmi-0.12/bin
patching script interpreter paths in /nix/store/78yg6ld6wny4ypp6kiqlx2jnhrllib3p-libvmi-0.12
checking for references to /build in /nix/store/78yg6ld6wny4ypp6kiqlx2jnhrllib3p-libvmi-0.12...
/nix/store/78yg6ld6wny4ypp6kiqlx2jnhrllib3p-libvmi-0.12

sha256 = "0wbi2nasb1gbci6cq23g6kq7i10rwi1y7r44rl03icr5prqjpdyv";
};

buildInputs = [ glib which libvirt json_c ] ++ (optional xenSupport xen);
Copy link
Member

Choose a reason for hiding this comment

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

which is not needed.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll throw it out.

};

buildInputs = [ glib which libvirt json_c ] ++ (optional xenSupport xen);
nativeBuildInputs = [ autoreconfHook yacc bison flex libtool autoconf automake pkgconfig ];
Copy link
Member

Choose a reason for hiding this comment

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

yacc, autoconf and automake aren't needed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, you're right. I didn't question the inputs from @proteansec. Only one of either yacc or bison is required. I'll remove yacc.

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess autoconf and automake are implicitly marked as nativeBuildInputs by autoreconfHook?
For me, it also builds successfully without libtool. I'll remove that too.

details of a running virtual machine by viewing its memory, trapping on hardware events,
and accessing the vCPU registers.
'';
license = with licenses; [ gpl3 lgpl3 ];
Copy link
Member

Choose a reason for hiding this comment

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

Why double licensed? I can only find LGPL3.0 in their repo

Copy link
Member Author

Choose a reason for hiding this comment

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

This also had me confused. Since this commit, they are dual licensed under the GPL3 and LGPL3. You'll find COPYING and COPYING.LESSER in the repo.

@infinisil infinisil merged commit 6fd7f31 into NixOS:master Jul 4, 2018
@infinisil infinisil mentioned this pull request Jul 4, 2018
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants