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: add a repro for #10582 #10599

Merged
merged 3 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
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
9 changes: 9 additions & 0 deletions test/blackbox-tests/test-cases/mdx-stanza/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,12 @@
(deps
(package mdx))
(alias all-mdx-tests))

(cram
(applies_to shared-libraries)
(enabled_if
(= %{system} linux))
(deps
%{bin:gcc}
%{bin:ar}
(package mdx)))
47 changes: 47 additions & 0 deletions test/blackbox-tests/test-cases/mdx-stanza/shared-libraries.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
mdx supports dependencies referencing shared libraries.

See #10582.

$ cat > dune-project << EOF
> (lang dune 3.15)
> (name dune_mdx_test)
> (using mdx 0.4)
> EOF

$ cat > dune << EOF
> (library
> (name public_lib)
> (foreign_archives test))
>
> (rule
> (deps test.c)
> (targets libtest.a dlltest.so)
> (action
> (progn
> (run gcc -c -fPIC test.c -o test.o)
> (run gcc test.o -shared -o dlltest.so)
> (run ar rcs libtest.a test.o))))
>
> (mdx
> (libraries public_lib))
> EOF

$ touch README.md

$ cat > public_lib.ml << EOF
> let foo bar = bar + 1
> EOF

$ cat > test.c << EOF
> int add(int a, int b) {
> return a + b;
> }
> EOF

$ dune runtest
File "dune", lines 14-15, characters 0-29:
14 | (mdx
15 | (libraries public_lib))
Fatal error: cannot load shared library dlltest
Reason: dlltest.so: cannot open shared object file: No such file or directory
[1]
Loading