Skip to content
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

[FIX] ENAMETOOLONG: name too long, ... errors due to too long name of generated temp directory #174

Open
ptabor opened this issue Sep 1, 2023 · 1 comment
Assignees

Comments

@ptabor
Copy link

ptabor commented Sep 1, 2023

In case of running jest-html-reporter in the deeply nested trees it fails with:

    Error: An error occurred while adding the reporter at path "/private/var/tmp/_bazel_ptabor/7822fa32d222a4d7f0cf5a703ea68dac/sandbox/darwin-sandbox/2035/execroot/sfc_snapps/bazel-out/darwin_arm64-fastbuild/bin/src/[redacted]/.aspect_rules_js/[email protected]/node_modules/jest-html-reporters/index.js".
    
    ENAMETOOLONG: name too long, unlink '/var/folders/p3/x51cvt2j2dj9cb7rrq2pzg_80000gn/T/L3ByaXZhdGUvdmFyL3RtcC9fYmF6ZWxfcHRhYm9yLzc4MjJmYTMyZDIyMmE0ZDdmMGNmNWE3MDNlYTY4ZGFjL3NhbmRib3gvZGFyd2luLXNhbmRib3gvMjAzNS9leGVjcm9vdC9zZmNfc25hcHBzL2JhemVsLW91dC9kYXJ3aW5fYXJtNjQtZmFzdGJ1aWxkL2Jpbi9zcmMvW3JlZGFjdGVkLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLnJlZGFjdGVkXQo/jest-html-reporters-temp']

This problem is especially likely to happen when using on Bazel (that uses long paths).

Here is a patch that fixes the problem - by generating SHA checksum of the base folder instead of encoding the entire path in its name:

https://github.com/Hargne/jest-html-reporter/compare/master...ptabor:20230901-checsum-instead-of-base64?expand=1

@sfc-gh-ptabor
Copy link

@Hargne Could you, please, take a look and create PR from the diff (I cannot push a branch here).

@Hargne Hargne self-assigned this Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants