Allow project relative workspace paths
While I find this to be a very odd practice that I would not recommend, it seems that people like to open workspace directories as subdirectories of the BuildStream project itself.
The one benefit I can see to this is that if the workspace is a project relative subdirectory; then one could move the project to a new directory and carry the workspace along with it as a subdirectory.
But for this to work without breaking the workspace/project relationship, BuildStream would have to support serializing and interpreting the workspace directory as a project relative path.
To make this work:
-
bst workspace open
must check if the specified path is a subdirectory of the project- If this is the case, then we can avoid calling
os.path.abspath()
here
- If this is the case, then we can avoid calling
- When interpreting a workspace directory loaded from the project state directory (
project/.bst/...
), we should be initially usingos.path.join(project_directory, workspace_directory)
; this can be done without consideration of whether the path was initially relative or absolute, due to the behavior ofos.path.join()
Update by @toscalix : a proposal that covers this case has been sent to the mailing list.
Edited by toscalix