Skip to content

Conversation

@erictapen
Copy link
Member

@erictapen erictapen commented Dec 10, 2024

Closes #440

tmp YSrXBRubZ0

The code should be robust for e.g. nixpkgs-darwin-24.11 and nixos-24.11-small to have different revisisions, though I never see any difference between these. Probably just because they evaluation did actually happen on the same commits?

rev = urllib.parse.quote(derivation.parent_evaluation.commit_sha1)
# position is something like `/tmp/tmpfh7ff2xs/pkgs/development/python-modules/qemu/default.nix:67`
position_match = re.match(
r"/tmp/[^/]+/(.+):(\d+)", derivation.metadata.position
Copy link
Contributor

Choose a reason for hiding this comment

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

This won't scale with #451, because where we evaluate is essentially a runtime configuration, but which may change between deployments... :/

@RaitoBezarius maybe we can scrape that out already at evaluation time?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh I understand. Makes the distinction pretty much impossible then, right? I'll add a FIXME for now.

Copy link
Member

Choose a reason for hiding this comment

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

If the eval store is in memory, I don't see why we cannot do that computation, it's just a string clean up?

Copy link
Member Author

Choose a reason for hiding this comment

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

We would need to know the location then. Is the config value accessible in cache_suggestions? Also this would mean that all evaluations get invalidated, once you change the location of the eval store.

Copy link
Contributor

Choose a reason for hiding this comment

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

The config value is accessible but in case of config change will get invalidated. This is why we should do it earlier where we know the value at the time. But also I just realised this is not necessary config store but location of the Nixpkgs checkout, so this can definitely just stripped off during eval-ingestion. We'll leave it at that now because it won't help for the demo.

@erictapen
Copy link
Member Author

tmp lJ8D0cvkKB
Removed the </>, as it takes too much screenspace. The version is the link now.

@fricklerhandwerk fricklerhandwerk merged commit e3194fb into NixOS:main Dec 10, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Link source location from derivation per channel

3 participants