OCaml Forge
Bugs
Search the entire project
This project's trackers
This project's tasks
This project's releases
This project's documents
This project's news
Project
People
Advanced search
Log In
New Account
Home
My Page
Projects
Code Snippets
OASIS
Summary
Activity
Tracker
Lists
Tasks
Docs
News
Files
Hudson
Detail: [#1239] Warning when linking an executable with a internal packed library
Bugs: Browse
|
Download .csv
|
Monitor
[#1239] Warning when linking an executable with a internal packed library
Date:
2012-12-11 21:44
Priority:
3
State:
Open
Submitted by:
Philippe Veber (
pveber
)
Assigned to:
Philippe Veber (pveber)
Due in version:
None
Product:
OASIS
Operating System:
None
Component:
None
Version:
v0.3.0~rc1
Severity:
None
Resolution:
Accepted As Bug
URL:
Summary:
Warning when linking an executable with a internal packed library
Detailed description
Compilation of the packedlib example issues a warning:
cochinois:~/oasis/examples/packedlib 22:36]$ocaml setup.ml -build
Finished, 1 target (0 cached) in 00:00:00.
+ ocamlfind ocamlc -g -linkpkg src/packedlib.cma src/packedlib.cmo test/main.cmo -o test/main.byte
File "src/packedlib.cmo", line 1:
Warning 31: files src/packedlib.cmo and src/packedlib.cma(Packedlib) both define a module named Packedlib
Finished, 21 targets (0 cached) in 00:00:00.
which is due to trying to compile main.ml adding both the cma and the cmo of the packed library. The cma is correct (and is added via the use_* tag, which is the intended behavior). Now I'm not sure why the cmo gets added. It seems to me that the module PackedLib is seen by ocamldep, then ocamlbuild sees the mlpack file and tries to be smart by adding the cmo automatically.
There is no problem when the packed library is findlib-installed, and this is only a warning but still. The only fix I see is in myocamlbuild.ml, refrain from adding the rule [use_foo => add foo.cma] when the library is packed.
Is there a better way to fix this issue?
Followup
Message
Date: 2012-12-15 17:52
Sender:
Philippe Veber
The problem can be fixed if a packedlib.mllib is generated along with the packedlib.mlpack file. It should only contain the name of the pack, here Packedlib.
A similar problem happens when compiling a packed library foo that depends on another internal library bar. Without a foo.mllib file, foo.cma will contain the pack (foo.cmo) but also all modules of bar it depends on. This problem is detailled in the branch issue-1239 of my repo:
https://github.com/pveber/oasis/tree/issue-1239
please look at the commits:
https://github.com/pveber/oasis/commit/090acd582b437d17249c9a0bca840c4706980f95
and
https://github.com/pveber/oasis/commit/f20b2685841e74a2ccbbe29196161510e40bb361
Attached Files:
Changes:
Field
Old Value
Date
By
Version
None
2012-12-15 17:52
pveber
Resolution
None
2012-12-15 17:52
pveber
assigned_to
none
2012-12-15 17:52
pveber
Product
None
2012-12-15 17:52
pveber