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

attic-client: init at unstable-2024-02-08 #274481

Merged
merged 1 commit into from
Mar 26, 2024
Merged

attic-client: init at unstable-2024-02-08 #274481

merged 1 commit into from
Mar 26, 2024

Conversation

aciceri
Copy link
Member

@aciceri aciceri commented Dec 15, 2023

Description of changes

This adds a derivation for https://github.com/zhaofengli/attic that produces the following binaries:

  • attic
  • atticdm
  • atticd

Things done

Not tested yet (only attic --version).

meta.mainProgram is set to attic (the client) since it's probably what most people expect to find building attic.
To be honest this is the first time I package something in Rust that produces multiple binaries and I don't know if it makes more sense keeping all the them in the same derivation or splitting it.
If there are systems where one of the binaries doesn't build/work it could make sense.

  • 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.05 Release Notes (or backporting 23.05 and 23.11 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.

@zhaofengli I hope you will appreciate this PR. Are you interested into being a nixpkgs maintainer for this?

@aciceri aciceri force-pushed the attic branch 2 times, most recently from 8b285de to 4476185 Compare December 15, 2023 15:17
@zhaofengli
Copy link
Member

Hi, thanks for the PR! I do wish that this is hold off before the first stable release where there could be some breaking changes. I've been putting this off for a while but hopefully I'll have more time this holiday season.

@aciceri
Copy link
Member Author

aciceri commented Dec 15, 2023

Hi, thank you for the useful application!
Anyway the reason why we want it in nipxkgs is this PR where we don't want to add attic as flake input.
But if it's a just a matter of waiting this holiday season then no problem, if it will take months instead I would prefer that this was merged as it is. I promise I will help (as far as I can with Rust) with another PR when the stable version will be released.

@aciceri
Copy link
Member Author

aciceri commented Jan 7, 2024

@zhaofengli are there news on this?

@niklaskorz
Copy link
Contributor

Hi, thanks for the PR! I do wish that this is hold off before the first stable release where there could be some breaking changes. I've been putting this off for a while but hopefully I'll have more time this holiday season.

In my opinion that is not a blocker, the package is marked as unstable so it's already explicit there will be breaking changes.

@aciceri
Copy link
Member Author

aciceri commented Jan 29, 2024

If you agree I can update the package to the latest version and make it ready for reviews.

@Hayajiro
Copy link
Contributor

Hayajiro commented Mar 11, 2024

I'd love to see this packaged, as I'd want to push stuff to our cache using GitHub Actions, but the current way of blindly pulling a specific derivation and using that doesn't feel right, at all. Even adding attic as a flake input (and trusting the "staging" Attic Instance as a substituter) results in us having to build attic-client ourselves.

Given that it's explicitly marked as unstable, I also don't really see a reason to further delay packaging. On the contrary, it'd make using attic just so much easier.

In case we really want to delay this further, I'll probably need to push this to my own cache and then fetch binaries from there... Not ideal, but the only alternative.

@aciceri
Copy link
Member Author

aciceri commented Mar 12, 2024

Ok I updated it and chose that it's ok keeping all the binaries in the same derivation (feel free to criticize this choice).
I'm marking it as ready for review.

@aciceri
Copy link
Member Author

aciceri commented Mar 12, 2024

Apparently this

lockFile = "${src}/Cargo.lock";

was causing an IFD to occur (probably the lockfile is parsed by nix at eval time?) and both nixpkgs-rev and the CI were failing. Now I copied the lockfile to the PR's branch and did this

lockFile = ./Cargo.lock;

The nixpkgs manual suggests it (and I found many other packages doing the same).

I also tried adding passthru.updateScript = nix-update-script { }; and manually running it but probably it expects that the upstream GitHub repository has releases or tags, so since it failed I haven't added it.

~/projects/aciceri/nixpkgs:attic? λ nix run n#nixpkgs-review -- pr 274481
$ git -c fetch.prune=false fetch --no-tags --force https://github.com/NixOS/nixpkgs master:refs/nixpkgs-review/0 pull/274481/head:refs/nixpkgs-review/1
$ git worktree add /home/ccr/.cache/nixpkgs-review/pr-274481-3/nixpkgs 3f86dedcc507143018a900cee727dc64e15df30d
Preparing worktree (detached HEAD 3f86dedcc507)
Updating files: 100% (40430/40430), done.
HEAD is now at 3f86dedcc507 Merge pull request #295182 from r-ryantm/auto-update/earthly
$ nix-env --extra-experimental-features no-url-literals --option system x86_64-linux -f <nixpkgs> --nix-path nixpkgs=/home/ccr/.cache/nixpkgs-review/pr-274481-3/nixpkgs nixpkgs-overlays=/tmp/tmpfpsdvutc -qaP --xml --out-path --show-trace --no-allow-import-from-derivation
$ git merge --no-commit --no-ff 71fac07422fdfe21aa6567680e9e0cfdf13790d2
Automatic merge went well; stopped before committing as requested
$ nix-env --extra-experimental-features no-url-literals --option system x86_64-linux -f <nixpkgs> --nix-path nixpkgs=/home/ccr/.cache/nixpkgs-review/pr-274481-3/nixpkgs nixpkgs-overlays=/tmp/tmpfpsdvutc -qaP --xml --out-path --show-trace --no-allow-import-from-derivation --meta
1 package added:
attic (init at 2024-2-8)

$ nix build --nix-path nixpkgs=/home/ccr/.cache/nixpkgs-review/pr-274481-3/nixpkgs nixpkgs-overlays=/tmp/tmpfpsdvutc --extra-experimental-features nix-command no-url-literals --no-link --keep-going --no-allow-import-from-derivation --option build-use-sandbox relaxed -f /home/ccr/.cache/nixpkgs-review/pr-274481-3/build.nix

Link to currently reviewing PR:
https://github.com/NixOS/nixpkgs/pull/274481

1 package built:
attic

$ /nix/store/6r0bm8shswm9v08kzvq24ib48mx3kxmn-nix-2.18.1/bin/nix-shell /home/ccr/.cache/nixpkgs-review/pr-274481-3/shell.nix --nix-path nixpkgs=/home/ccr/.cache/nixpkgs-review/pr-274481-3/nixpkgs nixpkgs-overlays=/tmp/tmpfpsdvutc

@aciceri aciceri marked this pull request as ready for review March 12, 2024 14:44
@aciceri aciceri changed the title attic: init at unstable-2023-10-25 attic: init at unstable-2024-2-8 Mar 12, 2024
@Hayajiro
Copy link
Contributor

@aciceri I think it would be good to package the tools separately. You can find the individual Cargo.toml files for the respective CLI tools in the folders, for example "client" for attic and "server" for atticd. Maybe you can also have a look at the [package.nix inside the attic repo](https://github.com/zhaofengli/attic/blob/main/package.nix

If you want, I can have a look at splitting up the packages, as well. But that'll probably take at least until the weekend.

@aciceri aciceri force-pushed the attic branch 2 times, most recently from e49d857 to 55e9011 Compare March 13, 2024 10:24
@aciceri
Copy link
Member Author

aciceri commented Mar 13, 2024

@Hayajiro I believe I haven't checked the most obvious place (upstream package.nix) before opening this PR, thanks!
So now it should support darwin and I splitted it into two derivations (atticd and atticadm are together since they are the same crate), I hope that overriding attic-client as I did is a viable approach with the new by-name nixpkgs structure, I took a look at the manual and at the RFC but I didn't find anything about what to do in these cases.

Also I updated version to 0.1.0 as in the upstream derivation, even though there are no releases or tags in the upstream repository, so I'm still using a commit hash as fetchFromGitHub's rev.

@zhaofengli let me know if you want to be added between nixpkgs maintainers please.

~/projects/aciceri/nixpkgs:attic λ nix run n#nixpkgs-review -- pr 274481
$ git -c fetch.prune=false fetch --no-tags --force https://github.com/NixOS/nixpkgs master:refs/nixpkgs-review/0 pull/274481/head:refs/nixpkgs-review/1
remote: Enumerating objects: 2602, done.
remote: Counting objects: 100% (1927/1927), done.
remote: Compressing objects: 100% (218/218), done.
remote: Total 2602 (delta 1794), reused 1794 (delta 1700), pack-reused 675
Receiving objects: 100% (2602/2602), 1.68 MiB | 2.87 MiB/s, done.
Resolving deltas: 100% (1867/1867), completed with 509 local objects.
From ssh://github.com/NixOS/nixpkgs
   3f86dedcc507..e03bb0684816  master                -> refs/nixpkgs-review/0
 + 71fac07422fd...55e901105312 refs/pull/274481/head -> refs/nixpkgs-review/1  (forced update)
$ git worktree add /home/ccr/.cache/nixpkgs-review/pr-274481-4/nixpkgs e03bb0684816e4cf695cde15c8ce8cec8b10b571
Preparing worktree (detached HEAD e03bb0684816)
Updating files: 100% (40435/40435), done.
HEAD is now at e03bb0684816 Merge pull request #295537 from patka-123/pest_2.34.2
$ nix-env --extra-experimental-features no-url-literals --option system x86_64-linux -f <nixpkgs> --nix-path nixpkgs=/home/ccr/.cache/nixpkgs-review/pr-274481-4/nixpkgs nixpkgs-overlays=/tmp/tmp9wgwoatz -qaP --xml --out-path --show-trace --no-allow-import-from-derivation
$ git merge --no-commit --no-ff 55e9011053120da8f79de07748674b7c8b6999a9
Automatic merge went well; stopped before committing as requested
$ nix-env --extra-experimental-features no-url-literals --option system x86_64-linux -f <nixpkgs> --nix-path nixpkgs=/home/ccr/.cache/nixpkgs-review/pr-274481-4/nixpkgs nixpkgs-overlays=/tmp/tmp9wgwoatz -qaP --xml --out-path --show-trace --no-allow-import-from-derivation --meta
2 packages added:
attic-client (init at 0.1.0) attic-server (init at 0.1.0)

$ nix build --nix-path nixpkgs=/home/ccr/.cache/nixpkgs-review/pr-274481-4/nixpkgs nixpkgs-overlays=/tmp/tmp9wgwoatz --extra-experimental-features nix-command no-url-literals --no-link --keep-going --no-allow-import-from-derivation --option build-use-sandbox relaxed -f /home/ccr/.cache/nixpkgs-review/pr-274481-4/build.nix

Link to currently reviewing PR:
https://github.com/NixOS/nixpkgs/pull/274481

2 packages built:
attic-client attic-server

$ /nix/store/6r0bm8shswm9v08kzvq24ib48mx3kxmn-nix-2.18.1/bin/nix-shell /home/ccr/.cache/nixpkgs-review/pr-274481-4/shell.nix --nix-path nixpkgs=/home/ccr/.cache/nixpkgs-review/pr-274481-4/nixpkgs nixpkgs-overlays=/tmp/tmp9wgwoatz

@zhaofengli
Copy link
Member

Please add me to the maintainer list, thanks!

Copy link
Contributor

@Hayajiro Hayajiro left a comment

Choose a reason for hiding this comment

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

Changes LGTM so far. Will test the build output in a day or two (once I have the time to spare). That is, unless someone beats me to it.

@ofborg ofborg bot requested a review from zhaofengli March 13, 2024 21:51
@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Mar 20, 2024
Copy link
Contributor

@CutestNekoAqua CutestNekoAqua left a comment

Choose a reason for hiding this comment

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

proud to say: just tested the client. works flawlessly

@wegank wegank added 12.approvals: 2 This PR was reviewed and approved by two reputable people and removed 12.approvals: 1 This PR was reviewed and approved by one reputable person labels Mar 24, 2024
@drupol drupol changed the title attic: init at unstable-2024-2-8 attic-client: init at unstable-2024-2-8 Mar 26, 2024
@drupol drupol changed the title attic-client: init at unstable-2024-2-8 attic-client: init at unstable-2024-02-08 Mar 26, 2024
@drupol
Copy link
Contributor

drupol commented Mar 26, 2024

@ofborg build attic-client attic-server

@drupol drupol merged commit e31edbb into NixOS:master Mar 26, 2024
28 of 29 checks passed
@anthonyroussel
Copy link
Member

anthonyroussel commented Mar 26, 2024

Hello!
Unfortunately, looks like the ofborg evaluation is failing on my PR (ofborg-eval check) because of an error on the attic-client package:

       error: attribute 'cxxabi' missing

       at /ofborg/checkout/1/repo/38dca4e3aa6bca43ea96d2fcc04e8229/mr-est/ofborg-evaluator-4/pkgs/by-name/at/attic-client/package.nix:47:24:

           46|   env = lib.optionalAttrs stdenv.cc.isClang {
           47|     NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}";
             |                        ^
           48|   };

https://gist.github.com/GrahamcOfBorg/71643bc5b784eb2a999dd94c7e2209fc

Do you have an idea why?

@misuzu
Copy link
Contributor

misuzu commented Apr 20, 2024

attic-server isn't being built by hydra for aarch64-linux for some reason: https://hydra.nixos.org/eval/1805789?filter=attic-server&compare=1805780&full=
attic-client is fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes 12.approvals: 2 This PR was reviewed and approved by two reputable people
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants