Files
bun.sh/scripts
Claude Bot f71813cd88 Fix sccache S3 permission error when no Bun credentials configured
The issue occurs when users have AWS credentials from sources like IAM
roles, EC2 instance profiles, or ECS task roles that sccache automatically
detects, but those credentials don't have access to Bun's S3 bucket.

This fix implements two changes:

1. **SetupSccache.cmake**: Only configure S3 bucket when explicit Bun
   credentials are available. When no explicit credentials are found,
   set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY to "UNSET" to prevent
   sccache from detecting AWS credentials from other sources.

2. **scripts/build.mjs**: Stop any running sccache daemon before building
   to ensure it picks up the new environment variables from the .env file.
   This is critical because sccache is a daemon that caches its configuration
   when it starts.

The error looked like:
```
sccache: error: Server startup failed: cache storage failed to read:
PermissionDenied (permanent) at read => S3Error { code: "AccessDenied",
message: "Access Denied"
```

After this fix:
- In CI: Always configure S3 (credentials available via IAM role)
- read-only mode: Configure S3 with anonymous access
- Has explicit Bun credentials: Configure S3 with those credentials
- No explicit credentials: Disable S3, set AWS vars to "UNSET", and
  restart sccache daemon to use local disk cache only

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-08 00:27:13 +00:00
..
2024-10-25 23:50:12 -07:00
2025-08-14 14:44:47 -07:00
2025-01-16 22:40:39 -08:00
2024-12-12 03:21:56 -08:00
2025-09-14 18:48:26 -07:00
fmt
2025-09-12 17:24:47 -07:00
2024-08-27 14:13:21 -07:00
2025-07-10 00:10:43 -07:00
2024-06-14 14:52:20 -07:00
2024-12-12 03:21:56 -08:00