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
. (... | psub) broken since 3.1.0 #6613
Comments
What's happening here is that psub, to do its work creates a temporary file or directory. And to do that it uses $TMPDIR if it is set or /tmp otherwise. So it seems that something in your configuration is setting $TMPDIR to a broken value. Find that and fix it. |
It looks like a macOS mktemp/TMPDIR path, it sure would be strange that it would be set by the OS to a directory that does not exist. What is the directory in the output of |
@faho I kind of doubt this is as simple as a bad configuration setting TMPDIR wrong - people on Macs don't really set it, launchd does. Someone else reported the same thing just two days ago: #6594 (comment) But his explanation that it was related to . vs source makes no sense. |
Yeah, they were doing . (rbenv init -|psub) which is about two layers too convoluted - just do Now why we're erroring here with |
Also weird that he was only seeing it with |
A simple test with
Easy explanation: Doing rbenv only in login shells. |
Oh, right. |
Since fish 3.10 at least, the current way of loading rbenv in `fish` is misbehaving, at least in some environments: ``` source: Error encountered while sourcing file '/var/folders/pj/jn249gcn7ddfrjzj2_9mxjhw0000gp/T//.psub.f0iJSWRByB': source: No such file or directory ``` This changes the initialization to the method recommended by a `fish` developer here: fish-shell/fish-shell#6613 (comment)
Okay, I can't reproduce this. I literally put status --is-interactive; and source (rbenv init - | psub) into my config.fish and it just works? So it might be mac-specific, and I don't have a mac. So I'm going to need one of our many mac-using users and developers to figure this one out. I'll be happy to answer any questions I can. |
|
I think what happens is that the outer job completes, which leads to the cleanup function running and deleting the file before |
@zanchey Can you confirm it works with |
Indeed, it does. |
Doesn't apply cleanly. In particular it pulls in the process_type_t stuff. Tbh I'd rather just have a simplified version of it. |
Since fish 3.10 at least, the current way of loading rbenv in `fish` is misbehaving, at least in some environments: ``` source: Error encountered while sourcing file '/var/folders/pj/jn249gcn7ddfrjzj2_9mxjhw0000gp/T//.psub.f0iJSWRByB': source: No such file or directory ``` This changes the initialization to the method recommended by a `fish` developer here: fish-shell/fish-shell#6613 (comment)
see fish-shell/fish-shell#6613 using the new recommended init snippet works
I am also seeing this
with output:
while the following works fine.
|
@nickolasclarke You want just: set -x PATH "/home/nclarke/.pyenv/bin" $PATH
status --is-interactive; and pyenv init - | source
status --is-interactive; and pyenv virtualenv-init - | source
(Of course it should still work, and we've fixed it in master. We're just figuring out the correct way to fix it for 3.1.1) |
@faho noted, thanks. I'm tracking down which script automatically added these lines and will open a PR. |
This addresses a [regression](fish-shell/fish-shell#6613) introduced in fish 3.1 and aligns with best practices for fish shell scripting.
The `function --on-job-exit caller` feature allows a command substitution to observe when the parent job exits. This has never worked very well - in particular it is based on job IDs, so a function that observes this will run multiple times. Implement it properly. Do this by having a not-recycled "internal job id". This is only used by psub, but ensure it works properly none-the-less. faho: Backport of 6bf9ae9 Fixes fish-shell#6613
The `function --on-job-exit caller` feature allows a command substitution to observe when the parent job exits. This has never worked very well - in particular it is based on job IDs, so a function that observes this will run multiple times. Implement it properly. Do this by having a not-recycled "internal job id". This is only used by psub, but ensure it works properly none-the-less. faho: Backport of 6bf9ae9 Fixes #6613
Updated on README.md in 8995bd8 but still had the old snippet in man pages. The old snippet was causing an alert with fish 3.1.0 like the one described in: fish-shell/fish-shell#6613
Updated on README.md in 8995bd8 but still had the old snippet in man pages. The old snippet was causing an alert with fish 3.1.0 like the one described in: fish-shell/fish-shell#6613
Using `.` fails to create a tmp file and source it. Said issue described [here](fish-shell/fish-shell#6613)
fairysword commentedFeb 16, 2020
After upgraded to 3.1
How to fix the error?
The text was updated successfully, but these errors were encountered: