Skip to content

Backport: Fix directory detection bug in Os::FileSystem::getPathType (#3727) - #5542

Merged
LeStarch merged 1 commit into
nasa:release/v3.6.0-hotfixesfrom
zeroping:release/v3.6.x-backport-directory
Aug 3, 2026
Merged

LeStarch merged 1 commit into
nasa:release/v3.6.0-hotfixesfrom
zeroping:release/v3.6.x-backport-directory

Conversation

@zeroping

Copy link
Copy Markdown

This backports #3727 into v3.6.x.

The existing commit applied nearly cleanly, with only a small touch-up done in getPathType() in Os/FileSystem.cpp

Upstream commit message was:

Related Issue(s) #3519
Has Unit Tests (y/n) y
Documentation Included (y/n) n
Generative AI was used in this contribution (y/n) n

Change Description

Several smaller commits were in the final merge commit upstream 20d1b54, which included the following list of fine-grained commits:

  • Fixing directory detection bug.

  • Removed some superfluous whitespace

  • Adding branch path for non-directory and non-file to return PathType::OTHER. Fixing a spelling mistake.

  • Moving getPathType to OS specific FileSystem implementations

  • Incorporating PR comments and cleaning up comments

  • Reverting unnecessary comment changes

  • Incorporating fixes for static analysis findings

Rationale

This fix is useful for an external project using release/3.6.0-hotfixes, and it applies with a trivially-resolved merge conflict.

Testing/Review Recommendations

I've tested these changes under Linux in the context of another project. The fix is also expected to work as they did when the upstream issue was worked.

Future Work

N/A

AI Usage (see policy)

N/A

…asa#3727)

This backports nasa#3727 into v3.6.x. The existing commit applied nearly cleanly, with only a small touch-up done in getPathType() in Os/FileSystem.cpp

Upstream commit message:

* Fixing directory detection bug.

* Removed some superfluous whitespace

* Adding branch path for non-directory and non-file to return PathType::OTHER. Fixing a spelling mistake.

* Moving getPathType to OS specific FileSystem implementations

* Incorporating PR comments and cleaning up comments

* Reverting unnecessary comment changes

* Incorporating fixes for static analysis findings

@lntutor lntutor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed exact head 1ea03c1 against upstream fix 20d1b54. The implementation-specific _getPathType delegation, POSIX lstat classification, stub plumbing, and focused tests are preserved; the remaining file-content differences are expected v3.6-era type/formatting context. In an isolated release/v3.6.0-hotfixes worktree, both touched targets compiled and CTest passed 2/2: StubFileSystemTest and PosixFileSystemTest. I generated with -DVALGRIND=/usr/bin/true to suppress the v3.6 root CMakeLists ASan injection, because macOS 26.5.2 hangs in ASan shadow-memory initialization before main; the unsanitized binaries ran normally. Non-blocking cleanup: git diff --check reports trailing whitespace on the blank lines at PosixFileSystemTests.cpp:59 and :62, inherited from the upstream patch.

@LeStarch
LeStarch requested a review from SterlingPeet August 3, 2026 18:50
@LeStarch
LeStarch merged commit 2bc5d6e into nasa:release/v3.6.0-hotfixes Aug 3, 2026
38 of 39 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.

3 participants