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

Update/Add zsh shell #4849

Closed
3 of 9 tasks
nathanielford opened this issue Jan 9, 2022 · 3 comments
Closed
3 of 9 tasks

Update/Add zsh shell #4849

nathanielford opened this issue Jan 9, 2022 · 3 comments

Comments

@nathanielford
Copy link

nathanielford commented Jan 9, 2022

Tool name

zsh Shell Support in Ubuntu 20.04/latest

Tool license

GNU General Public Licence

Add or update?

  • Add
  • Update

Desired version

Whatever the latest is.

Approximate size

878288 bytes

Brief description of tool

zsh is a now-common shell that is the default on many dev machines (Catalina or later MacOS). It has differences in implementation from bash, the default shell in the current Ubuntu runner. This situation adds a layer of complexity for writing scripts, since they need to know which shell they're writing against.

This issue arose with the MacOS environment as well.

URL for tool's homepage

https://zsh.sourceforge.io/

Provide a basic test case to validate the tool's functionality.

#!/usr/bin/env zsh

if [[ $(command -v zsh) ]]; then
  echo "ZSH exists."
else 
  echo "ZSH isn't found."
  exit 1
fi

if [[ "$ZSH_NAME" == "zsh" ]]; then
  echo "ZSH seems to be being used as this shell."
  exit 0
else
  echo "ZSH is (probably) not the shell being used."
  exit 1
fi

Virtual environments affected

  • Ubuntu 18.04
  • Ubuntu 20.04
  • macOS 10.15
  • macOS 11
  • Windows Server 2016
  • Windows Server 2019
  • Windows Server 2022

Can this tool be installed during the build?

Running a build with the following stanza should install and make zsh executable:

jobs:
  test-zsh-install:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Install zsh
        run: sudo apt-get update; sudo apt-get install zsh
      - name: Zsh-huh
        run: |
          which zsh || echo "No which zsh"
          command -v zsh || echo "No command zsh"
          ls -la /usr/bin/zsh || echo "No zsh at /usr/bin"
          ls -la /bin/zsh || echo "No zsh at /bin/zsh"
      - name: Run a zsh script as proof
        run: .github/bin/zsh_proof.sh
        shell: /usr/bin/zsh{0}


### Tool installation time in runtime

~15-20 seconds on every job.

### Are you willing to submit a PR?

Potentially, yes. 
@miketimofeev
Copy link
Contributor

@nathanielford Hi!
We wouldn't like to pre-install zsh to the image and keep only the default ubuntu shell (bash). There was an issue regarding this already #264
I'm going to close the issue. Please feel free to contact us if you have any concerns.
Thank you!

@actions actions deleted a comment Jan 13, 2022
@actions actions deleted a comment Jan 13, 2022
@nathanielford
Copy link
Author

The issue you cite, #264 explicitly indicated we should open a separate ticket for Ubuntu support. I think because it deals only with the MacOS virtualenvironment support of zsh?

In any case, would it be possible for you to provide a reasoning for not including zsh as a shell option? Note that this request is simply to add the zsh shell, not to make it the default shell. You provide a perfectly reasonable method for changing the shell a script runs in, but having to re-install zsh on every job in order to use it is cumbersome for a <1MB binary, and you include a raft of other similar language-specific binaries. I ask this because, as a cicd dev, I get that there are a lot of concerns (additional upkeep on your end, an incompatibility somewhere in your build stack that would prevent you from delivering the same guarantees you do now, specific security issues) that might result in a 'no' answer - but should something change in the ecosystem that alleviated those concerns, I'd like to keep an eye on this so I could re-request it at an appropriate time.

Thank you for your attention to this request!

@miketimofeev
Copy link
Contributor

@nathanielford the main reason is maintenance concerns. We would like to support and install only those shells that are mentioned in the docs https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell
If there is support for zsh in the actions workflows then we will definitely add it to the images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants