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

Option to add binaries to path #70

Open
JasonGross opened this issue Apr 15, 2021 · 10 comments
Open

Option to add binaries to path #70

JasonGross opened this issue Apr 15, 2021 · 10 comments
Labels
enhancement New feature or request

Comments

@JasonGross
Copy link

It would be nice if I could set some variable to true to have the opam environment added to path, so I don't need to opam exec everything. (It might be the case that running opam env >> $GITHUB_ENV is enough?)

@JasonGross
Copy link
Author

Actually, I think you need opam env | sed "s/'//g; s/; export .*//g" >> $GITHUB_ENV

@dra27
Copy link
Member

dra27 commented Apr 19, 2021

It's better to use opam exec (because it's explicit), but I agree that this would be a useful feature

@smorimoto smorimoto added the enhancement New feature or request label May 6, 2021
@smorimoto
Copy link
Member

I agree with @dra27, opam exec is better. We can get rid of this by passing --enable-shell-hook to opam init, but still the behavior is often unstable.

@smorimoto smorimoto added wontfix This will not be worked on and removed enhancement New feature or request labels May 16, 2021
@dra27
Copy link
Member

dra27 commented May 16, 2021

--enable-shell-hook won't work for the Windows shells (yet) - it only works for bash, etc.

@avsm avsm removed the wontfix This will not be worked on label May 21, 2021
@avsm
Copy link
Member

avsm commented May 21, 2021

I think @JasonGross posted the answer in his followup comment

opam env | sed "s/'//g; s/; export .*//g" >> $GITHUB_ENV

Modifying GITHUB_ENV is sufficient for future steps in the workflow to inherit the env, and it would simplify subsequent commands. It might be best to make this a non-default option in the workflow config though, in case it has unexpected consequences (such as an opam switch in a future step nullifying it).

@smorimoto
Copy link
Member

Of course I can add something to the action that handles this well, but I also think it would be smarter to add a better fix to opam after this summer.

@smorimoto
Copy link
Member

I just opened a PR to address this. Since v2 removed quite a lot of the differences between each platform, it was done in a fairly simple way.

@rr0gi
Copy link

rr0gi commented Feb 4, 2022

having opam environment set up would allow to not duplicate build commands in yml, but invoke same wrapper as developers are using (e.g. make)

@smorimoto
Copy link
Member

I feel that this is a more opam issue that needs to be fixed, but can it be fixed on the opam side? I actually use opam exec a lot locally as well as on CI, which is a bit odd.

@smorimoto smorimoto linked a pull request Jun 13, 2024 that will close this issue
@smorimoto
Copy link
Member

smorimoto commented Jun 13, 2024

Since the exact version of opam is available on all platforms, opam exec will no longer be needed by default in the next release! (in other words, v3!)
See #794

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 a pull request may close this issue.

5 participants