aslilac / kc

Kayla's (line) counter (of code) :)
Mozilla Public License 2.0
24 stars 2 forks source link

Deprecated cargo feature #7

Open drainpixie opened 2 hours ago

drainpixie commented 2 hours ago

I've been trying to package kc for Nix, but the usage of .cargo/config (which is deprecated) breaks builds.

{
  lib,
  fetchFromGitHub,
  rustPlatform,
}:
rustPlatform.buildRustPackage rec {
  pname = "kc";
  version = "1.0.0";

  src = fetchFromGitHub {
    owner = "aslilac";
    repo = pname;
    rev = "v0.10.2"; #6 prevents new releases
    hash = "sha256-E9QnktyOE22FlWXRXpYcKYeW7hrqOndSJOBztevbUok=";
  };

  meta = {
    description = "Kayla's (line) counter (of code) :)";
    homepage = "https://github.com/aslilac/kc";
    license = lib.licenses.mpl20;
  };

  cargoHash = "sha256-LndOHxOSxmE07XTnFUlU6c7orB1SAzVY9Z27O5p22b0=";
}

with the following error:

warning: `/build/.cargo/config` is deprecated in favor of `config.toml`
note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`
warning: `/build/.cargo/config` is deprecated in favor of `config.toml`
note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`
   Compiling crossbeam-utils v0.8.20
   Compiling memchr v2.7.2
   Compiling libc v0.2.155
   Compiling io-lifetimes v1.0.11
   Compiling rustix v0.37.27
   Compiling regex-syntax v0.8.3
   Compiling same-file v1.0.6
   Compiling linux-raw-sys v0.3.8
   Compiling anyhow v1.0.86
   Compiling bitflags v1.3.2
   Compiling log v0.4.21
   Compiling walkdir v2.5.0
   Compiling lazy_static v1.4.0
   Compiling colored v2.1.0
   Compiling aho-corasick v1.1.3
   Compiling bstr v1.9.1
   Compiling crossbeam-epoch v0.9.18
   Compiling crossbeam-deque v0.8.5
   Compiling regex-automata v0.4.6
   Compiling terminal_size v0.2.6
   Compiling globset v0.4.14
   Compiling ignore v0.4.22
   Compiling kc v0.10.2 (/build/source)
    Finished `release` profile [optimized] target(s) in 21.97s
Executing cargoInstallPostBuildHook
cp: missing destination file operand after 'target/x86_64-unknown-linux-gnu/release-tmp/'
Try 'cp --help' for more information.
drainpixie commented 2 hours ago

Correcting myself, it's the modifying of the target directory that breaks build, will keep the PR open nonetheless since the point about the deprecated feature stands.