Skip to content

Commit 21df154

Browse files
authored
Merge pull request #40 from tmcgilchrist/fixes
Add Github url to help text
2 parents f17c42c + 11cddd9 commit 21df154

File tree

4 files changed

+23
-6
lines changed

4 files changed

+23
-6
lines changed

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
opam-compiler
22
=============
33

4-
A WIP opam plugin to manage compiler installations.
4+
An opam plugin to manage compiler installations.
55

66
It can be used to create switches from various sources such as the main
77
repository, ocaml-multicore, or a local directories. It can use tag names,
@@ -16,17 +16,20 @@ compiler in place.
1616
Installing
1717
----------
1818

19-
This is an opam plugin. Once installed, it will be available globally using
20-
`opam compiler ARGS`. To install it, pin it to get a development version:
19+
This is an [opam plugin](https://opam.ocaml.org/doc/Manual.html#Plugins).
2120

22-
opam pin add opam-compiler 'git+https://github.com/emillon/opam-compiler.git'
21+
Once installed, it will be available globally using `opam compiler ARGS`.
22+
To install it, either run `opam install opam-compiler` to use the opam-repository
23+
version or pin it to get a development version:
24+
25+
opam pin add opam-compiler 'git+https://github.com/ocaml-opam/opam-compiler.git'
2326

2427
Creating a switch
2528
-----------------
2629

2730
`opam compiler create` is a wrapper around `opam switch create` that will use a
28-
custom. The documentation can be found [here](doc/create.txt), but as an
29-
example, the following is recognized:
31+
custom OCaml compiler. The documentation can be found [here](doc/create.txt), but as an
32+
example, the following is recognised:
3033

3134
# Use this pull request number
3235
opam compiler create '#1234'
@@ -51,3 +54,6 @@ which will create a vanilla compiler. It is possible to override this:
5154

5255
# Just build the bytecode compiler from a pull request
5356
opam compiler create '#1234' --configure-command "./configure --disable-native-compiler"
57+
58+
# Build the native compiler with flambda and frame pointers
59+
opam compiler create '#1234' --configure-command "./configure --enable-flambda --enable-frame-pointers"

doc/create.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ DESCRIPTION
1919
Github pull request (short form)
2020
#number (repo defaults to "ocaml/ocaml")
2121

22+
Github url
23+
https://github.com/user/repo/pull/1
24+
2225
ARGUMENTS
2326
SOURCE (required)
2427
Where to fetch the compiler.

lib/cli.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ module Create = struct
131131
`I
132132
( "Github pull request (short form)",
133133
"#number (repo defaults to \"ocaml/ocaml\")" );
134+
`I ("Github url", "https://github.com/user/repo/pull/1");
134135
]
135136

136137
let term =

test/cram/create.t

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ Github PR numbers are also accepted:
1919
Run: OPAMCLI=2.0 opam pin add --switch ocaml-ocaml-1234 --yes ocaml-variants git+https://github.com/user-ocaml-ocaml-1234/repo-ocaml-ocaml-1234#branch-ocaml-ocaml-1234
2020
Run: OPAMCLI=2.0 opam switch set-base --switch ocaml-ocaml-1234 ocaml-variants
2121

22+
Github source urls are also accepted:
23+
24+
$ opam-compiler create --dry-run 'https://github.com/ocaml/ocaml/pull/10831'
25+
Run: OPAMCLI=2.0 opam switch create ocaml-ocaml-10831 --empty --description "[opam-compiler] ocaml/ocaml#10831 - Title of ocaml-ocaml-10831"
26+
Run: OPAMCLI=2.0 opam pin add --switch ocaml-ocaml-10831 --yes ocaml-variants git+https://github.com/user-ocaml-ocaml-10831/repo-ocaml-ocaml-10831#branch-ocaml-ocaml-10831
27+
Run: OPAMCLI=2.0 opam switch set-base --switch ocaml-ocaml-10831 ocaml-variants
28+
2229
An explicit configure step can be passed:
2330

2431
$ opam-compiler create --dry-run USER/REPO:BRANCH --configure-command "./configure --enable-x"

0 commit comments

Comments
 (0)