Skip to content

path:/abs cuts out parent, while path:./rel does not #16214

Description

@roberth

Describe the bug

A flake input that is path:/some/absolute/path treats path as the root of an otherwise disconnected file hierarchy, e.g. by copying it to the store, or as a SourceAccessor.

A flake input that is path:./relative does not. It is just a reference to a flake.nix that does not affect the flake's sourceInfo.outPath and does not forbid relative/flake.nix to access files in relative/...

Steps To Reproduce

Expected behavior

All path: inputs behave the same. Either all cut out the parent, or all allow access to the parent.
Both options are feasible.

Option A: Cut away from the parent

  • Deprecate path:./relative inputs.
  • Wait
  • Start isolating their file access

May postpone stabilization

Option B: YOLO absolute paths

If users use absolute paths, they're already in some pretty hard to reproduce territory.
Maybe it isn't all that wrong to allow access to the file system.
Does not even defeat caching if you have a tracing cache, but it is entirely unhermetic.

Compatible with earlier stabilization

Option C: Keep the quirk

Users and Nix maintainers will have to live with the extended learning curve and burden.

Compatible with earlier stabilization

Metadata

Additional context

  • Discovered through STF project

Checklist


Add 👍 to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions