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

Fix bourne shell compatibility issues #133

Merged
merged 2 commits into from
Feb 11, 2022
Merged

Fix bourne shell compatibility issues #133

merged 2 commits into from
Feb 11, 2022

Conversation

tobias-haenel
Copy link
Contributor

I faced some compatibility issues with jupyter-forward on Ubuntu 20.04 that are related to bourne shell. Please see the commit messages that I wrote for the details. The changes are only 2 lines of code.

The check jupyter status wasn't executed with a login shell. This results in ~/.profile or ~/.bash_profile not being sourced and ~/.local/bin not being in $PATH
The output redirection that is used in the command to launch Jupyter Lab isn't supported by the bourne shell, but only by bash (see https://www.ibm.com/docs/en/aix/7.1?topic=shell-input-output-redirection-in-bourne and https://www.gnu.org/software/bash/manual/html_node/Redirections.html). This results in an error on operating systems that don't symlink sh to bash (such as Ubuntu 20.04).
@andersy005 andersy005 added the enhancement New feature or request label Feb 11, 2022
@andersy005
Copy link
Member

Thank you for this addition, @tobias-haenel, and welcome to the project :) 🎉

@andersy005 andersy005 merged commit 2da167a into ncar-xdev:main Feb 11, 2022
@@ -204,7 +204,7 @@ def _launch_jupyter(self):
command = r'jupyter lab --no-browser --ip=\$(hostname -f)'
if self.notebook_dir:
command = f'{command} --notebook-dir={self.notebook_dir}'
command = f'{command} >& {self.log_file}'
command = f'{command} > {self.log_file} 2>&1'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm concerned that this change is not compatible with tcsh and is actually reintroducing a bug fixed in #67. @tobias-haenel what sort of error do you see if you add the -l argument but keep the >& notation?

@andersy005 we should try to figure out how to create a test suite for jupyter-forward to prevent regressions like this... I suspect it can't be fully automated, but we definitely need to make sure all PRs are compatible with both bash and tcsh before accepting them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants