Skip to content

[clang][cas] Fix -cc1depscan sandbox violations on Windows - #219

Closed
tagolog wants to merge 1 commit into
swift/nextfrom
tagolog/cas-daemon-io-sandbox-issue
Closed

tagolog wants to merge 1 commit into
swift/nextfrom
tagolog/cas-daemon-io-sandbox-issue

Conversation

@tagolog

@tagolog tagolog commented Oct 7, 2026 •

Copy link
Copy Markdown

Every -cc1 tool runs under the IO sandbox, and on Windows
system_temp_directory(), ExecuteNoWait() and ExecuteAndWait() trip it.
The depscan client calls the first two to find and spawn its daemon,
and -cc1depscand -execute calls the third to run its command. None of
this is compiler IO, so disable the sandbox around these calls.

This makes clang-cache sessions work on Windows and fixes these tests
in clang/test/CAS:

  • cache-launcher-scan-diagnostics.c
  • daemon-cwd.c
  • depscan-include-tree-daemon.c
  • depscan-with-error.c
  • depscan.c
  • fdepscan-daemon.c
  • fdepscan.c
  • validate-once.c

Add clang-cache-session-daemon.c to test the session daemon.

On Windows, LLVM_CACHE_BUILD_SESSION_ID and -fdepscan=daemon without
a socket path abort every compilation with "IO sandbox violation".
The -cc1depscan client runs under the -cc1 IO sandbox, and two of its
setup steps hit it on Windows: system_temp_directory() makes the socket
path absolute, and ExecuteNoWait() checks the program before starting
it. Neither is compiler IO, so disable the sandbox around both, as the
daemon side already does.
@tagolog
tagolog requested review from asl and slydiman October 7, 2026 19:35
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

Hello @tagolog 👋

Thank you for submitting a Pull Request (PR) to the LLVM Project. Since this is your first PR, here are a few useful links covering our main contribution policies and review practices.

  • All contributions to LLVM must follow our LLVM AI Tool Use Policy. In particular, if you used AI while working on this PR, remember to add a note to the PR description.
  • The LLVM Code-Review Policy and Practices document contains practical information about the PR process, including how patches are reviewed and accepted, and who can review a PR.
  • Our LLVM Developer Policy describes our expectations for code quality, commit summaries and contains notes on our CI system.

Please reply to this message to confirm that you have read these policies, especially the LLVM AI Tool Use Policy, and that any AI tool usage has been noted in the PR description.


Frequently asked questions

How do I add reviewers?

This PR will be automatically labeled, and the relevant teams will be notified. For some parts of the project, reviewers may also be added automatically.

You can also add reviewers manually using the Reviewers section on this page. If you cannot use that section, it is probably because you do not have write permissions for the repository. In that case, you can request a review by tagging reviewers in a comment using @ followed by their GitHub username.

What if there are no comments?

If you have not received any comments on your PR after a week, you can request a review by pinging the PR with a comment such as “Ping”. The common courtesy ping rate is once a week. Please remember that you are asking for volunteer time from other developers.

Are any special GitHub settings required to contribute to LLVM?

We only require contributors to have a public email address associated with their GitHub commits, see this section of LLVM Developer Policy for details.


If you have questions, feel free to leave a comment on this PR, or ask on LLVM Discord or LLVM Discourse.

Thank you,
The LLVM Community

@slydiman slydiman 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.

LGTM, no questions

@tagolog tagolog changed the title [clang][cas] Allow the depscan client to spawn its daemon on Windows [clang][cas] Fix -cc1depscan sandbox violations on Windows Oct 13, 2026
@tagolog

tagolog commented Nov 13, 2026

Copy link
Copy Markdown
Author

Implemented as PR 14664 to swiftlang llvm-project

@tagolog tagolog closed this Nov 13, 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