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

Allow specifying version in brew dependency #36

Open
nickthecook opened this issue Aug 21, 2020 · 2 comments
Open

Allow specifying version in brew dependency #36

nickthecook opened this issue Aug 21, 2020 · 2 comments

Comments

@nickthecook
Copy link
Owner

nickthecook commented Aug 21, 2020

Looks like brew just uses git to pull packages and build them, and ops could check out a specific commit hash or branch:

https://stackoverflow.com/questions/39187812/homebrew-how-to-install-older-versions

dependencies:
  brew:
    - tflint@311029c24de3de608e78afe0ee4f2413ea7a792b # this is tflint release 0.18.0 in brew's formulae

Usage of @

Using the @ might be tricky, because there are actually some brew packages that have names with @ in them to denote versions, e.g.:

$ pwd
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
$ ls Formula/openssl*
Formula/[email protected]

Option 1

ops could look for a package like this, and only try to use it as a git ref if a package with that name doesn't already exist in Homebrew. This might be too much trouble.

Option 2

Another option is to allow an expanded format of the depedency:

dependencies:
  brew:
    -
      name: tflint
      git_ref: 311029c24de3de608e78afe0ee4f2413ea7a792b
    - [email protected]

One brew dependency there is a hash, and one is a string. This also might be too much trouble.

Option 3

A third option is to use a character other than @. While ruby uses @, pip uses ==, and apt uses =. It might not be counterintuitive for developers to use =.

@nickthecook
Copy link
Owner Author

Will probably go with Option 3. Could use =, like pip, or /, because that seems more intuitive (a package has many versions).

@nickthecook
Copy link
Owner Author

Turns out it's very hard to implement this with Homebrew, compared to apt or pip.

apt is done now. apk will probably be next. pip can include this when it's added in #30.

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

No branches or pull requests

1 participant