Skip to content

fix(pkg): allow locking relative path outside the workspace#13915

Open
shunueda wants to merge 2 commits intoocaml:mainfrom
shunueda:fix/allow-locking-outside-workspace
Open

fix(pkg): allow locking relative path outside the workspace#13915
shunueda wants to merge 2 commits intoocaml:mainfrom
shunueda:fix/allow-locking-outside-workspace

Conversation

@shunueda
Copy link
Contributor

@shunueda shunueda commented Mar 25, 2026

Closes #10254.

The linked issue has been labeled "bug", and I agree with this as (afaik) Opam allows relative paths outside the workspace, though open to discussion here.

@shunueda shunueda force-pushed the fix/allow-locking-outside-workspace branch from b0de6c6 to a4bc8cc Compare March 25, 2026 14:10
@Alizter Alizter requested a review from rgrinberg March 25, 2026 14:16
let path =
Path.of_string_allow_outside_workspace url.path
|> Path.to_absolute_filename
|> Path.External.of_string
Copy link
Member

Choose a reason for hiding this comment

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

Can't you pattern match on the result of Path.of_string_allow_outside_workspace url.path and construct the right path directly for Fs_memo.path_kind?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, though required some refactoring so I split it into a separate commit.

Signed-off-by: Shun Ueda <me@shu.nu>
@shunueda shunueda requested a review from rgrinberg March 25, 2026 20:32
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.

pkg: error when locking when a pin stanza contains a relative path outside the workspace

2 participants