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

Cope better with relative locations #192

Merged
merged 3 commits into from
Oct 23, 2024
Merged

Cope better with relative locations #192

merged 3 commits into from
Oct 23, 2024

Conversation

richfitz
Copy link
Member

Previously we allowed relative paths to be used for locations but it was ambiguous where they were looked up. This is a problem in contexts where absolute paths are not suitable (e.g., on the cluster where the mount point on the nodes is different to the submitting workstation).

This PR removes the ambiguity - we take the path relative to the root, and not relative to the command that calls orderly_location_add_path(). This might be confusing so there's a special case error that we throw if it looks like the wrong relative path was chosen.

When we load the driver we change back to the root and then interpret the path at that point. This is also done when the user verifies addition (in #188).

@richfitz richfitz requested a review from plietar October 23, 2024 13:06
@richfitz richfitz marked this pull request as ready for review October 23, 2024 13:06
Copy link
Member

@plietar plietar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t love the idea of using the current working directory as some kind of implicit argument to the location_path constructor, but I guess I can live with it.

Aren’t we glad R is single threaded and we don’t have to worry about shared mutable state.

"which exists, but does not exist relatively to",
"'{root$path}', the root of your orderly archive"),
i = "Consider passing '{root_fix}' instead"))
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really nice diagnostics! Really solves the problem of having to choose between two equally acceptable behaviours.

@richfitz richfitz merged commit 71ac8d5 into main Oct 23, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants