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 getIPCPath on darwin (macOS) under a parent process #113

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

SamJakob
Copy link

@SamJakob SamJakob commented Feb 2, 2021

On Darwin (macOS), under a parent process, the environment args might not be correctly passed and os.tmpdir() returns a subdirectory of the root temp dir. This PR therefore uses os.tmpdir() to ensure the environment args aren't modified and gets the parent of the subdirectory if it is detected that the returned temp directory is in a subdirectory.

src/transports/ipc.js Outdated Show resolved Hide resolved
@SamJakob SamJakob requested a review from kyranet February 3, 2021 15:15
@Benricheson101
Copy link

Any update on this?

Benricheson101 added a commit to Benricheson101/RPC that referenced this pull request Aug 27, 2021
@leonardssh
Copy link

@kyranet

@kyranet
Copy link
Member

kyranet commented Aug 27, 2021

cc: @devsnek

@tandpfun
Copy link

tandpfun commented Jul 6, 2022

This fix doesn't seem to work for me 😦
The paths appear as this which isn't the ipc directory:
CleanShot 2022-07-06 at 11 54 58@2x
My actual IPC directory should be this:
CleanShot 2022-07-06 at 11 56 20@2x

@xhayper
Copy link

xhayper commented Jul 29, 2022

Here's inline fix

import fs from "fs";

for (const key of ['XDG_RUNTIME_DIR', 'TMPDIR', 'TMP', 'TEMP']) {
	if (process.env[key]) process.env[key] = fs.realpathSync(process.env[key] as string);
}

(i also have a fork that should fix this problem)

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

Successfully merging this pull request may close these issues.

6 participants