Skip to content

Close two gaps from changes in 0.10.11 - #1326

Open
isc-dchui wants to merge 2 commits into
mainfrom
fix/guard-source-deletion
Open

isc-dchui wants to merge 2 commits into
mainfrom
fix/guard-source-deletion

Conversation

@isc-dchui

Copy link
Copy Markdown
Collaborator

Description

Follow-up to two 0.10.11 PRs, from reviewing them together. #1311 (#300) keeps FileCopy and CSPApplication from clearing or deleting system directories, and #1316 (#934) refuses copies whose source and target overlap. Two gaps remain.

  1. Uninstall can delete a module's own source, which predates 0.10.11. A CSPApplication with no DeployPath serves its resource folder in place, and a FileCopy can target its own source through a symlink or bind mount. A dev-mode uninstall of either deleted that folder from the repo. Uninstall now leaves any target that overlaps the source in place.
  2. Prevent FileCopy from deleting when source and target are the same directory #1316 refuses a copy into a directory containing the source even when nothing is cleared first. That broke Overlay="1" copies into {$installDir} or {$dataDir}, which worked in 0.10.10. Copies are now refused only when they could delete the source:
Target Cleared first (default) Not cleared (Overlay="1" or a protected directory)
The source, or inside it Refused Refused
Contains the source Refused Allowed
Unrelated Allowed Allowed

Testing

New cases in Test.PM.Integration.CopyDirOverlap and Test.PM.Integration.FileCopy, also run on IRIS 2026.1 for Windows.

Checklist

  • This branch has the latest changes from the main branch rebased or merged.
  • Changelog entry added.
  • Unit (zpm test -only) and integration tests (zpm verify -only) pass.
  • Style matches the style guide in the contributing guide.
  • Documentation has been/will be updated
    • Source controlled docs, e.g. README.md, should be included in this PR and Wiki changes should be made after this PR is merged (add an extra issue for this if needed)
  • Pull request correctly renders in the "Preview" tab.

🤖 Generated with Claude Code

@isc-kiyer isc-kiyer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@isc-dchui good catches! Just one issue to address

ClassMethod DirectoriesOverlapPython(
first As %String,
second As %String) As %Boolean [ Language = python ]
ClassMethod DirectoryContainsPython(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should allow directory comparisons (pretty key) to work without embedded python. Oras should be the only part of IPM which requires embedded python to work.
Can we add a unit test for this to limit usage of Language = python to specific classes so we don't accidentally introduce this incompatibility?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I am fine with having this if it gives a large performance boost but should fallback to ObjectScript only implementation

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@isc-kiyer There is already objectscript fallback code: see DirectoryContains(). The main benefit here is actually correctness, as I'm not aware of good objectscript ways to detect aliases, e.g. symlinks or bind mounts. (There are ugly ways like writing temp files when traversing directories and checking them, but I'm not sure if that's worth it.)

@isc-dchui
isc-dchui requested a review from isc-kiyer November 12, 2026 13:39
@isc-dchui isc-dchui added this to the v0.10.11 milestone Nov 12, 2026
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