-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Asset building uses incorrect temp folder on mac #8465
Comments
OK, |
The `os.tmpdir()` built-in doesn't return the real path when the returned path is a symlink. Add a `FileSystem.tmpdir` that wraps `os.tmpdir()` in a `fs.realpathSync()` and caches the result. Fixes aws#8465
The `os.tmpdir()` built-in doesn't return the real path when the returned path is a symlink. Add a `FileSystem.tmpdir` that wraps `os.tmpdir()` in a `fs.realpathSync()` and caches the result. Add a `FileSystem.mkdtemp()` to create temp directories in the system temp directory. Fixes #8465 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This seems not to be fixed. Bundling assets as part of NodeJsFunction still uses a temp folder under /var/folders (CDK v1.61.0) |
I got the same problem as @pgarbe mentioned on 1.63.0. |
I'm also having this same problem:
But only when run tests. Bundling when synthesizing works. I was also able to get past it by sharing /var/folders with docker. |
Building assets on macOS uses a temp folder that is not accessible on the mac. The folder /var/folders is protected. The correct folder on macOS is /private/var/folders
Reproduction Steps
Error Log
Environment
Other
To solve the error the correct temp directory should be set. The npm package temp-dir can fix this error.
The file asset-staging.js
const bundleDir = fs.mkdtempSync(path.resolve(path.join(os.tmpdir(), 'cdk-asset-bundle-')));
should then be changed in:
const bundleDir = fs.mkdtempSync(path.resolve(path.join(require('temp-dir'), 'cdk-asset-bundle-')));
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: