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

rkvm: init at ... #108288

Closed
wants to merge 2 commits into from
Closed

rkvm: init at ... #108288

wants to merge 2 commits into from

Conversation

colemickens
Copy link
Member

Motivation for this change

Fixes #108276 by adding rkvm.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

cargoSha256 = "sha256-1sxP74xt3DGCAhY6Dolaz2JB3Q6CTvtkgln08AMGmc0=";

postPatch = ''
sed -i 's|.clang_arg("-I/usr/include/libevdev-1.0/")|.clang_arg("-I${libevdev}/include/libevdev-1.0").clang_arg("-I${linuxHeaders}/include")|g' ./input/build.rs
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should do a patch for this because this seems quite complex.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi @SuperSandro2000, thanks for looking so fast. I've left this as a draft as someones helping me in IRC. I plan to file bugs upstream, wait for them, something before marking this as ready. Or at least writing this in a slightly more readable way at least.

@colemickens
Copy link
Member Author

With the version I just pushed, this is the trailing result of nix build -L .#rkvm:

rkvm-unstable-ec404c69> error: failed to run custom build command for `input v0.2.0 (/build/source/input)`
rkvm-unstable-ec404c69> Caused by:
rkvm-unstable-ec404c69>   process didn't exit successfully: `/build/source/target/release/build/input-8e4ca7164380d3b7/build-script-build` (exit code: 101)
rkvm-unstable-ec404c69>   --- stdout
rkvm-unstable-ec404c69>   cargo:rerun-if-changed=glue/glue.h
rkvm-unstable-ec404c69>   cargo:rustc-link-lib=evdev
rkvm-unstable-ec404c69>   --- stderr
rkvm-unstable-ec404c69>   /nix/store/0avnch9kw2il7xqssha6ahxx03i38xi9-linux-headers-5.9.8/include/linux/input.h:13:10: fatal error: 'sys/time.h' file not found
rkvm-unstable-ec404c69>   /nix/store/0avnch9kw2il7xqssha6ahxx03i38xi9-linux-headers-5.9.8/include/linux/input.h:13:10: fatal error: 'sys/time.h' file not found, err: true
rkvm-unstable-ec404c69>   thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ()', input/build.rs:21:10
rkvm-unstable-ec404c69>   note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
rkvm-unstable-ec404c69> warning: build failed, waiting for other jobs to finish...
rkvm-unstable-ec404c69> error: build failed

Co-authored-by: Alyssa Ross <hi@alyssa.is>
@colemickens
Copy link
Member Author

TODO: the binaries need to be prefixed with rkvm-. These don't make good random binary names in PATH: client, server, certificate-gen.

@colemickens
Copy link
Member Author

not sure if it's working anyway: htrefil/rkvm#7

@stale
Copy link

stale bot commented Jul 11, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 11, 2021
@peterhoeg
Copy link
Member

@colemickens , you should probably move this into os-specific, but otherwise this works:

{ lib
, rustPlatform
, fetchFromGitHub
, pkg-config
, libevdev
, openssl
, llvmPackages
, linuxHeaders
}:

rustPlatform.buildRustPackage rec {
  pname = "rkvm";
  version = "0.3.3";

  src = fetchFromGitHub {
    owner = "htrefil";
    repo = "rkvm";
    rev = version;
    hash = "sha256-2cp6qtONyZHPGjLPXXEXNjyEqmqMTnvL1vKTTzg2Yek=";
  };

  cargoHash = "sha256-7oOJEq47Z4uKEE2BW9rR4qCETy9x89En8xJN5WjGGxA=";

  nativeBuildInputs = [ llvmPackages.clang pkg-config ];

  buildInputs = [ libevdev openssl linuxHeaders ];

  LIBCLANG_PATH = lib.makeLibraryPath [ llvmPackages.libclang ];

  # The libevdev bindings preserve comments from libev, some of which
  # contain indentation which Cargo tries to interpret as doc tests.
  doCheck = false;

  meta = with lib; {
    description = "Virtual KVM switch for Linux machines";
    homepage = "https://github.com/htrefil/rkvm";
    license = licenses.mit;
    maintainers = with maintainers; [ colemickens ];
    platforms = platforms.linux;
  };
}

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label May 15, 2023
@colemickens
Copy link
Member Author

I'm abandoning this. I'm happy doing everything from a single machine nowadays. If someone else wants to pick, please see @peterhoeg's comment, since I'll probably prune this branch soon.

@jian-lin jian-lin mentioned this pull request Sep 24, 2023
17 tasks
@colemickens colemickens deleted the rkvm branch October 2, 2023 22:11
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.

package request: rkvm: Virtual KVM switch for Linux machines
5 participants