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

buildRustPackage: allow passing in cargoDeps #340798

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SuperSandro2000
Copy link
Member

@SuperSandro2000 SuperSandro2000 commented Sep 9, 2024

Description of changes

Since roughly a week or so the following overlay fails and I couldn't so far figure out why because the changes done in the last ~3 months or so look rather innocent.

  # TODO: upstream into nixpkgs
  wezterm-headless = rustPlatform.buildRustPackage {
    pname = "${wezterm.pname}-headless";
    inherit (wezterm) version src postPatch;
    inherit (wezterm.passthru) cargoLock;

    nativeBuildInputs = [ pkg-config ];

    buildInputs = [ openssl ];

    cargoBuildFlags = [
      "--package" "wezterm"
      "--package" "wezterm-mux-server"
    ];

    doCheck = false;

    postInstall = /* bash */ ''
      install -Dm644 assets/shell-integration/wezterm.sh -t $out/etc/profile.d
      sed -e 's|hash wezterm 2>/dev/null|command type -P wezterm &>/dev/null|g' \
        -e 's|hash base64 2>/dev/null|command type -P base64 &>/dev/null|g' \
        -e 's|hash hostname 2>/dev/null|command type -P hostname &>/dev/null|g' \
        -e 's|hash hostnamectl 2>/dev/null|command type -P hostnamectl &>/dev/null|g' \
        -i $out/etc/profile.d/wezterm.sh

      install -Dm644 ${wezterm.terminfo}/share/terminfo/w/wezterm -t $out/share/terminfo/w
    '';
  };

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Sep 9, 2024
Copy link
Member

@winterqt winterqt left a comment

Choose a reason for hiding this comment

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

The overlay you show has never worked; we've never exposed cargoLock in passthru, only cargoDeps. Are you sure you don't mean to use wezterm.cargoDeps (or wezterm.passthru.cargoDeps) in it?

@SuperSandro2000
Copy link
Member Author

Derp 🤦🏼 I found the commit which I dropped by accident while rebasing 4f4c193

Are you sure you don't mean to use wezterm.cargoDeps (or wezterm.passthru.cargoDeps) in it?

In essence I want this but it fails on https://github.com/nixos/nixpkgs/blob/bcbfad30628c60e310e5f7c95436de2f0c05921e/pkgs/build-support/rust/build-rust-package/default.nix#L62-L64

Maybe that should be extended instead?

@SuperSandro2000 SuperSandro2000 changed the title build-rust-package: add passthru.cargoLock back build-rust-package: allow passing in cargoDeps Sep 12, 2024
@SuperSandro2000 SuperSandro2000 changed the title build-rust-package: allow passing in cargoDeps buildRustPackage: allow passing in cargoDeps Sep 12, 2024
This is useful when constructing overlays and trying to copy a
buildRustPackage from a different package
@SuperSandro2000 SuperSandro2000 force-pushed the build-rust-package-cargoLock branch from bcbfad3 to 7243e1b Compare September 12, 2024 10:02
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 10.rebuild-linux: 1-10 10.rebuild-linux: 1 and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Sep 12, 2024
@SuperSandro2000
Copy link
Member Author

@winterqt ping

@TomaSajt
Copy link
Contributor

Probably superseded by #354999

@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Dec 10, 2024
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.

4 participants