Skip to content

Remove PAL file, path and file-mapping APIs - #136821

Open
am11 wants to merge 2 commits into
dotnet:mainfrom
am11:chore/pal-file-unused
Open

am11 wants to merge 2 commits into
dotnet:mainfrom
am11:chore/pal-file-unused

Conversation

@am11

@am11 am11 commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Depends on #136939 (the SuperPMI and ilasm/ildasm changes, first commit here); this PR is the PAL cleanup on top of it.

  • Delete pal/src/file (file.cpp, directory.cpp, path.cpp) and pal/src/map with their headers and PAL tests. This removes the PAL's Win32 file, path and mapping APIs (CreateFile, ReadFile/WriteFile, SetFilePointer, GetFileSize, FlushFileBuffers, GetStdHandle, CreateFileMapping/MapViewOfFile, GetFullPathName, SearchPathW, GetTempPathA, CreatePipe, ...).
  • Move the remaining Unix callers to stdio/POSIX/minipal:
    • metadata StgIO: FILE* and VMToOSInterface mappings
    • memory-mapped stress log: mmap
    • debugger/diagnostics transport names and createdump's default dump path: read TMPDIR inline (createdump now adds the missing trailing /)
  • Reduce PAL object types to threads and fold single-use PAL helpers into their callers.
  • Remove configure checks left without users (HAVE_PROCFS_STATM, ONE_SHARED_MAPPING_PER_FILEREGION_PER_PROCESS, REALPATH_SUPPORTS_NONEXISTENT_FILES, OPEN64_IS_USED_INSTEAD_OF_OPEN, WRITE_0_BYTES_HANGS_TTY) and their tryrun cache values.

@github-actions github-actions Bot added the area-PAL-coreclr only for closed issues label Nov 2, 2026
@am11
am11 requested review from janvorli and jkotas November 2, 2026 04:24
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Nov 2, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Comment thread src/coreclr/pal/src/map/map.cpp Resolved
@am11 am11 changed the title Remove unused and test-only code from PAL file and map Remove PAL file, path and file-mapping APIs Nov 3, 2026
@am11
am11 requested a review from jkotas November 3, 2026 08:00
Comment thread src/coreclr/md/enc/stgio.cpp Resolved

@jkotas jkotas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you please submit the SuperPMI changes and the ilasm/ildasm changes in separate PR? I would like to merge them separately first.

- SuperPMI (superpmi, mcs, shim collector): use stdio FILE* instead of
  the PAL CreateFile/ReadFile/WriteFile/SetFilePointer/GetFileSize and
  file-mapping APIs; resolve the JIT path with realpath on Unix.
- ilasm, ildasm and metainfo: map files with VMToOSInterface, use minimal
  Unix path handling instead of GetFullPathName/SearchPathW, and drop the
  unused console handles.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Delete pal/src/file (file.cpp, directory.cpp, path.cpp) and pal/src/map
  with their headers and PAL tests.
- Move the remaining Unix callers to stdio/POSIX/minipal: metadata StgIO,
  the memory-mapped stress log, the debugger/diagnostics transport names
  and createdump's default dump path.
- Reduce PAL object types to threads and fold single-use PAL helpers into
  their callers.
- Remove configure checks left without users and their tryrun cache values.

Co-authored-by: Cursor <cursoragent@cursor.com>
@am11
am11 force-pushed the chore/pal-file-unused branch from 06354ba to effdcd7 Compare November 3, 2026 22:17
@am11

am11 commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

@jkotas split the SuperPMI and ilasm/ildasm bits out into #136939; this one is now just the PAL cleanup on top of it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-PAL-coreclr only for closed issues community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants