File tree Expand file tree Collapse file tree 1 file changed +72
-0
lines changed
test/blackbox-tests/test-cases/pkg Expand file tree Collapse file tree 1 file changed +72
-0
lines changed Original file line number Diff line number Diff line change 1+ This test checks what happens when you lock with default directory then change
2+ workspace to use a custom lock directory.
3+
4+ $ . ./ helpers. sh
5+ $ mkrepo
6+ $ mkpkg foo
7+ $ add_mock_repo_if_needed
8+
9+ $ cat > dune-project << EOF
10+ > (lang dune 3.21 )
11+ > (package
12+ > (name myproject)
13+ > (depends foo))
14+ > EOF
15+
16+ Lock with default directory name :
17+
18+ $ dune pkg lock
19+ Solution for dune. lock
20+
21+ Dependencies common to all supported platforms:
22+ - foo. 0. 0. 1
23+
24+ Now change the workspace to use a custom lock directory:
25+
26+ $ cat > dune-workspace << EOF
27+ > (lang dune 3.21 )
28+ > (lock_dir
29+ > (path custom. lock)
30+ > (repositories mock))
31+ > (repository
32+ > (name mock)
33+ > (url " file://$ PWD /mock-opam-repository" ))
34+ > EOF
35+
36+ $ cat > dune << EOF
37+ > (executable
38+ > (public_name bar))
39+ > EOF
40+
41+ $ cat > bar. ml << EOF
42+ > let () = print_endline " hello from bar" ;;
43+ > EOF
44+
45+ $ dune exec -- bar
46+ Error: No rule found for default /.lock /dune .lock (context _private)
47+ - > required by lock directory environment for context "default "
48+ - > required by base environment for context "default "
49+ - > required by loading findlib for context "default "
50+ - > required by creating installed environment for "default "
51+ [1 ]
52+
53+ Now try with a context stanza that references the custom lock directory with a
54+ context stanza :
55+
56+ $ cat > dune-workspace <<EOF
57+ > (lang dune 3.21 )
58+ > (context
59+ > (default
60+ > (lock_dir custom. lock)))
61+ > (lock_dir
62+ > (path custom. lock)
63+ > (repositories mock))
64+ > (repository
65+ > (name mock)
66+ > (url " file://$ PWD /mock-opam-repository" ))
67+ > EOF
68+
69+ This is working as intended . The error is not relevant here .
70+
71+ $ dune exec -- bar
72+ hello from bar
You can’t perform that action at this time.
0 commit comments