Closed hatch01 closed 3 months ago
@hatch01 Thanks for the update. However it doesn't seem to work for me in nix docker:
❯ docker pull nixos/nix
Using default tag: latest
latest: Pulling from nixos/nix
Digest: sha256:a53abaf5242b3e94ad0adce074c386d62eeeb73ec8571ffa28b1ba3f0b2576c9
Status: Image is up to date for nixos/nix:latest
docker.io/nixos/nix:latest
❯ docker run --rm -it nixos/nix
bash-5.2# nix-shell -p clang-uml
error:
… while calling the 'derivationStrict' builtin
at <nix/derivation-internal.nix>:9:12:
8|
9| strict = derivationStrict drvAttrs;
| ^
10|
… while evaluating derivation 'shell'
whose name attribute is located at /nix/store/wj83y3qvj8v29d5zz0fih03682jf6qr1-b9zng82injl4hg2cywz0ql8s9jiylnw0-source/pkgs/stdenv/generic/make-derivation.nix:348:7
… while evaluating attribute 'buildInputs' of derivation 'shell'
at /nix/store/wj83y3qvj8v29d5zz0fih03682jf6qr1-b9zng82injl4hg2cywz0ql8s9jiylnw0-source/pkgs/stdenv/generic/make-derivation.nix:395:7:
394| depsHostHost = elemAt (elemAt dependencies 1) 0;
395| buildInputs = elemAt (elemAt dependencies 1) 1;
| ^
396| depsTargetTarget = elemAt (elemAt dependencies 2) 0;
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: undefined variable 'clang-uml'
at «string»:1:107:
1| {...}@args: with import <nixpkgs> args; (pkgs.runCommandCC or pkgs.runCommand) "shell" { buildInputs = [ (clang-uml) ]; } ""
|
Also, is it possible to control which version is installed? Is it always latest tag or latest commit from master
?
Oh, my bad it has been merged into master but clang-UML is not yet propagated to all the nixpkgs versions. https://github.com/NixOS/nixpkgs/pull/304749 https://nixpk.gs/pr-tracker.html?pr=304749 You are right, we may need to wait until it come to the stable version of nixpkgs.
No problem. Anyway, I have a question - when I release a new version, do I need to do something,e.g. register it nixpgs somehow manually or is it somehow automated?
We need to register the update manually. However, as I am the maintainer of nixpkgs, I will get a notification when you make a new release to ask me to update. However, you can also make a PR on nixpkgs to update the package by yourself.
@hatch01 Ok great thanks. Could you also just add a comment in the installation.md which version nix-shell -p clang-uml
installs, or at least that it may not yet be the latest version (I'll keep it updated manually)...
Yes, but it can depend on which version of nixpkgs the user is using. The best way to know that is just to look at search.nixos.org (which any nix user now)
Ok.
clang-uml is now available in nixos-unstable
@hatch01 I can see it online in the package registry, but the command still doesn't work:
❯ docker run --rm -it nixos/nix
bash-5.2# nix-channel --list
nixpkgs https://nixos.org/channels/nixpkgs-unstable
bash-5.2# nix-shell -p clang-uml
error:
… while calling the 'derivationStrict' builtin
at <nix/derivation-internal.nix>:9:12:
8|
9| strict = derivationStrict drvAttrs;
| ^
10|
… while evaluating derivation 'shell'
whose name attribute is located at /nix/store/wj83y3qvj8v29d5zz0fih03682jf6qr1-b9zng82injl4hg2cywz0ql8s9jiylnw0-source/pkgs/stdenv/generic/make-derivation.nix:348:7
… while evaluating attribute 'buildInputs' of derivation 'shell'
at /nix/store/wj83y3qvj8v29d5zz0fih03682jf6qr1-b9zng82injl4hg2cywz0ql8s9jiylnw0-source/pkgs/stdenv/generic/make-derivation.nix:395:7:
394| depsHostHost = elemAt (elemAt dependencies 1) 0;
395| buildInputs = elemAt (elemAt dependencies 1) 1;
| ^
396| depsTargetTarget = elemAt (elemAt dependencies 2) 0;
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: undefined variable 'clang-uml'
at «string»:1:107:
1| {...}@args: with import <nixpkgs> args; (pkgs.runCommandCC or pkgs.runCommand) "shell" { buildInputs = [ (clang-uml) ]; } ""
|
Also, I've noticed that on this page it shows that the package provides 2 binaries:
clang-uml
clang-uml-unwrapped
While in the last PR for this we've added a clang-uml-wrapped
command: https://github.com/bkryza/clang-uml/blob/6a1322b04c5b12d29a7b1bc2736159313f65bd2f/packaging/nix/default.nix#L36
Is that correct?
You probably can't access clang-uml because you need to switch to unstable : https://nixos.org/manual/nixos/unstable/#sec-upgrading And yes I choosed to set the wrapped as the default because it seems to work well and most of the packages in nixpkgs work like this. And if there's problems, the unwrapped is still available.
@hatch01
You probably can't access clang-uml because you need to switch to unstable : https://nixos.org/manual/nixos/unstable/#sec-upgrading
Can you give list of steps I need to do to see that it works? I tried:
bash-5.2# nix-channel --add https://channels.nixos.org/nixos-unstable nixos
bash-5.2# nix-shell -p clang-uml
error:
… while calling the 'derivationStrict' builtin
at <nix/derivation-internal.nix>:9:12:
8|
9| strict = derivationStrict drvAttrs;
| ^
10|
… while evaluating derivation 'shell'
whose name attribute is located at /nix/store/wj83y3qvj8v29d5zz0fih03682jf6qr1-b9zng82injl4hg2cywz0ql8s9jiylnw0-source/pkgs/stdenv/generic/make-derivation.nix:348:7
… while evaluating attribute 'buildInputs' of derivation 'shell'
at /nix/store/wj83y3qvj8v29d5zz0fih03682jf6qr1-b9zng82injl4hg2cywz0ql8s9jiylnw0-source/pkgs/stdenv/generic/make-derivation.nix:395:7:
394| depsHostHost = elemAt (elemAt dependencies 1) 0;
395| buildInputs = elemAt (elemAt dependencies 1) 1;
| ^
396| depsTargetTarget = elemAt (elemAt dependencies 2) 0;
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: undefined variable 'clang-uml'
at «string»:1:107:
1| {...}@args: with import <nixpkgs> args; (pkgs.runCommandCC or pkgs.runCommand) "shell" { buildInputs = [ (clang-uml) ]; } ""
| ^
bash-5.2# nix-channel --list
nixos https://channels.nixos.org/nixos-unstable
nixpkgs https://nixos.org/channels/nixpkgs-unstable
and still the same error.
And yes I choosed to set the wrapped as the default because it seems to work well and most of the packages in nixpkgs work like this.
But where is that logic now? If this has changed can you also please update:
Can you give list of steps I need to do to see that it works? I tried:
podman run -it nixos/nix nix-channel --add https://channels.nixos.org/nixos-unstable nixos nix-channel --update nix-shell -p clang-uml
But where is that logic now? If this has changed can you also please update: Yes, you are right it make much more sense to update in the repo.
@hatch01 Ok thanks, I was missing nix-channel --update
:-)
Just a small doc modification to indicate that now clang-UML is available in nixpkgs, so users don't really need to build it themselves unless they want a specific version directly from a git branch.