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

problem with ocamldep #2985

Closed
vicuna opened this issue Oct 8, 2001 · 4 comments
Closed

problem with ocamldep #2985

vicuna opened this issue Oct 8, 2001 · 4 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Oct 8, 2001

Original bug ID: 562
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Hi,

the following litte project compiles with both the bytecode
compiler and the optimizing compiler. However, the dependencies
generated by ocamldep are circular, such that

make clean
make native

fails.

Bye,

Hendrik


�‹��)‰Á;��íYmOÛ0�îWü+î���¦vNó&…?Ô…2¡µ�
?Ø'”�§ŠH“ª�–þû?ã¤�RVi
a�?Rýrw¶/µŸó¥M¼,zÝ�6gÉM׿Ÿ~î4�J j›&ÖØ2­¢¦V_Ô��jë�Õ©ahz‡jz¿otÀlÞ•:îï2o�ÐÉد»?Ù¡Y�¶áP»Hjû?önY�Ŭ¹5¨†Ûm�/í¿Ö·µÕþÓ>¶5ÃÂã�´9�^Æ�ß�2q�ãÑhxu°«�Í£“�j�x³8f¹Pþ�¸nM»ô‚@¨Ý³š2˜—ªº¦—Î3¡œœ]ÔÔ¨\�� ë3ã9�Êñ÷‹I]=»ÍÒ9!þ2c�ø½–‚W”\Â�d§�âªÐ�âÍvD�CÌ’�Ú¼Òæd§ò–O",7��A,gµ.>”
»ÊÉ©;º<�º“ñxrªÂÞ,Žx�‡Ð�#� bæ%8p1ƒn�Aº°Ç]Ä"âEÎ�¯ha‰roå ®NHïüòøøäjxî@�w“�K^ðO�ÅÓöøTÂO.ä]çÉ7�Ô]ÝU°uv<�|;ÇΗb$Ÿìo�æë?x"^�ŠÖQ�Ä÷7lõý¼5qÞ êñßãG¡Ñ5¶Ä��ö«ø¯›†Í㿆•Œÿ-€dË9��� J2B�¼�Bpx�º‡…ì­=”xMÔù_�Ø�×ØÆ�ÍZóߦ<ÿ7 K“üo�EÚ#²œ¨H^" E�ó8óA™/ìDÏ_Ër§JyJY™@9«?e*TÙÉxòOaóýßì�[ï�K{vÿë¶-ïÿV@RÜxøJžå�1Ë0�PrL�|�…Ê�r�>?&éû¾Pç¿ß>ÿùoƒOó�Ši€ä���ü�”ü÷�ó�*øïqþç’ûï�›ùÿöïÿ&•üo�ÏxÏßÿ§òýÿã�ÿù�[£)Àöûß®øß×�ÿMþÿŸäÿ룺ÿ÷÷É|?t¿Æc�G �å.Ãþô:
¯y0PB°TU�� ‰ÿ�¿�Hé'þ�(��----------------

@vicuna
Copy link
Author

vicuna commented Nov 26, 2001

Comment author: administrator

the following litte project compiles with both the bytecode
compiler and the optimizing compiler. However, the dependencies
generated by ocamldep are circular, such that

Right. In your examples, the two modules are mutually recursive, at
least formally. What this means is that you can't write your program
as a single monolithic compilation unit:

module B : sig type b = int val g: int -> int end
= struct open A type b = int let g (x : a) = x + 1 end
module A : sig type a = int val f: int -> int end
= struct open B type a = int let f (x : b) = (g x) + 1 end

because of the forward reference to A in B.

Now, the ocamlc and ocamlopt linkers implement a slightly relaxed
check for circular dependencies, where only value dependencies (not
type dependencies) are considered. But ocamldep uses a purely
syntactic dependency criterion that matches the "monolithic
compilation unit" view mentioned above.

In summary: I don't view this as a bug in ocamldep, but wish that
we'll make some progress in the future on the issue of mutual
recursion between compilation units, at which time ocamldep will have
to be changed accordingly.

Best regards,

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Nov 26, 2001

Comment author: administrator

The example indeed contains two mutually recursive compilation units, at least
formally, so ocamldep's behavior is correct.

@vicuna vicuna closed this as completed Nov 26, 2001
@vicuna
Copy link
Author

vicuna commented Dec 14, 2001

Comment author: administrator

Hi,

In summary: I don't view this as a bug in ocamldep, but wish that
we'll make some progress in the future on the issue of mutual
recursion between compilation units, at which time ocamldep will have
to be changed accordingly.

The problem is not related to recursive modules. It also occurs
in nonrecursive examples. Ocamldep makes native code modules
depend on other native code modules (instead of their compiled
interfaces). In the examples it generates a line

a.cmx: b.cmx a.cmi

This is wrong. It should be

a.cmx: b.cmi a.cmi

So I still view this as a bug, although in case there is no
recursion between the modules its effects are not very dramatic.

Bye,

Hendrik

@vicuna
Copy link
Author

vicuna commented Dec 14, 2001

Comment author: administrator

Hi,

On Fri, Dec 14, 2001 at 10:17:05AM +0100, tews@tcs.inf.tu-dresden.de wrote:

a.cmx: b.cmx a.cmi
This is wrong. It should be
a.cmx: b.cmi a.cmi

No, this is normal for native code: the generated code of a depends on the
generated code of b, for optimization reasons, if I remember well.

--
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/

@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant