Skip to content

Commit

Permalink
Update OCaml requires/provides to ignore cmxs
Browse files Browse the repository at this point in the history
OCaml cmxs files are static libraries, which can be loaded at runtime
via the Dynlink module. They apparently do not provide any useful
runtime dependency information to be stored into the packages
Provides/Requires list. Therefore just skip them.

Adjust attr, remove extension and ELF magic
Adjust ocamldeps, do nothing with cmxs files.

Fixes: a6fe37c

Signed-off-by: Olaf Hering <[email protected]>
  • Loading branch information
olafhering authored and pmatilai committed Nov 10, 2021
1 parent 3c793a6 commit 89d5bf1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions fileattrs/ocaml.attr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%__ocaml_provides %{_rpmconfigdir}/ocamldeps.sh --provides
%__ocaml_requires %{_rpmconfigdir}/ocamldeps.sh --requires
%__ocaml_magic ^(ELF|Objective caml|OCaml) .*$
%__ocaml_path .(cma|cmi|cmo|cmx|cmxa|cmxs)$
%__ocaml_magic ^(Objective caml|OCaml) .*$
%__ocaml_path .(cma|cmi|cmo|cmx|cmxa)$
%__ocaml_flags magic_and_path
6 changes: 5 additions & 1 deletion scripts/ocamldeps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
# Implementations imported:
# HASH NAME_FROM_OTHER_MODULE
#
# cmxs files are recoqnized, but need to be ignored.
# They contain references of the interfaces and implementations
# compiled into them.
#
# The hash may contain just '-', in which case it is ignored.
#
# Output:
Expand Down Expand Up @@ -236,7 +240,7 @@ do
*.cmo) parse "${filename}" ;;
*.cmx) parse "${filename}" ;;
*.cmxa) parse "${filename}" ;;
*.cmxs) parse "${filename}" ;;
*.cmxs) ;;
*) continue ;;
esac
done
Expand Down

0 comments on commit 89d5bf1

Please sign in to comment.