Bug 1189036
Summary: | RFE: ccache should get applied via profile in other shells than bash | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Raphael Groner <projects.rg> | ||||||
Component: | fish | Assignee: | Andy Lutomirski <luto> | ||||||
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | unspecified | ||||||||
Version: | rawhide | CC: | jaswinder, luto, oliver | ||||||
Target Milestone: | --- | Keywords: | FutureFeature | ||||||
Target Release: | --- | ||||||||
Hardware: | x86_64 | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | fish-2.3.1-1.fc24 fish-2.3.1-1.fc23 fish-2.3.1-1.el7 | Doc Type: | Enhancement | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2016-07-12 15:02:54 UTC | Type: | Bug | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Bug Depends On: | 1312594 | ||||||||
Bug Blocks: | |||||||||
Attachments: |
|
Description
Raphael Groner
2015-02-04 10:01:14 UTC
Sorry for sitting on this for so long. It's not entirely clear to me what to do about this. Some fish startup script could try to parse the contents of /etc/profile.d/*.sh, but that could be a bit hairy. Ideas? I could file a bug upstream, but I'm not sure what they would do about it. Personally, here's the question for upstream to answer: if fish is going to claim to be bourne-shell compatible, then shouldn't it parse /etc/profile ? If yes, fix it. Else, it's a feature, NOTABUG The trouble is that fish would need to execute /etc/profile, not just parse it. For example:
> . /etc/profile.d/ccache.sh
results in tons of errors.
I suppose that fish could run bash (or dash or busybox sh or some internal minimal POSIX-compliant shell) to run /etc/profile and then export the resulting environment variables, but that's not very elegant.
If we had a nice declarative language for /etc/profile.d scripts, that would be great, but we don't seem to have such a thing.
OK, I think the answer here then is that fish is not bourne shell compatible (so NOTABUG). By extension, is not suitable for user default shells (in fedora at least). This is at least a bit disappointing, since csh-compatible shells are okay in Fedora. Would an acceptable solution be to have a shell wrapper along these lines: #!/bin/bash if [[ "${0:0:1}" == "-" ]]; then bash --login -c "exec /usr/bin/fish" else exec /usr/bin/fish Maybe, as long as it works :) (In reply to Andy Lutomirski from comment #3) > The trouble is that fish would need to execute /etc/profile, not just parse > it. For example: > > > . /etc/profile.d/ccache.sh > > results in tons of errors. Since the script file is part of the ccache package, I'll reassign to ccache and wait what the maintainer there says: That script does not seem to be designed to work in other shells than bash or somehow bash-like. Maybe add some bashism and enforce to run in a bash environment? I do not even know if ccache is generally designed to work in any other shell than bash. > I suppose that fish could run bash (or dash or busybox sh or some internal > minimal POSIX-compliant shell) to run /etc/profile and then export the > resulting environment variables, but that's not very elegant. Possible work-around and definitely upstream decision to find a proper solution. > If we had a nice declarative language for /etc/profile.d scripts, that would > be great, but we don't seem to have such a thing. This is too generally and out-of-scope for this bug. I think there's little point in re-assigning to ccache. The eternal expectation is that stuff that matches /etc/profile.d/*.sh is for shells compatible with bourne shell /etc/profile.d/*.csh for shells compatible with c-shell I seems clear at this point that fish is compatible with neither. Created attachment 994275 [details]
ccache.fish
Here is a script that works like /etc/profile.d/ccache.sh
But still, it is necessary to do manually:
$ source ccache.fish
I do not find any possibility to run the script automatically after a new user login to fish.
It seems that fish is ignoring /etc/profile.d completely and there's nothing to find about any similiar behaviour in fish documentation.
Created attachment 994294 [details]
Honor /etc/profile.d
Andy, please include the attached patch into fish package. If so, ccache could install it's own ccache.fish into /etc/profile.d, this works for me. Before I make a downstream change like this, I think I should get feedback from upstream: https://github.com/fish-shell/fish-shell/issues/1956 Upstream provides a patch for profile. Can you include that patch? From my reading of https://github.com/fish-shell/fish-shell/issues/1956 the implementation details are not yet decided. This message is a reminder that Fedora 21 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 21. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '21'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 21 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. Curiously enough, ccache worked in all of my recent rpmbuilds without any harms done from fish. Maybe rpmbuild now enforces bash for the execution of spec scriptlets? If yes, this bug is fixed at least for rpmbuild and in downstream Fedora. (In reply to Raphael Groner from comment #16) > Maybe rpmbuild now enforces bash for the execution of spec scriptlets? I think it has pretty much always done that unless specified otherwise in specfiles, but on the other hand I fail to see what this has to do with rpm/spec scriptlets in the first place. AFAIU this is a shell/profile(.d)/environment thing, not rpm/specfile one. (In reply to Ville Skyttä from comment #17) > (In reply to Raphael Groner from comment #16) > > Maybe rpmbuild now enforces bash for the execution of spec scriptlets? > > I think it has pretty much always done that unless specified otherwise in > specfiles, but on the other hand I fail to see what this has to do with > rpm/spec scriptlets in the first place. AFAIU this is a > shell/profile(.d)/environment thing, not rpm/specfile one. For the record, I call rpmbuild in a fish environment. Then rpmbuild executes some spec file to build a package with ccache in background enabled with bash profile settings. But you're right, it's more a general thing with fish configuration options, independently from rpmbuild only. I think this issue only exists if fish is a login shell -- otherwise fish inherits the ccache entry in PATH from the real login shell. Once all of the dust is settled in fish upstream, I'll encourage them to spin a release with the new config snippet layout and we can fix this for real. (In reply to Andy Lutomirski from comment #12) > Before I make a downstream change like this, I think I should get feedback > from upstream: > > https://github.com/fish-shell/fish-shell/issues/1956 https://github.com/fish-shell/fish-shell/commit/c1b384e5d3f2f46e7d7a1b41e31c7aadc1d9ce28 Andy, can you apply the upstream patch from comment #20? I tried. It either needs the "string" builtin to be backported or someone needs to write and test a variant that works on Fedora's version of fish. Presumably changing: set -l basename (string replace -r '^.*/' '' -- $file) to: set -l basename (basename $file) would work. OK, I did a backport and poked at it a bit. It seems to work, and it's building for all supported releases right now. We still need to figure out what package should own vendor_conf.d. See bug 1312594. fish-2.2.0-11.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-4d7b9d3d94 fish-2.2.0-11.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-cdbbc3e2c3 fish-2.2.0-11.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-cdbbc3e2c3 fish-2.2.0-11.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-4d7b9d3d94 fish-2.2.0-11.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report. fish-2.2.0-11.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report. fish-2.3.1-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-f400b76b0a fish-2.3.1-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-f524170748 fish-2.3.1-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-11c320ee6c fish-2.3.1-1.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-f400b76b0a fish-2.3.1-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-f524170748 fish-2.3.1-1.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-11c320ee6c fish-2.3.1-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report. fish-2.3.1-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report. fish-2.3.1-1.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report. |