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

sd: init at 0.5.0 #60241

Merged
merged 1 commit into from Apr 27, 2019
Merged

sd: init at 0.5.0 #60241

merged 1 commit into from Apr 27, 2019

Conversation

Amar1729
Copy link
Contributor

@Amar1729 Amar1729 commented Apr 26, 2019

Motivation for this change
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 nix-review --run "nix-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)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Note on the relevant documentation -
sd doesn't seem to build man pages yet

pkgs/tools/text/sd/default.nix Outdated Show resolved Hide resolved
pkgs/tools/text/sd/default.nix Outdated Show resolved Hide resolved
sha256 = "1y44qizciir75d1srwm1mlskhflab2b6153d19vblw410in82f5d";
};

cargoSha256 = "1gls68lw8a2c3gsav70l2wasrgav68q5w1nf50jsrbqq9kb4i7nb";
Copy link
Member

Choose a reason for hiding this comment

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

I get 0lg8lm4rv9ai61621l6pm19hnj7xzbiaj9v46ihfij1bw7ii54v4 instead.

Copy link
Contributor Author

@Amar1729 Amar1729 Apr 26, 2019

Choose a reason for hiding this comment

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

is 0lg8lm4rv9ai61621l6pm19hnj7xzbiaj9v46ihfij1bw7ii54v4 kernel-specific or something? I'm currently building this on darwin, and changing either the sha256 or the cargoSha256 to 01g... results in a sha mismatch and failed build.
If this is supposed to be the cargoSha256, is there a way I can check this via command line (like with nix-prefetch-github)?

Copy link
Member

Choose a reason for hiding this comment

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

Does it build for you now?

Yeah, I'm talking about cargoSha256.
I don't know what the reason could be, I'm building on NixOS.
I don't think there's a command to check the hash.

@Mic92 Do you know what cargoSha256 depends on? Can we build the same Rust derivations on Linux and MacOS?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it builds for me. ./result/bin/sd works fine too. I assume it fails on NixOS?
I can keep this open and test on a linux machine this weekend.

Copy link
Member

Choose a reason for hiding this comment

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

Your new comit works, but only with my hash.
We could use if stdenv.isDarwin then "yourHash" else "myHash" as a workaround.
But we should ask someone who knows about the nixpkgs rust infrastructure whether that's normal.

Copy link
Contributor

@danieldk danieldk Apr 26, 2019

Choose a reason for hiding this comment

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

This definitely shouldn't happen. The hash is computed from the crate name, version, features, and the (transitive) dependencies:

metadata = builtins.substring 0 10 (builtins.hashString "sha256" (crateName + "-" + crateVersion + "___" + toString crateFeatures + "___" + depsMetadata ));

Cargo.lock should fix all dependencies. I think it is more useful to find the source of this difference.

Copy link
Contributor

Choose a reason for hiding this comment

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

BTW, builds fine on my NixOS machine with the cargoSha256 in the PR (1gls68lw8a2c3gsav70l2wasrgav68q5w1nf50jsrbqq9kb4i7nb).

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, yeah it does work now. I wonder what I had changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, double-checked on darwin and (arch) linux, both work fine.

pkgs/tools/text/sd/default.nix Outdated Show resolved Hide resolved
@worldofpeace
Copy link
Contributor

@Amar1729 your commit msg should be formatted like

sd: init at 0.5.0

https://github.com/NixOS/nixpkgs/blob/master/.github/CONTRIBUTING.md#submitting-changes
(pkg-name): init at version

@jtojnar
Copy link
Contributor

jtojnar commented Apr 26, 2019

@GrahamcOfBorg build sd

@Amar1729 Amar1729 force-pushed the init/sd branch 2 times, most recently from 26da70f to 2df2038 Compare April 26, 2019 21:58
Copy link
Contributor

@srhb srhb left a comment

Choose a reason for hiding this comment

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

Looks good, but I think you got the commit message mixed up. It should be: sd: init at 0.5.0 :-)

@Amar1729
Copy link
Contributor Author

welp that's embarrassing :/

@Amar1729 Amar1729 changed the title init: sd at 0.5.0 sd: init at 0.5.0 Apr 26, 2019
@srhb srhb merged commit f96bf5b into NixOS:master Apr 27, 2019
@Amar1729 Amar1729 deleted the init/sd branch April 27, 2019 06:36
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

6 participants