#fs
1 messages ยท Page 1 of 1 (latest)
i flagged that in self-review, but i thought we wanted to keep it, are you reconsidering the 'host api updates env' approach?
well I don't know how to plug it into your thing. I worry if I hold on too tight to my idea not knowing how it fits in, the result is an inconsistent frankenstein
The hangup remains: a session has multiple "context directories" and I don't have a clean mental model for them
should we just rename it to fs?
or workdir? or cwd?
workspace?
dir? directory? ๐
actually i think we have workdir somewhere already, so that might gel
I guess my issue is: which existing contextual directory does it reference? or does it create yet another one?
At the moment we have:
- The host filesystem (when in a module: runtime container file system)
- The current module's git repo (only when in a module)
- The current module's source code (only when in a module)
i'd say it's closest to 2, because that's what all contextual path args descend from right? like something with defaultPath="/" would be satisfied by the entire Env.hostfs, and something with defaultPath="./foo" should be satisfied relative to the module's source path within that directory. but I don't think that second part works yet
(good that we're bikeshedding)
yeah I agree which is why "hostfs" in that context is wrong, and not what I had in mind for that name
but at the same time what do we do about 1, how does it all fit together in the same model
ah and also: defaultpath reads from 2, but export() writes to 1...
so the lifecycle is unclear for devs
(I mean in main, not an issue with your pr, but in the foundation your pr builds on)
@molten mist strawman for a simplified model for all things "context", that we converge towards gradually:
- System context: contextual access to the operating system outside the sandbox
- Git context: contextual access to the git repository outside the sandbox.
In other words:
-
Unify "host stuff" and "module context directory stuff" into a broader concept of "context".
-
Rename "host" to "system" to get rid of that bagage
-
Embrace the git nature of "module context directory". And make it not necessarily about modules. This is important because then, we can have interface parity when inside or outside a module (like we already do with host(), kind of)
Also:
- Deprecate
export()since it doesn't let you chose which part of the context to export to. Instead we could add eg.context().system().withDirectory()andcontext().git().withDirectory()
@molten mist to be clear, I'm not suggesting we do all that before merging your PR. It's more to define a future state we want, so we can incrementally converge towards it
(alternatively we could call it the "workspace context" instead of "git context", but I kind of like embracing the concrete reality - it's always git. Might as well expose a native API for it)
๐ - i'm just trying to grok a weird path symlink resolution edge case which is taking all my brain cells lol (https://github.com/dagger/dagger/pull/10937#discussion_r2310694392)