Skip to content

Commit 2bc14fc

Browse files
committedMay 28, 2024
Reproduction case to show that installing deps to the stdlib breaks
Signed-off-by: Marek Kubica <marek@tarides.com>
1 parent faf50b8 commit 2bc14fc

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed
 
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
A package that installs itself into the ocaml stdlib should work.
2+
3+
$ . ./helpers.sh
4+
5+
$ mkdir nondune
6+
$ cd nondune
7+
$ cat > nondune.ml <<EOF
8+
> let main () = print_endline "Nondune"
9+
> let () = main ()
10+
> EOF
11+
$ ocamlc -c nondune.ml
12+
$ ocamlc -o nondune.cma -a nondune.cmo
13+
$ cat > nondune.install <<EOF
14+
> lib_root: [
15+
> "nondune.cma" {"ocaml/nondune.cma"}
16+
> "nondune.cmi" {"ocaml/nondune.cmi"}
17+
> ]
18+
> lib: [
19+
> "META" {"META"}
20+
> ]
21+
> EOF
22+
$ cat > META <<EOF
23+
> directory = "^"
24+
> archive(byte) = "nondune.cma"
25+
> EOF
26+
$ cat > nondune.opam <<EOF
27+
> opam-version: "2.0"
28+
> build: [
29+
> [true]
30+
> ]
31+
> EOF
32+
$ cd ..
33+
34+
With this project set up, lets depend on it.
35+
36+
$ mkdir foo
37+
$ cd foo
38+
$ mkrepo
39+
$ solve_project <<EOF
40+
> (lang dune 3.15)
41+
> (pin
42+
> (url "file://$PWD/../nondune")
43+
> (package (name nondune)))
44+
> (package
45+
> (name foo)
46+
> (depends nondune))
47+
> EOF
48+
Solution for dune.lock:
49+
- nondune.dev
50+
$ cat > dune <<EOF
51+
> (executable
52+
> (name foo)
53+
> (modules foo)
54+
> (libraries nondune)
55+
> (modes byte))
56+
> EOF
57+
$ cat > foo.ml <<EOF
58+
> let () = Nondune.main ()
59+
> EOF
60+
$ dune exec ./foo.exe 2>&1 | grep -o "Unbound module Nondune"
61+
Unbound module Nondune

0 commit comments

Comments
 (0)