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
imag: init at 0.10.0 #77362
imag: init at 0.10.0 #77362
Conversation
@GrahamcOfBorg build imag |
Cool! I didn't manage to do this, because I do not have a lockfile in the repository. Seems like your PR works though. Awesome! Keep me posted! |
@matthiasbeyer Is it possible to check it in the upstream repository, by any chance? |
Possible yes, but I won't. I won't because imag is in 0.x.y-state, which basically means that it can be used, but should not be considered final/stable/whatever. Adding a Cargo.lock file to the repository would result in that file changed for every other commit, which is just too much noise for me. We could argue, though, that adding a Cargo.lock file for the release branches (so v0.10.x for the latest release right now), could be an option. |
@matthiasbeyer Sure, reasonable. About the failing tests: do you know why? I'm more inclined to fix them than to just skip them. |
The code is here: https://git.imag-pim.org/imag/tree/bin/core/imag-link/src/lib.rs?h=v0.10.x#n525
|
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.
As you know, tests are currently failing, and as a result, derivation doesn't build:
running 6 tests
test tests::test_link_modificates ... ok
test tests::test_linking_links ... ok
test tests::test_linking_links_unlinking_removes_links ... FAILED
test tests::test_multilinking ... ok
test tests::test_linking_more_than_two ... ok
test tests::test_linking_and_unlinking_more_than_two ... FAILED
failures:
---- tests::test_linking_links_unlinking_removes_links stdout ----
thread 'tests::test_linking_links_unlinking_removes_links' panicked at 'assertion failed: `(left == right)`
left: `Array([String("test2")])`,
right: `Array([])`', bin/core/imag-link/src/lib.rs:520:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
---- tests::test_linking_and_unlinking_more_than_two stdout ----
thread 'tests::test_linking_and_unlinking_more_than_two' panicked at 'assertion failed: `(left == right)`
left: `Array([String("test2"), String("test3")])`,
right: `Array([])`', bin/core/imag-link/src/lib.rs:560:9
failures:
tests::test_linking_and_unlinking_more_than_two
tests::test_linking_links_unlinking_removes_links
If those tests are supposed to fail, consider skipping them.
pkgs/top-level/all-packages.nix
Outdated
@@ -19560,6 +19560,10 @@ in | |||
|
|||
iksemel = callPackage ../development/libraries/iksemel { }; | |||
|
|||
imag = callPackage ../applications/office/imag { |
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.
Nitpick: most CLI todo and contact list managers I know of are in applications/misc
. Maybe this does belong to applications/office
better, I'm not sure.
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'm not sure either. It would certainly fit both, because its scope is PIM in general... I tend to prefer applications/misc
though, as a "diary" for example is certainly not "office" 😄
@@ -0,0 +1,37 @@ | |||
{ stdenv | |||
, lib |
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.
Nitpick: stdenv.lib
is also available :)
}; | ||
|
||
buildInputs = [ openssl pkg-config ] | ||
++ lib.optional stdenv.isDarwin Security; |
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.
++ lib.optional stdenv.isDarwin Security; | |
++ lib.optional stdenv.isDarwin Security; |
sha256 = "1rkl4n3x2dk9x7705zsqjlxh92w7k6jkc27zqf18pwfl3fzz8f8p"; | ||
}; | ||
|
||
buildInputs = [ openssl pkg-config ] |
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.
pkg-config
is a build-time dependency:
- buildInputs = [ openssl pkg-config ]
+ nativeBuildInputs = [ pkg-config ];
+ buildInputs = [ openssl ]
|
||
LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; | ||
|
||
cargoPatches = [ ./cargo-lock.patch ]; |
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.
@matthiasbeyer I understand the noise concern, and yet, consider:
- https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
- https://doc.rust-lang.org/cargo/faq.html#why-do-binaries-have-cargolock-in-version-control-but-not-libraries
If you’re building an end product, which are executable like command-line tool or an application, or a system library with crate-type of
staticlib
orcdylib
, check Cargo.lock intogit
.
Currently, because lock file is not checked in, it's impossible to replicate the exact set of dependencies that you're developing imag
with.
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 mean me, not Matthew. Yes, I consider checking it in for the next release in the release branch (not in the master branch though).
A patch release is pending (not sure though when I want to release it), I could add the Cargo.lock to the patchset release!
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.
So sorry for the typo!
FWIW, tests do not fail on imag CI, so this seems to be nix-related. |
f88df7e
to
dfadb68
Compare
Thanks a lot @yegortimoshenko! |
dfadb68
to
15b784f
Compare
|
||
checkPhase = '' | ||
cargo test -- \ | ||
--skip test_linking |
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.
Would be nice to add a comment here, why this is skipped.
As said, in my CI this succeeds, so one might be curious why it is ignored here.
Feel free to fast-forward merge matthiasbeyer@7532418 |
The CI fails with a sha256 error. |
OfBorg-Log:
I suspect this is related to the missing |
So I was trying my hand on packaging imag 0.10.1, which simplifies things since the Because the build is started from the nix daemon, it does not have a controlling tty, and it is a design choice in imag tools to treat stdin as a list of arguments if any, else use the provided command line arguments. Because imag uses the For example, the imag-init --path $TMP_RTP
imag-create --rtp $TMP_RTP something but Possible solutions off the top of my head:
Here is my derivation file for reference: N.B.: Thank god |
From a packaging standpoint I'd say that disabling the ui tests are the best solution here. These are meant to test consistency across imag tools in their UI. If failing UI tests are included in a release, I as a developer did something wrong, not the packaging people. So I guess disabling them would be the least pain in nixpkgs and also the most sensible thing to do. |
Well, I guess I went through that pain anyway :D I found a why to create a fake TTY thanks to this SO answer. Adding Now that we have that, I'm not sure we should disable tests, IMHO. I think that if an update with failing ui tests were to happen, we should deal with it then, but I'm definitely up for discussions about that. |
Everything Working is of course always better! Props to you for get it to work! 👍 |
@filalex77 do you mind me opening another PR with imag 0.10.1? With the test fix, and the installation of completion scripts. |
@minijackson Of course, please go ahead! I would appreciate it if you add me as a maintainer ( |
Motivation for this change
https://imag-pim.org/blog/2019/12/24/imag-0-10-0/
https://github.com/matthiasbeyer/imag/releases/tag/v0.10.0
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)This change is