Skip to content

Add for-pack to pack sources automatically#26

Open
rgrinberg wants to merge 1 commit intoocaml-omake:masterfrom
rgrinberg:for-pack-cmx
Open

Add for-pack to pack sources automatically#26
rgrinberg wants to merge 1 commit intoocaml-omake:masterfrom
rgrinberg:for-pack-cmx

Conversation

@rgrinberg
Copy link
Collaborator

Attempt to make packs easier to construct by adding the -for-pack flag
to pack sources.

However I end up getting strange things like this in my project though:

*** omake: finished reading OMakefiles (0.09 sec)
*** omake:
   These file are targeted separately, but appear as effects of a single rule.
   This is likely to lead to unpredictable behavior.
   targets:
      compiler/outcometree.cmi
         (File omake/OCaml.om: line 556, characters 1-12)
      compiler/outcometree.o (File omake/OCaml.om: line 911, characters 6-21)
      compiler/outcometree.cmx
         (File omake/OCaml.om: line 911, characters 6-21)
*** omake:
   These file are targeted separately, but appear as effects of a single rule.
   This is likely to lead to unpredictable behavior.
   targets:
      compiler/outcometree.cmo
         (File omake/OCaml.om: line 533, characters 0-11)
      compiler/outcometree.o (File omake/OCaml.om: line 911, characters 6-21)
      compiler/outcometree.cmx
         (File omake/OCaml.om: line 911, characters 6-21)
*** omake:
   These file are targeted separately, but appear as effects of a single rule.
   This is likely to lead to unpredictable behavior.
   targets:
      compiler/annot.cmi (File omake/OCaml.om: line 556, characters 1-12)
      compiler/annot.o (File omake/OCaml.om: line 911, characters 6-21)
      compiler/annot.cmx (File omake/OCaml.om: line 911, characters 6-21)
*** omake:
   These file are targeted separately, but appear as effects of a single rule.
   This is likely to lead to unpredictable behavior.
   targets:
      compiler/annot.cmo (File omake/OCaml.om: line 533, characters 0-11)
      compiler/annot.o (File omake/OCaml.om: line 911, characters 6-21)
      compiler/annot.cmx (File omake/OCaml.om: line 911, characters 6-21)

So I doubt this is the correct fix. It would be great if this was done properly however.

Attempt to make packs easier to construct by adding the -for-pack flag
to pack sources
@rgrinberg
Copy link
Collaborator Author

OK I fixed the above and it works. The only reason those $(BYTEDEPS) are there just so that those warnings go away. There's no need to pass -for-pack for bytecode objects and that's reflected in that we only add -for-pack to OCAMLOPTFLAGS

@rgrinberg
Copy link
Collaborator Author

@gerdstolpmann Ping? Anything I can do to improve this?

@rgrinberg
Copy link
Collaborator Author

@gerdstolpmann ping

@gerdstolpmann
Copy link
Collaborator

Frankly, I don't like the idea. So far OCamlPackage only affects linking, not compilation. This would be a fairly heavy change. It also breaks the concept that we take the values of the variables at the end of the OMakefile for compilation.

You could move that to a second function, e.g. OCamlCompileForPackage (or better name when you have an idea). That way it would be purely optional.

@rgrinberg
Copy link
Collaborator Author

That's fair, but I still think that creating a pack today with omake requires far too much ceremony. Do you have any other ideas on how to simplify this perhaps?

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.

2 participants