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

Inaccurate statement regarding FOD's #9

Open
tejing1 opened this issue Aug 21, 2022 · 6 comments
Open

Inaccurate statement regarding FOD's #9

tejing1 opened this issue Aug 21, 2022 · 6 comments

Comments

@tejing1
Copy link

tejing1 commented Aug 21, 2022

This:

These are the "leaves" of any build closure, in that, they do not refer to other
derivations. These derivations are defined by

isn't actually true. pkgs.fetchurl {...} refers to pkgs.curl, for example.

@jonringer
Copy link
Collaborator

it is true for builtins.fetch*.

Although nixpkgs has it's own variants of fetchers, I think the intuition is still correct. The derivation may have references to other derivations for realization, but once realized, the output will never have any dependencies.

I guess the confusion would be build vs "runtime" dependencies. FODs should never have any runtime dependencies, they are just content.

What would be a better way to word this?

@tejing1
Copy link
Author

tejing1 commented Aug 21, 2022

it is true for builtins.fetch*.

Strictly speaking, those aren't FODs, since afaik they don't involve a .drv file at all, but I definitely get the intuition behind this.

Although nixpkgs has it's own variants of fetchers, I think the intuition is still correct. The derivation may have references to other derivations for realization, but once realized, the output will never have any dependencies.

I guess the confusion would be build vs "runtime" dependencies. FODs should never have any runtime dependencies, they are just content.

It's true they are leaves of the runtime dependency graph (though in practice they're seldom in it at all), but in context, I don't see how it could be interpreted that way. The whole discussion is about the build closure.

What would be a better way to word this?

Maybe just move to the subject of intent rather than implementation, and say that FODs are the starting points from which you build software?

@jonringer
Copy link
Collaborator

Maybe just move to the subject of intent rather than implementation, and say that FODs are the starting points from which you build software?

Fair enough

@jonringer
Copy link
Collaborator

jonringer commented Aug 21, 2022

It's true they are leaves of the runtime dependency graph (though in practice they're seldom in it at all)

Yea, poor word choice on my part. I meant they get pruned after they get realized. So when they are consumed for a build, it's "just" the content.

@tejing1
Copy link
Author

tejing1 commented Aug 21, 2022

I meant they get pruned after they get realized.

It took me a few goes at this before I caught precisely what you mean. You're viewing the build closure as a dynamic object, which is pruned as derivations are realized, until it eventually becomes the runtime closure? In that context, FODs have the fairly uncommon property that upon realization all their children disappear.

I never particularly considered the dynamic picture, and only looked at the initial build closure and the final runtime closure as static objects.

@jonringer
Copy link
Collaborator

In that context, FODs have the fairly uncommon property that upon realization all their children disappear.

Yea, technically you could try multiple fetchers, one using git, one using http, another using some other protocol. And as long as they can all produce the same content, it's not relevant for the consuming derivation to know which one was used. Just that the content is available.

The build dependencies are an "implementation" detail. Or at least with how I view FODs. Maybe I'm wrong :)

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

No branches or pull requests

2 participants