Skip to content

Commit 8ce3636

Browse files
committed
doc: Add appendix to explain antivirus interference
The screenshot was taken in a macOS 26 Tahoe RC VM, with exif data stripped using `exiftool` and size-optimized using `image_optim`.
1 parent 24bb93c commit 8ce3636

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed

src/doc/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,4 @@
100100
* [Changelog](CHANGELOG.md)
101101
* [Appendix: Glossary](appendix/glossary.md)
102102
* [Appendix: Git Authentication](appendix/git-authentication.md)
103+
* [Appendix: Antivirus Software](appendix/antivirus.md)

src/doc/src/appendix/antivirus.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Antivirus Software
2+
3+
Many operating systems include antivirus software programs that scan the system for malware. These sometimes interfere with development workflows, see below.
4+
5+
## XProtect
6+
7+
macOS has a layered system for protecting against malware, see [Apple's documentation](https://support.apple.com/en-gb/guide/security/sec469d47bd8/web) for details. One of the components here is XProtect, which intercepts all binary launches and scans new binaries for malware before executing them.
8+
9+
Unfortunately, scanning binaries is done on a single thread and can be fairly slow (100-300ms). This affects projects developed with Cargo, since Cargo creates many binaries that are often only executed once (examples include build scripts and test binaries).
10+
11+
You can avoid this overhead by doing the following:
12+
- Open `System Settings` and navigate to the `Privacy & Security` item.
13+
- On older macOS versions, click the `Privacy` tab.
14+
- Navicate to the `Developer Tools` item.
15+
- Add your terminal to the list, and enable it.
16+
- You can run `spctl developer-mode enable-terminal` to add `Terminal.app` to this list.
17+
- If you use a third-party terminal application, you might need to add that here as well.
18+
- Restart your terminal.
19+
20+
See the screenshot below for what this looks like on macOS 26 Tahoe.
21+
22+
![System Settings with Terminal.app set as a Developer Tool](../images/macos-developer-tool-settings.png)
23+
24+
### Security considerations
25+
26+
Unfortunately, there doesn't seem to be a way to scope this to select binaries, e.g. adding Cargo directly as a developer tool has no effect, it has to be the "top-level" process.
27+
28+
As such, **this disables your antivirus for all software that is launched via your terminal**. This is only one part of macOS' security protections that specifically checks for known malware signatures, and it is nowhere near as unsafe as disabling SIP or giving Full Disk Access would be - but depending on your security constraints, you might still consider leaving it enabled.
29+
30+
Changing this setting has not been tested on systems in enterprise environments, it might affect more things there.
215 KB
Loading

src/doc/src/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ The commands will let you interact with Cargo using its command-line interface.
3232
**Appendices:**
3333
* [Glossary](appendix/glossary.md)
3434
* [Git Authentication](appendix/git-authentication.md)
35+
* [Antivirus Software](appendix/antivirus.md)
3536

3637
**Other Documentation:**
3738
* [Changelog](CHANGELOG.md)

0 commit comments

Comments
 (0)