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

[Bug?]: pnpm linker is not maintaining proper file perms from package source #5991

Closed
1 task
ColeStansbury opened this issue Nov 29, 2023 · 2 comments
Closed
1 task
Labels
bug Something isn't working

Comments

@ColeStansbury
Copy link

Self-service

  • I'd be willing to implement a fix

Describe the bug

Esbuild is a core dependency for many frontend projects. I was able to provide clear and simple steps for how to reproduce the bug in the following issue:
evanw/esbuild#3510

Thanks to ESbuild's project team, they noticed that yarn is not retaining the "x" bit on the file permissions when using pnpm. Reverting back to pnp is the only workaround I've found so far.

To reproduce

corepack enable
yarn set version berry
yarn init -2
yarn add esbuild
echo "nodeLinker: pnpm" >> .yarnrc.yml
yarn

Environment

System:
    OS: Mac OS Sonoma 14.1.1
    CPU: M2
Binaries:
    Node: v21.2.0 - ~/.nvm/versions/node/v21.2.0/bin/yarn
    Yarn: 4.0.2 - ~/.nvm/versions/node/v21.2.0/bin/node
    npm: 10.2.4 - ~/.nvm/versions/node/v21.2.0/bin/npm

Additional context

No response

@ColeStansbury ColeStansbury added the bug Something isn't working label Nov 29, 2023
@7rulnik
Copy link
Contributor

7rulnik commented Nov 29, 2023

duplicate #5165

@ColeStansbury
Copy link
Author

duplicate #5165

thanks, I dug for quite a while but wasn't able to find this issue yet. My mistake, closing.

arcanis added a commit that referenced this issue Jan 23, 2024
…#6066)

**What's the problem this PR addresses?**

This is the fix for missing executable perms when installing
dependencies like turbo and esbuild with pnpm linker
(#5165,
#5991)

Resolves #5165

<!-- Describe the rationale of your PR. -->
<!-- Link all issues that it closes. (Closes/Resolves #xxxx.) -->


**How did you fix it?**
<!-- A detailed description of your implementation. -->
Looks like the code was missing for setting permissions for the file
copied by pnpm linker into content-addressable store

I added `destinationFs.chmodPromise` to `copyFileViaIndex` in `fslib` if
the file is not in store (`if (!indexStat)` branch)

**Checklist**
<!--- Don't worry if you miss something, chores are automatically
tested. -->
<!--- This checklist exists to help you remember doing the chores when
you submit a PR. -->
<!--- Put an `x` in all the boxes that apply. -->
- [x] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).

<!-- See
https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released
for more details. -->
<!-- Check with `yarn version check` and fix with `yarn version check
-i` -->
- [x] I have set the packages that need to be released for my changes to
be effective.

<!-- The "Testing chores" workflow validates that your PR follows our
guidelines. -->
<!-- If it doesn't pass, click on it to see details as to what your PR
might be missing. -->
- [x] I will check that all automated PR checks pass before the PR gets
reviewed.

---------

Co-authored-by: Maël Nison <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants