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
itm-tools: init at 2019-11-15 #91552
Conversation
@@ -0,0 +1,28 @@ | |||
{ stdenv, fetchFromGitHub, rustPlatform, pkgconfig }: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
} | ||
|
||
-fn open_read(matches: &ArgMatches) -> Result<Box<io::Read + 'static>, io::Error> { | ||
+fn open_read(matches: &ArgMatches) -> Result<Box<dyn io::Read + 'static>, io::Error> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still do not understand why cargo install itm
inside nix-shell -p cargo
on nixos 20.03.2310.fb6c3a6831c completes successfully without this patch.
b085056
to
9a781ec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your first contribution 👍 and sorry for having to wait so long for a review. I have added an initial set of comments.
version = "0.3.1"; | ||
pname = "itm"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Swap order (since it's more canonical).
version = "0.3.1"; | |
pname = "itm"; | |
pname = "itm"; | |
version = "0.3.1"; |
|
||
src = fetchFromGitHub { | ||
owner = "rust-embedded"; | ||
repo = "itm"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repo = "itm"; | |
repo = pname; |
description = "Tool to parse and dump ITM packets"; | ||
homepage = "https://github.com/rust-embedded/itm"; | ||
license = with licenses; [ asl20 mit ]; | ||
maintainers = with maintainers; [ hh sb0 ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sbourdeauducq do you want to be a maintainer?
owner = "rust-embedded"; | ||
repo = "itm"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that itmdump
was removed from that repository and has moved to:
https://github.com/japaric/itm-tools
So this derivation should probably use that instead (there are no releases yet, so the version could be date-based). The attribute name and derivation directory could then be renamed to itm-tools
.
Thank you for the feedback! I found a reference regarding such migration over here: rust-embedded/itm#24 (comment) Other than renaming my package and the title of this pull request, can I keep my forked branch name as-is or must I rename the branch as well? Edit: While |
I think contacting them is the best recourse. Upstream authors are often willing to tag a release to make downstream packaging easier. |
9a781ec
to
9ea9c7c
Compare
Just force pushed my branch to use the master HEAD of japaric/itm-tools instead. I didn't rename this branch, should it be fine? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, missed one minor issue. We mark date versions using unstable
.
|
||
rustPlatform.buildRustPackage rec { | ||
pname = "itm-tools"; | ||
version = "2019-11-15"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version = "2019-11-15"; | |
version = "unstable-2019-11-15"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in f437a1886583328c23bee9cd0f9b654378b4e07d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to change the hash as well:
hash mismatch in fixed-output derivation '/nix/store/45ikydicdgyi3d3w6zk26mj6p3dpi9bk-itm-tools-unstable-2019-11-15-vendor.tar.gz':
wanted: sha256:1i2zfn8pk7v2cbws9iallc283pmfn3bqdqvp6cqj19hvkrxxs9p2
got: sha256:0rl2ph5igwjl7rwpwcf6afnxly5av7cd6va6wn82lxm606giyq75
BTW. if you keep the allow edits from maintainers option enabled, we do such minor fixes ourselves ;).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks... but I can't find the option (checkbox) for allowing edits from maintainers now. Not sure how.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9ea9c7c
to
f437a18
Compare
f437a18
to
e803a0c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/how-exactly-is-cargosha256-computed/10727/1 |
Motivation for this change
Update: As per discussion on rust-embedded/itm#24 (comment), the recommended itm-tools will be provided by this proposed Nix package instead. It will install the following binaries for the user:
port-demux
: ITM Port Demuxing, which share similar functions asitmdump
excevt
: Exception Tracingpcsampl
: Program Counter SamplingThis tool is available as a binary on crates.io (link here), but its source code and Cargo.lock need to be patched in order to be compiled with Rust >=1.41.0 (corresponding to nixpkgs 20.03).Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)