Skip to content

Option to add binaries to path #70

Open

Description

@JasonGross

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?)

Activity

  1. JasonGross commented on Apr 15, 2021

    @JasonGross
    Author

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

  2. dra27 commented on Apr 19, 2021

    @dra27
    Member

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

  3. smorimoto commented on May 16, 2021

    @smorimoto
    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.

  4. added
    wontfixThis will not be worked on
    and removed
    enhancementNew feature or request
    on May 16, 2021
  5. dra27 commented on May 16, 2021

    @dra27
    Member

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

  6. removed
    wontfixThis will not be worked on
    on May 21, 2021
  7. avsm commented on May 21, 2021

    @avsm
    Member

    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).

  8. smorimoto commented on May 21, 2021

    @smorimoto
    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.

  9. smorimoto commented on Jun 24, 2021

    @smorimoto
    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.

  10. rr0gi commented on Feb 4, 2022

    @rr0gi

    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)

  11. smorimoto commented on Dec 6, 2023

    @smorimoto
    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.

  12. linked a pull request that will close this issueAdd initial support for opam 2.2 on Windows #794on Jun 13, 2024
  13. smorimoto commented on Jun 13, 2024

    @smorimoto
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions