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

Allow relative-to-current-directory DB queries #1662

Open
ag-eitilt opened this issue Oct 2, 2024 · 2 comments
Open

Allow relative-to-current-directory DB queries #1662

ag-eitilt opened this issue Oct 2, 2024 · 2 comments
Labels
breaking-change discussion required Scope and/or response need a narrower definition

Comments

@ag-eitilt
Copy link
Collaborator

Currently, wake -o queries the file relative to the workspace root, even if the current directory is elsewhere:

.../path/in/workspace$ ls
output.ext
.../path/in/workspace$ wake -o output.ext
No jobs matched query
.../path/in/workspace$ wake -o path/in/workspace/output.ext
# write: path/in/workspace/output.ext (502480) [inspect.visibility=hidden,]
$ <write> -m 0644 path/in/workspace/output.ext

The more natural UX would be to prepend the path from the workspace root to the current directory to -o and -i arguments, so that the first form would work; however doing so would break the second form. I personally think that's an acceptable tradeoff, but I'm certainly willing to be convinced otherwise.

@ag-eitilt ag-eitilt added untriaged This issue hasn't been looked at nor classified breaking-change labels Oct 2, 2024
@ag-eitilt
Copy link
Collaborator Author

Potential difficulties with this are how it would still work with globs, as well as where the database has been copied elsewhere.

Very difficult to track both the workspace root and the current directory, and resolve contradictions between those. Paths will still be relative to the wakeroot, but how would you know what to munge?

@ag-eitilt ag-eitilt added discussion required Scope and/or response need a narrower definition and removed untriaged This issue hasn't been looked at nor classified labels Oct 9, 2024
@colinschmidt
Copy link
Contributor

One of a family of scenarios that seems particularly tricky:

/src$ wake <invocation that writes to build/ouput.txt>
/src$ cp wake.db /tmp
/src$ cd /tmp
/src$ touch .wakeroot
/tmp$ mkdir foo
/tmp$ cd foo
/tmp/foo$ wake -o output.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change discussion required Scope and/or response need a narrower definition
Projects
None yet
Development

No branches or pull requests

2 participants