|
| 1 | +# Homebrew tap instructions |
| 2 | + |
| 3 | +CBMC archives versions into a tap which you can use to quickly download and |
| 4 | +build various historical versions. |
| 5 | + |
| 6 | +The tap is available at https://github.com/diffblue/homebrew-cbmc. |
| 7 | + |
| 8 | +Any version installed from the tap will need to be built from source locally. |
| 9 | + |
| 10 | +## Managing `brew tap`-based CBMC installations |
| 11 | + |
| 12 | +* Add the CBMC tap using the following command: |
| 13 | + |
| 14 | + ```sh |
| 15 | + $ brew tap diffblue/cbmc |
| 16 | + ``` |
| 17 | + |
| 18 | +* Install any of the available CBMC versions in the following manner: |
| 19 | + |
| 20 | + ```sh |
| 21 | + $ brew install diffblue/cbmc/ [email protected] |
| 22 | + ``` |
| 23 | + |
| 24 | +* To remove the version of CBMC installed you need to issue |
| 25 | + |
| 26 | + ```sh |
| 27 | + $ brew remove diffblue/cbmc/ [email protected] |
| 28 | + ``` |
| 29 | + |
| 30 | +* To remove the tap altogether, you need to issue |
| 31 | + |
| 32 | + ```sh |
| 33 | + $ brew untap diffblue/cbmc |
| 34 | + ``` |
| 35 | + |
| 36 | +## CBMC maintainer instructions |
| 37 | + |
| 38 | +* You can clone the [CBMC tap](https://github.com/diffblue/homebrew-cbmc) |
| 39 | + locally by issuing: |
| 40 | + |
| 41 | + ```sh |
| 42 | + $ brew tap diffblue/cbmc |
| 43 | + ``` |
| 44 | + |
| 45 | + That instruction is going to clone the above tap repository locally. |
| 46 | + Afterwards, you can proceed with installing the formulas present, |
| 47 | + edit them, etc. |
| 48 | + |
| 49 | + If you wish to set up a new tap for any reason, you can |
| 50 | + use `brew tap-new` like the following example: |
| 51 | + |
| 52 | + ```sh |
| 53 | + $ brew tap-new <developer>/homebrew_cbmc |
| 54 | + ``` |
| 55 | + |
| 56 | +* For any edit, the second step is to `cd` into the repository. |
| 57 | + To do that easily, it's best to ask Homebrew to give you the |
| 58 | + location of the repository: |
| 59 | + |
| 60 | + ```sh |
| 61 | + $ cd $(brew --repo diffblue/cbmc) |
| 62 | + ``` |
| 63 | + |
| 64 | +* You can extract versions of CBMC previously available in `homebrew/core` |
| 65 | + to the tap with the following instruction: |
| 66 | + |
| 67 | + ```sh |
| 68 | + $ brew extract cbmc diffblue/cbmc --version=<ver> |
| 69 | + ``` |
| 70 | + |
| 71 | + For example `$ brew extract cbmc diffblue/cbmc --version=5.54.0` will |
| 72 | + have as an end result a new file under `Formula/[email protected]` that will |
| 73 | + contain the formula that we had submitted for that version of CBMC in the |
| 74 | + `homebrew/core` repository. |
| 75 | + |
| 76 | +* If you want to edit a specific version formula, you can do that by issueing |
| 77 | + |
| 78 | + ```sh |
| 79 | + |
| 80 | + ``` |
| 81 | + |
| 82 | + with the appropriate version tag. This will open the formula on the default |
| 83 | + editor in your system to allow you to make changes. |
| 84 | + |
| 85 | + These changes are only going to be reflected locally - but you can `cd` to the |
| 86 | + repository, commit and then push to the tap (this is allowed only for people |
| 87 | + who have permission to push to the tap - mainly, the Diffblue open source team). |
| 88 | + |
| 89 | +## Notes |
| 90 | + |
| 91 | +* Bootstrapping the repository with `brew tap --new` created two github actions |
| 92 | + `.github/workflows/publish.yml` and `.github/workflows/tests.yml` which we are |
| 93 | + not using at the moment but could serve to make future automation easier. |
| 94 | + |
| 95 | +## Known Limitations |
| 96 | + |
| 97 | +* Different CBMC versions can co-exist in the same machine, but homebrew needs |
| 98 | + a symbolic link to be established because of how it manages the `$PATH` and |
| 99 | + installation directories for binaries. |
| 100 | +* If already have a version of CBMC from the tap installed, and you want to |
| 101 | + install another version, then you need to take an extra step after installation |
| 102 | + to setup the appropriate symlinks by using the `brew link` instruction: |
| 103 | + |
| 104 | + ```sh |
| 105 | + $ cbmc --version # version installed by brew |
| 106 | + 5.54.0 |
| 107 | + $ brew install diffblue/cbmc/ [email protected] |
| 108 | + $ brew link --overwrite [email protected] |
| 109 | + $ cbmc --version |
| 110 | + 5.55.0 |
| 111 | + ``` |
0 commit comments