Skip to content

Commit a5ce4e5

Browse files
authored
Merge pull request #6817 from NlightNFotis/homebrew_tap
Add new documentation for homebrew tap
2 parents 2110147 + 761f7fb commit a5ce4e5

File tree

3 files changed

+134
-6
lines changed

3 files changed

+134
-6
lines changed

README.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,34 @@ For different linux environments, you have these choices:
6262

6363
### macOS
6464

65-
For macOS there is a [Homebrew](https://brew.sh) package
66-
[available](https://formulae.brew.sh/formula/cbmc). Once you have installed
67-
Homebrew, simply run
65+
For macOS there is a package available in [Homebrew/core](https://formulae.brew.sh/formula/cbmc).
66+
Assuming you have homebrew installed, you can run
6867

69-
brew install cbmc
68+
```sh
69+
$ brew install cbmc
70+
```
7071

71-
to install cbmc, or if you already have it installed via homebrew
72+
to install CBMC, or if you already have it installed via homebrew
7273

73-
brew upgrade cbmc
74+
```sh
75+
$ brew upgrade cbmc
76+
```
7477

7578
to get an up-to-date version.
7679

80+
Homebrew will always update formulas to their latest version available, so you may
81+
periodically see an upgraded version of CBMC being downloaded regardless of whether
82+
you explicitly requested that or not. If you would rather this didn't happen, you
83+
can pin the CBMC version with:
84+
85+
```sh
86+
$ brew pin cbmc
87+
```
88+
89+
If instead of the latest version, you would want to install a historic version, you
90+
can do so with a [homebrew tap](https://github.com/diffblue/homebrew-cbmc) that we
91+
maintain. Instructions for that are available in the [documentation](doc/ADR/homebrew_tap.md)
92+
7793
Report bugs
7894
===========
7995

doc/ADR/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ of the system and the surrounding infrastructure.
99
## Release & Packaging
1010

1111
* [Release Process](release_process.md)
12+
* [Homebrew tap](homebrew_tap.md)

doc/ADR/homebrew_tap.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
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+
$ brew edit [email protected]
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

Comments
 (0)