Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: demonstrate bug depending on package that installs directories #7220

Merged
merged 1 commit into from
Mar 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Allow directories to be installable

$ mkdir a b prefix
$ cat >a/dune-project <<EOF
> (lang dune 3.5)
> (package (name foo))
> (using directory-targets 0.1)
> EOF
$ cat >a/dune <<EOF
> (install
> (dirs rules/bar)
> (section share))
> EOF
$ mkdir a/rules
$ cat >a/rules/dune <<EOF
> (rule
> (target (dir bar))
> (deps (sandbox always))
> (action (bash "mkdir -p %{target}/baz && touch %{target}/{x,y,z} && touch %{target}/baz/{a,b}")))
> EOF
$ dune build --root=a foo.install
Entering directory 'a'
Leaving directory 'a'

$ cat a/_build/install/default/lib/foo/dune-package
(lang dune 3.8)
(name foo)
(sections (lib .) (share ../../share/foo))
(files (lib (META dune-package)) (share (bar)))
$ dune install --root a --prefix $PWD/prefix --display short
Installing $TESTCASE_ROOT/prefix/lib/foo/META
Installing $TESTCASE_ROOT/prefix/lib/foo/dune-package
Installing $TESTCASE_ROOT/prefix/share/foo/bar/baz/a
Installing $TESTCASE_ROOT/prefix/share/foo/bar/baz/b
Installing $TESTCASE_ROOT/prefix/share/foo/bar/x
Installing $TESTCASE_ROOT/prefix/share/foo/bar/y
Installing $TESTCASE_ROOT/prefix/share/foo/bar/z

$ cat > b/dune-project <<EOF
> (lang dune 3.5)
> EOF
$ cat > b/dune <<EOF
> (alias (name foo) (deps (package foo)))
> EOF

$ OCAMLPATH=$PWD/prefix/lib/:$OCAMLPATH dune build --root=b @foo --display=short
Entering directory 'b'
Error: File unavailable:
$TESTCASE_ROOT/prefix/share/foo/bar
This is not a regular file (S_DIR)
-> required by alias foo in dune:1
Leaving directory 'b'
[1]