Skip to content

Commit 4af2538

Browse files
authored
Merge pull request SCons#4603 from al3xtjames/darwin-generate
Handle permission errors while generating paths on Darwin
2 parents 5404eb7 + 2d5e3a4 commit 4af2538

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

CHANGES.txt

+5
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
5050
- Some manpage cleanup for the gettext and pdf/ps builders.
5151
- Some clarifications in the User Guide "Environments" chapter.
5252

53+
From Alex James:
54+
- On Darwin, PermissionErrors are now handled while trying to access
55+
/etc/paths.d. This may occur if SCons is invoked in a sandboxed
56+
environment (such as Nix).
57+
5358

5459
RELEASE 4.8.1 - Tue, 03 Sep 2024 17:22:20 -0700
5560

RELEASE.txt

+4
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ FIXES
4646
- Fix a problem with compilation_db component initialization - the
4747
entries for assembler files were not being set up correctly.
4848

49+
- On Darwin, PermissionErrors are now handled while trying to access
50+
/etc/paths.d. This may occur if SCons is invoked in a sandboxed environment
51+
(such as Nix).
52+
4953
IMPROVEMENTS
5054
------------
5155

SCons/Platform/darwin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def generate(env) -> None:
4646
# make sure this works on Macs with Tiger or earlier
4747
try:
4848
dirlist = os.listdir('/etc/paths.d')
49-
except FileNotFoundError:
49+
except (FileNotFoundError, PermissionError):
5050
dirlist = []
5151

5252
for file in dirlist:

0 commit comments

Comments
 (0)