-
Notifications
You must be signed in to change notification settings - Fork 127
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
helper to convert from host to chroot path #2730
Comments
locally i also used something like this for something like
where by default this fails, because the self.cwd view is host, but .do executes in chroot context. so sometimes it's needed to convert these to be able to pass cwd-based globs into something to a .do (since .glob is afaict only usable from a pathlib.Path, but the only way to get one of those is self.cwd or similar, since we can't import Path and do Path(".").glob() for relative, and the existing chroot_ vars don't work because the glob is done from host context) unrelatedly that means another useful thing to add is something that is just Path(".") instead of /full/path for cwd, but i have no idea what that would be called |
the issue is mainly that the host view may differ based on where the chroot path is, as the chroot consists of multiple mounts which may point to wildly different paths outside, so implementing this generically is bound to be inefficient, as it would require multiple path checks to see what to map to normally when using stuff right now you you do something like... this is not particularly efficient either and is somewhat clunky but so far i haven't been able to find anything better |
guess so the second case of having a pathlib.Path(".") exposed would solve my own immediate issue and should be very easy :) |
how would it be easy? having an actual relative path object is never useful since we never change the physical cwd, so it would not match anything ever |
does cbuild rely on its own cwd being in cports presently for any internals or nah if not you could make cwd |
i only see this ever being useful relative to builddir and not any of the others so that seems fine |
(this is a terrible idea) |
i think the relative_to is fine actually, and you don't need the first part either; just |
seems self.srcdir is the exact same path though so that works |
is used with destdir too |
mostly would instantly be used for #2683
example impl in #2576 host_path_to_chroot
The text was updated successfully, but these errors were encountered: