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

hunter: init at 1.3.5 #120084

Merged
merged 4 commits into from
Apr 29, 2021
Merged

hunter: init at 1.3.5 #120084

merged 4 commits into from
Apr 29, 2021

Conversation

fufexan
Copy link
Contributor

@fufexan fufexan commented Apr 21, 2021

Motivation for this change

Add the hunter file manager. Builds on the work done in 99898, since @magnetophon isn't interested in maintaining this package anymore.

The maintainer of the project has disappeared, but there may be folks who decide to fork and continue its development. For this exact reason I have picked a fork as the repo, since it includes some fixes and allows building the package without Rust Nightly.

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.

@legendofmiracles
Copy link
Contributor

Result of nixpkgs-review pr 120084 run on x86_64-linux 1

1 package built:
  • hunter

@magnetophon
Copy link
Member

@fufexan Thanks!
Cool that there is a more maintained fork now, and that it builds on regular rust.
As far as I can tell, it only has 5 commits on top of upstream.
Let's see where it goes.

Unfortunately, when trying to build it, I get:

nixpkgs-review pr 120084
$ git -c fetch.prune=false fetch --force https://github.com/NixOS/nixpkgs master:refs/nixpkgs-review/0 pull/120084/head:refs/nixpkgs-review/1
$ git worktree add /home/bart/.cache/nixpkgs-review/pr-120084-1/nixpkgs b14062b75c4e8ef4dd4110282f7105be87f681d7
Preparing worktree (detached HEAD b14062b75c4)
Updating files: 100% (25504/25504), done.
HEAD is now at b14062b75c4 zfsUnstable: 2.0.4 -> 2.1.0-rc3
$ git merge --no-commit 0924d47a04689b2d061e8cef02ff2fc4c0037eb4
Automatic merge went well; stopped before committing as requested
$ nix --experimental-features nix-command build --no-link --keep-going --option build-use-sandbox relaxed -f /home/bart/.cache/nixpkgs-review/pr-120084-1/build.nix
building '/nix/store/6kpf15hyr4i6a94xfpxkjrdwyh1n39mb-hunter-1.3.5.drv' on 'ssh://nixBuild@builder'...
[1/0/2 built] building hunter-1.3.5 on ssh://nixBuild@builder: error: build failed
error: build of '/nix/store/6kpf15hyr4i6a94xfpxkjrdwyh1n39mb-hunter-1.3.5.drv' on 'ssh://nixBuild@builder' failed: builder for '/nix/store/6kpf15hyr4i6a94xfpxkjrdwyh1n39mb-hunter-1.3.5.drv' failed with exit code 101
builder for '/nix/store/6kpf15hyr4i6a94xfpxkjrdwyh1n39mb-hunter-1.3.5.drv' failed with exit code 1; last 10 log lines:
     Compiling pin-project-lite v0.2.4
     Compiling getrandom v0.1.16
     Compiling memchr v2.3.4
  error: could not compile `version-compare`

  Caused by:
    process didn't exit successfully: `rustc --crate-name version_compare --edition=2018 /build/hunter-1.3.5-vendor.tar.gz/version-compare/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debug-assertions=off --cfg 'feature="default"' -C metadata=8d0e8559a6e5325f -C extra-filename=-8d0e8559a6e5325f --out-dir /build/source/target/release/deps -C linker=/nix/store/xicw4xz0fnd9kmbdlnj6kajd4wz5im7l-gcc-wrapper-10.2.0/bin/cc -L dependency=/build/source/target/release/deps --cap-lints allow` (signal: 7, SIGBUS: access to undefined memory)
  warning: build failed, waiting for other jobs to finish...
  error: build failed
  builder for '/nix/store/6kpf15hyr4i6a94xfpxkjrdwyh1n39mb-hunter-1.3.5.drv' failed with exit code 101
cannot build derivation '/nix/store/xlryyza6mhmx5zv0jbq0fhi09qy30qwq-env.drv': 1 dependencies couldn't be built
error: build of '/nix/store/xlryyza6mhmx5zv0jbq0fhi09qy30qwq-env.drv' failed

Link to currently reviewing PR:
https://github.com/NixOS/nixpkgs/pull/120084

Any ideas?

@fufexan
Copy link
Contributor Author

fufexan commented Apr 21, 2021

@magnetophon are you building on x86_64-linux? This is my output:

mihai@kiiro ~code/git/nixpkgs % nixpkgs-review pr 120084                                                                                                                       (master)nixpkgs
$ git -c fetch.prune=false fetch --force https://github.com/NixOS/nixpkgs master:refs/nixpkgs-review/0 pull/120084/head:refs/nixpkgs-review/1
$ git worktree add /home/mihai/.cache/nixpkgs-review/pr-120084-2/nixpkgs b14062b75c4e8ef4dd4110282f7105be87f681d7
Preparing worktree (detached HEAD b14062b75c4)
Updating files: 100% (25504/25504), done.
HEAD is now at b14062b75c4 zfsUnstable: 2.0.4 -> 2.1.0-rc3
$ git merge --no-commit 0924d47a04689b2d061e8cef02ff2fc4c0037eb4
Automatic merge went well; stopped before committing as requested
$ nix --experimental-features nix-command build --no-link --keep-going --option build-use-sandbox relaxed -f /home/mihai/.cache/nixpkgs-review/pr-120084-2/build.nix

Link to currently reviewing PR:
https://github.com/NixOS/nixpkgs/pull/120084

1 package built:
hunter

@r-rmcgibbo
Copy link

Result of nixpkgs-review pr 120084 at 0924d47a run on aarch64-linux 1

1 package failed to build:

Note that build failures may predate this PR, and could be nondeterministic or hardware dependent.
Please exercise your independent judgement.

@magnetophon
Copy link
Member

@fufexan Yes, 64 bit linux.
It's on a remote build machine that I just finished and haven't tested much yet, so I guess that's the issue?

Odd, @r-rmcgibbo got a different error, at first glance.

@fufexan
Copy link
Contributor Author

fufexan commented Apr 21, 2021

@magnetophon What I can gather from your output, specifically this

(signal: 7, SIGBUS: access to undefined memory)

is that the command has some kind of problem with memory. Though I'm not sure what specifically. People with more experience in Rust may be able to help us. Or it may be like you said, a problem with your build machine. Try building on another computer if you can.

@r-rmcgibbo It looks like ofborg also failed to build on aarch64-linux. It will be resolved upstream (hopefully).

@magnetophon
Copy link
Member

I just found out that zfs has detected an error on /nix/store/8is7s1sgnn9l1kgh2mzirw4b1pbd5r33-rustc-1.51.0/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-a640413d30ec809b.rlib, so that is probably the problem, right?

I'll go look up how to force a rebuild.

@OPNA2608
Copy link
Contributor

Build fails on x86_64-darwin, you need to add Security and CoreServices.

@fufexan
Copy link
Contributor Author

fufexan commented Apr 21, 2021

@OPNA2608 I hope it's better now. If not, please correct me.

@magnetophon
Copy link
Member

magnetophon commented Apr 21, 2021

I built it using nixpkgs-review pr --build-args="--builders '' --max-jobs 8 " 120084 and now all is fine.
It also runs.

Thanks!

@legendofmiracles
Copy link
Contributor

legendofmiracles commented Apr 21, 2021

Hm? How did it compile for me?

Result of nixpkgs-review pr 120084 run on x86_64-linux 1
1 package built:

* hunter

Despite there not being any changes in between 🤔

@OPNA2608
Copy link
Contributor

Compiles & launches on x86_64-darwin now.

hunter
Screenshot_macOS_2021-04-21_21:53:06

I think the of length 0' line in the bottom right that was overwritten with huge blank blocks is an error message? It basically just plays a loading animation (3 . in front of the text cursor's position).

@fufexan
Copy link
Contributor Author

fufexan commented Apr 21, 2021

Hm? How did it compile for me?

Result of nixpkgs-review pr 120084 run on x86_64-linux 1
1 package built:

* hunter

Despite there not being any changes in between thinking

@legendofmiracles magnetophon had issues because of his build machine. OPNA2608 had issues because he's on darwin, and I forgot to add some deps. For r-rmcgibbo it didn't compile because they built it on aarch64 which is currently not supported by hunter. All of these issues had nothing to do with 64bit linux, that's why it built for you from the first try.

If I had any other machines rather than x86_64-linux, these issues would have been fixed already.

@OPNA2608 that's weird, I haven't had that happen. Though it's good to know that it now builds on darwin too. 🙂

@legendofmiracles
Copy link
Contributor

Glad we could test it all possible operating systems and architectures 😄

pkgs/top-level/all-packages.nix Outdated Show resolved Hide resolved
pkgs/applications/misc/hunter/default.nix Outdated Show resolved Hide resolved
@fufexan
Copy link
Contributor Author

fufexan commented Apr 28, 2021

I've tried adding patches as @SuperSandro2000 suggested, however the build fails to use cargoSha256 and complains about it being outdated. I can't get it to give me a "newer" one. I'm posting the derivation I got so far. If anyone could help me I'd be grateful.

{ lib
, stdenv
, pkg-config
, rustPlatform
, fetchFromGitHub
, fetchpatch
, makeWrapper
, glib
, gst_all_1
, CoreServices
, IOKit
, Security
}:

rustPlatform.buildRustPackage rec {
  pname = "hunter";
  version = "2020-05-25-unstable";

  src = fetchFromGitHub {
    owner = "rabite0";
    repo = "hunter";
    rev = "355d9a3101f6d8dc375807de79e368602f1cb87d";
    sha256 = "sha256-R2wNkG8bFP7X2pdlebHK6GD15qmD/zD3L0MwVthvzzQ=";
  };

  patches = [
    (fetchpatch {
      name = "remove-dependencies-on-rust-nightly";
      url =
        "https://github.com/06kellyjac/hunter/commit/a5943578e1ee679c8bc51b0e686c6dddcf74da2a.diff";
      sha256 = "sha256-eOwBFfW5m8tPnu+whWY/53X9CaqiVj2WRr25G+Yy7qE=";
    })
    (fetchpatch {
      name = "fix-accessing-core-when-moved-with-another-clone";
      url =
        "https://github.com/06kellyjac/hunter/commit/2e95cc567c751263f8c318399f3c5bb01d36962a.diff";
      sha256 = "sha256-yTzIXUw5qEaR2QZHwydg0abyZVXfK6fhJLVHBI7EAro=";
    })
    (fetchpatch {
      name = "chore-cargo-update";
      url =
        "https://github.com/06kellyjac/hunter/commit/b0be49a82191a4420b6900737901a71140433efd.diff";
      sha256 = "sha256-ctxoDwyIJgEhMbMUfrjCTy2SeMUQqMi971szrqEOJeg=";
    })
    (fetchpatch {
      name = "chore-cargo-upgrade-+-cargo-update";
      url =
        "https://github.com/06kellyjac/hunter/commit/1b8de9248312878358afaf1dac569ebbccc4321a.diff";
      sha256 = "sha256-+4DZ8SaKwKNmr2SEgJJ7KZBIctnYFMQFKgG+yCkbUv0=";
    })
    (fetchpatch {
      name = "fix-resolve-breaking-changes-from-package-updates";
      url =
        "https://github.com/06kellyjac/hunter/commit/2484f0db580bed1972fd5000e1e949a4082d2f01.diff";
      sha256 = "sha256-K+WUxEr1eE68XejStj/JwQpMHlhkiOw6PmiSr1GO0kc=";
    })
  ];

  RUSTC_BOOTSTRAP = 1;

  nativeBuildInputs = [ makeWrapper pkg-config ];
  buildInputs = [
    glib
    gst_all_1.gstreamer
    gst_all_1.gst-plugins-base
    gst_all_1.gst-plugins-good
    gst_all_1.gst-plugins-ugly
    gst_all_1.gst-plugins-bad
  ] ++ lib.optionals stdenv.isDarwin [ CoreServices IOKit Security ];

  cargoBuildFlags = [ "--no-default-features" "--features=img,video" ];

  postInstall = ''
    wrapProgram $out/bin/hunter --prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0"
  '';

  cargoSha256 = "sha256-+1M22yQ8g9pKDYf5Zm9ae6oawoKB7kqFjykKbDeGDg8=";

  meta = with lib; {
    description = "The fastest file manager in the galaxy!";
    homepage = "https://github.com/rabite0/hunter";
    license = licenses.wtfpl;
    maintainers = with maintainers; [ fufexan ];
  };
}

EDIT: solved with @OPNA2608's help again.

Copy link
Contributor

@OPNA2608 OPNA2608 left a comment

Choose a reason for hiding this comment

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

Result of nixpkgs-review pr 120084 run on x86_64-linux 1

1 package built:
  • hunter

Binary launches but I have no clue how to navigate it.

pkgs/applications/misc/hunter/default.nix Outdated Show resolved Hide resolved
pkgs/applications/misc/hunter/default.nix Show resolved Hide resolved
fufexan and others added 2 commits April 28, 2021 21:30
Co-authored-by: Christoph Neidahl <christoph.neidahl@gmail.com>
Co-authored-by: Christoph Neidahl <christoph.neidahl@gmail.com>
@fufexan
Copy link
Contributor Author

fufexan commented Apr 28, 2021

Binary launches but I have no clue how to navigate it.

Arrow keys / hjkl to get around dirs, / to search. All the commands are found in the project's readme.

@fufexan
Copy link
Contributor Author

fufexan commented Apr 29, 2021

Any news on this? Should I run ofborg again?

@SuperSandro2000
Copy link
Member

@ofborg eval

@SuperSandro2000 SuperSandro2000 merged commit 3ed601e into NixOS:master Apr 29, 2021
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.

6 participants