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

Update project.mak #129

Merged
merged 1 commit into from
Jan 29, 2023
Merged

Update project.mak #129

merged 1 commit into from
Jan 29, 2023

Conversation

atupone
Copy link
Contributor

@atupone atupone commented Jan 25, 2023

I suppose that -native is not good for ocamldep.
depend will not output dependency for bytecode.

See log at https://881129.bugs.gentoo.org/attachment.cgi?id=832035

I suppose that -native is not good for ocamldep. 
depend will not output dependency for bytecode.

See log at https://881129.bugs.gentoo.org/attachment.cgi?id=832035
@xavierleroy
Copy link
Contributor

It might be a good idea to call ocamldep without -native for platforms where the native-code compiler ocamlopt is not available.

But I don't think this is related to the failure referenced in your message, since ocamlopt is available. It looks more like a case of missing dependencies (maybe not those generated by ocamldep) causing a parallel build to fail occasionally, but this is hard to track down.

If you see a reason why ocamldep -native could be the culprit, can you explain in more details?

@atupone
Copy link
Contributor Author

atupone commented Jan 26, 2023

Well, at gentoo, it is possible to generate both native and bytecode.

Maybe that is the problem.

However I tested in this way

on the line
MLSRC=...

I put the zarith_version.ml at the end of the line

and then build fails with

Error: Unbound module Zarith_version

Removing the -native flag it seems ok

I'm not so good at ocaml, maybe there is a better solution

@antoinemine
Copy link
Collaborator

I also use Gentoo, but I must admit that I install OCaml libraries using opam exclusively, not ebuilds.

I'm not sure why it fails in your case. You have ocamlopt in your USE and ocamlopt present on your system.
Can you show the depend file generated by ocamldep?

@atupone
Copy link
Contributor Author

atupone commented Jan 28, 2023

doing make depend with -native generate:

big_int_Z.cmx : \
    z.cmx \
    big_int_Z.cmi
big_int_Z.cmi : \
    z.cmi
q.cmx : \
    z.cmx \
    q.cmi
q.cmi : \
    z.cmi
z.cmx : \
    zarith_version.cmx \
    z.cmi
z.cmi :
zarith_version.cmx :

doing it without -native generate:

big_int_Z.cmo : \
    z.cmi \
    big_int_Z.cmi
big_int_Z.cmx : \
    z.cmx \
    big_int_Z.cmi
big_int_Z.cmi : \
    z.cmi
q.cmo : \
    z.cmi \
    q.cmi
q.cmx : \
    z.cmx \
    q.cmi
q.cmi : \
    z.cmi
z.cmo : \
    zarith_version.cmo \
    z.cmi
z.cmx : \
    zarith_version.cmx \
    z.cmi
z.cmi :
zarith_version.cmo :
zarith_version.cmx :

However in the project.mak I see that HASOCAMLOPT is only adding some target to TOBUILD.

To me this make is building byte code always, and if ocamlopt is there, it is building also native code

@xavierleroy
Copy link
Contributor

Thanks a lot for the additional info. It turns out I had the wrong mental image of what ocamldep -native does, and you're right that the dependencies it generates look insufficient for a bytecode-only or bytecode+native build. Since I see no downside to removing -native, let me merge your PR and thank you again for the feedback and the explanations.

Copy link
Contributor

@xavierleroy xavierleroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

@xavierleroy xavierleroy merged commit e67bccb into ocaml:master Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants