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

High level vs low level Source Accessor interface #12463

Open
2 tasks
roberth opened this issue Feb 12, 2025 · 0 comments
Open
2 tasks

High level vs low level Source Accessor interface #12463

roberth opened this issue Feb 12, 2025 · 0 comments
Labels
bug fetching Networking with the outside (non-Nix) world, input locking

Comments

@roberth
Copy link
Member

roberth commented Feb 12, 2025

Is your feature request related to a problem?

It's too easy to use the wrong interface.

In a few very important cases, we don't want POSIX symlink semantics, e.g. NAR processing, but in many other cases we do.

Whether we do or don't is always very important. Yet, it's too easy to get it wrong.

Proposed solution A

Prefix the low level / NAR level / physical level / current methods with ll for "low level" or "link-less"
Add high-level POSIX-like helper functions which implement the expected symlink semantics for each of those methods.

This is a simple solution, but makes code like NAR processing somewhat harder to write, because you have to pay attention to always use ll methods.

Proposed solution B

Use distinct classes. Make the high-level one wrap and hide the low level one. Have conversion methods.

This requires slightly more code, but doesn't treat one use case preferentially, which is a favorable trade-off.

Additional context

We've had multiple symlink related bugs.

Checklist


Add 👍 to issues you find important.

@roberth roberth added bug fetching Networking with the outside (non-Nix) world, input locking labels Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fetching Networking with the outside (non-Nix) world, input locking
Projects
None yet
Development

No branches or pull requests

1 participant