Skip to content

PATH management is broken when the profile is a symlink to cloud storage #8576

@jandubois

Description

@jandubois

When ~/.bash_profile or ~/.zshrc are symlinks to cloud storage, then the path management code can no longer copy the file:

cat path-management.log
2025-04-29T16:39:58.462Z: Error: EPERM: operation not permitted, copyfile '/Users/jan/.bash_profile' -> '/Users/jan/.bash_profile.rd-backup~'

I've verified this issue with both Dropbox and iCloud. E.g. this is enough to repro (assuming ~/.bash_profile is a real file):

mv .bash_profile "$HOME/Library/Mobile Documents/com~apple~CloudDocs"ln -s "$HOME/Library/Mobile Documents/com~apple~CloudDocs/.bash_profile"

I've manually bisected this to #8443. The binaries from #8544, which was merged just before it, do not exhibit this problem.

I've tested this with macOS 15.4.1 and 15.5 Beta 5 on M1 machines.

I could not reproduce it with macOS 12.7.6 on an Intel Mac.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions