Skip to content

fix #1444 stat call #716

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

Merged

Conversation

TylerLeonhardt
Copy link
Member

be explicit in calling stat since users can install GNU coreutils (which has a different signature) on macOS.

Copy link
Contributor

@rjmholt rjmholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like stat is also at /usr/bin/stat in Ubuntu18.04.

LGTM!

@@ -232,10 +232,10 @@ function Set-NamedPipeMode {
chmod $DEFAULT_USER_MODE $PipeFile

if ($IsLinux) {
$mode = stat -c "%a" $PipeFile
$mode = /usr/bin/stat -c "%a" $PipeFile
Copy link
Contributor

@rkeithhill rkeithhill Aug 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If case this comes up again, should we check for an env var for the path to stat that we can tell folks to set if their /usr/bin/stat binary chokes on a named pipe file? Or we could just do a quick-turn update - now that we have the infrastructure to support such updates.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should cover our bases - we've tried on Ubuntu, Fedora 28, and macOS - and it's a part of GNU coreutils so it should be at that path on all the supported OS's for PowerShell.

I understand the situation where some one on macOS (which uses the BSD way with -f "%A" wants to conform to the GNU standard -c %a - but I don't really see why anyone would overwrite the existing one, they'd just change the symbolic link and the path we have set will still work.

Personally, I think we're okay. But if you want me to check an environment variable, I can :)

Actually... did we ever add that functionality to add an environment variable?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. You can already do this with an exising VSCode setting:

    "terminal.integrated.env.windows": { "FOO": "bar" }

There are equivalent settings for Linux and OSX.

BTW I'm good with the PR as-is.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right! Thnsks Keith 👍

Copy link
Contributor

@rkeithhill rkeithhill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@TylerLeonhardt TylerLeonhardt merged commit 2fe8994 into PowerShell:master Aug 2, 2018
@TylerLeonhardt TylerLeonhardt deleted the fix-1444-stat-call branch August 2, 2018 00:11
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.

3 participants