Skip to content

[poetry plugin] ensure initHook runs with /bin/sh #1553

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

Merged
merged 2 commits into from
Oct 12, 2023
Merged

Conversation

savil
Copy link
Collaborator

@savil savil commented Oct 12, 2023

Summary

A user is saying that the poetry plugin's init-hook was failing for them with Fish
shell. While the init-hook's command does work with modern fish shells, it fails
for older versions of fish.

In this case, the user is on Ubuntu whose package manager seems to use an older
version of fish.

Regardless, we can ensure the plugin's init-hooks work for consistently if we
ensure that they are written as posix scripts executed via /bin/sh. This PR
seeks to do that.

Fixes #1550

How was it tested?

cd examples/development/poetry/poetry_demo
devbox run run_test

Copy link
Collaborator Author

savil commented Oct 12, 2023

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@savil savil requested a review from mikeland73 October 12, 2023 04:40
Copy link
Contributor

@mikeland73 mikeland73 left a comment

Choose a reason for hiding this comment

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

Should all init hooks run in bash? I'm not sure we can claim devbox.json is portable if they don't.

@savil
Copy link
Collaborator Author

savil commented Oct 12, 2023

@mikeland73 currently, we state that the init-hooks run in the shell they are imported into. For devbox shell, this is the user's shell. For devbox scripts, this is sh.

I think changing init-hooks to always run in sh makes sense for portability. OTOH it would be a breaking change since some users may have written init-hooks that work just fine in their shells, but are not portable for sh. So, we need some plan for introducing this change gradually.

Perhaps this could be introduced as part of a move of init-hooks out of the "shell" field in devbox.json. If its an opt-in migration process, or a new devbox.json field, then we can insist that the new init-hooks field run in sh. Can discuss more IRL.

@savil savil merged commit 22fb40c into main Oct 12, 2023
@savil savil deleted the savil/poetry-plugin-fish branch October 12, 2023 13:01
@savil
Copy link
Collaborator Author

savil commented Oct 12, 2023

Ugh, this won't solve the problem. I misunderstood how sourcing works in shells. Will send an update to fix this for older fish shells.

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

Successfully merging this pull request may close these issues.

[Bug]: Incomplete fish support
2 participants