| Summary: | Remote Build fails with "/bin/sh: declare: not found" on systems with dash (e.g. Ubuntu) | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] PTP | Reporter: | Roland Schulz <roland> | ||||
| Component: | Remote Tools | Assignee: | Greg Watson <g.watson> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | major | ||||||
| Priority: | P3 | ||||||
| Version: | 4.0.5 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Roland Schulz
Created attachment 184358 [details]
environment patch
Another alternative would be to remove the dependency on the shell at all. I noticed that ChannelSession provides a setEnv method that could be used instead. Can you see if this patch works for you? Great! This makes it work for dash on Ubuntu. org.eclipse.ptp.remotetools.internal.ssh.ControlChannel.open(IProgressMonitor) (line 86) still uses export. Otherwise I can't find any other bash specific constructs. But I'm not sure whether there are others I have missed (and don't show up in the small test I have done with Ubuntu). Unfortunately it looks like environment variables are disabled in sshd by default. Even when enabled, there are only a maximum of 128 vars allowed (in OpenSSH anyway). Looking at the different shells, it seems that dash, bash, zsh, ksh, and sh all support "export A=B C=D". I think the easiest option would be to use "export" instead of "declare". The only time this would fail would be if /bin/sh was a link to csh or tsch, but how likely is this? I haven't seen any machine with csh as /bin/sh (but I don't any Unix other than Linux). But according to http://jira.atlassian.com/browse/JRA-9102 the /bin/sh used in Solaris doesn't support export A=B. But it does support A=B, and then in the next line export A. Changed to use 'export "var=val"' for each variable in HEAD and 4.0. |