FS#64523 - [devtools] offload-build expects a posix compliant shell on the server

Attached to Project: Arch Linux
Opened by Filipe Laíns (FFY00) - Friday, 15 November 2019, 22:17 GMT
Last edited by Kristian (klausenbusk) - Saturday, 03 June 2023, 18:06 GMT
Task Type Bug Report
Category Arch Projects
Status Closed
Assigned To Pierre Schmitz (Pierre)
Levente Polyak (anthraxx)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:


Steps to reproduce:
- Change shell to a non posix compliant shell (ex. fish) in the target server

This task depends upon

Closed by  Kristian (klausenbusk)
Saturday, 03 June 2023, 18:06 GMT
Reason for closing:  Upstream
Additional comments about closing:  Please report upstream if this is still relevant: https://gitlab.archlinux.org/archlinux/d evtools.
Comment by Filipe Laíns (FFY00) - Friday, 15 November 2019, 22:19 GMT
This got submitted before I finished writing.

Description:
In line 94 of offload-build we ssh into the target server and run a set of posix commands. If the default shell is not posix compliant this will fail.

Steps to reproduce:
- Change shell to a non posix compliant shell (ex. fish) in the target server
- Invoke offload-build
Comment by Eli Schwartz (eschwartz) - Sunday, 17 November 2019, 00:21 GMT
I'm not sure what to say about this, since attempting to write a fish-compliant script would surely result in it not being compatible with POSIX shells either. Should we also try to support powershell? How should we detect "the remote server uses X shell" anyway?

When I write scripts, I write them to expect a POSIX environment specifically because it is meant to be portable. This includes things which are intended to be sourced into, say, /etc/profile in order to use it... or in this case, run via ssh. I'm not sure it makes sense to try to support everyone's unconventional personal shell outside of that?

My understanding is this shortcoming is known and expected by fish users, who therefore start fish by execing it in their .bashrc.
Comment by morganamilo (morganamilo) - Tuesday, 19 November 2019, 05:07 GMT
Maybe you can run everything through /bin/sh? Seems as the system's shell should always be posix, regardless of the user's.
Comment by Eli Schwartz (eschwartz) - Tuesday, 19 November 2019, 05:13 GMT
No. ssh is already running a complex command via, essentially, /bin/bash -c '....' or in the reporter's case, /bin/fish -c '....', and running

/bin/fish -c '/bin/sh -c "...."'

is not really going to help anything, but it will be nightmarish to try to get quoting right.

Loading...