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

Unexport CMD_DURATION #1896

Merged
merged 1 commit into from Jan 17, 2015
Merged

Unexport CMD_DURATION #1896

merged 1 commit into from Jan 17, 2015

Conversation

@bhamiltoncx
Copy link
Contributor

@bhamiltoncx bhamiltoncx commented Jan 16, 2015

Valid uses of the CMD_DURATION environment variable don't seem to include passing
it to subsequent child processes.

I work on the Buck build system at Facebook (http://facebook.github.io/buck/). One of Buck's features is to discard its cache if anything in the calling environment has changed since the last run:

https://github.com/facebook/buck/blob/master/src/com/facebook/buck/parser/Parser.java#L950

For all shells except fish, this is no problem. However, since fish exports CMD_DURATION to all sub-processes with a different value each time, Buck always discards its cache between runs, so it performs terribly.

I confirmed the variable is still available inside the shell by running:

function fish_prompt
    echo "duration [$CMD_DURATION] "
end

duration [0] sleep 2
duration [2002]
Valid uses of this environment variable don't really include passing
it to subsequent child processes.

I confirmed the fix with:

  function fish_prompt
      echo "cmd duration [$CMD_DURATION] "
  end

  cmd duration [0] sleep 2
  cmd duration [2002]
@xfix xfix merged commit b31305b into fish-shell:master Jan 17, 2015
1 check passed
1 check passed
continuous-integration/travis-ci The Travis CI build passed
Details
@zanchey zanchey added this to the next-minor milestone Jan 17, 2015
@zanchey zanchey added the docs label Jan 17, 2015
@zanchey
Copy link
Member

@zanchey zanchey commented Jan 17, 2015

This will need a note in the release notes, although it seems unlikely that anyone is depending on this behaviour.

@xfix
Copy link
Member

@xfix xfix commented Jan 17, 2015

In theory, someone could have a fish prompt implemented in different programming language using environment variable, but I would consider it unlikely (quick search on GitHub has shown one prompt not written in fish shell using CMD_DURATION, but even in this case the program generating a prompt gets explicit CMD_DURATION argument. Besides, even if it's a case, a parameter can be passed explicitly.

@bhamiltoncx bhamiltoncx deleted the bhamiltoncx:unexport-cmd-duration branch Jan 20, 2015
@faho faho removed the docs label Aug 10, 2015
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants