xenserver / buildroot

Package buildroot for xen-api and related packages
44 stars 29 forks source link

Error: Cannot find file biniou.cmxa #680

Open ghost opened 8 years ago

ghost commented 8 years ago

build xenserver on CentOS 7:

console info:

 ERROR: Exception(_build/SRPMS/ocaml-qmp-0.9.2-2.el7.centos.src.rpm) Config(epel-7-x86_64) 0 minutes 16 seconds
ERROR: Command failed. See logs for output.
 # bash --login -c /usr/bin/rpmbuild -bb --target x86_64 --nodeps  /builddir/build/SPECS/ocaml-qmp.spec 
make: *** [_build/RPMS/x86_64/ocaml-qmp-0.9.2-2.el7.centos.x86_64.rpm]  error 1

the build.log:

[CMD]: /usr/bin/ocamldep.opt -I lib_test -I dist/build/autogen -modules lib_test/messages.ml
  Messages depends on Arg,Filename,List,OUnit,Printf,Qmp,String
  Messages internally depends on
[1 of 1] Compiling Messages
  [CMD]: /usr/bin/ocamlopt.opt -I dist/build/messages -I dist/build/autogen -I lib_test -I /usr/lib64/ocaml -I /usr/lib64/ocaml/easy-format -I /usr/lib64/ocaml/biniou -I /usr/lib64/ocaml/yojson -I dist/build/lib-qmp -I /usr/lib64/ocaml/oUnit -I /usr/lib64/ocaml/oUnit -bin-annot -o dist/build/messages/messages.cmx -c lib_test/messages.ml
schedule finished: #processes=1 max_concurrency=1
  compilation order: Messages
  self deps: qmp
package deps: [unix,easy-format,biniou,yojson,qmp,oUnit.advanced,oUnit]
Linking executable dist/build/messages/messages
  [CMD]: /usr/bin/ocamlopt.opt -o dist/build/messages/messages -I dist/build/messages -I /usr/lib64/ocaml -I /usr/lib64/ocaml/easy-format -I /usr/lib64/ocaml/biniou -I /usr/lib64/ocaml/yojson -I dist/build/lib-qmp -I /usr/lib64/ocaml/oUnit -I /usr/lib64/ocaml/oUnit unix.cmxa easy_format.cmx biniou.cmxa yojson.cmx qmp.cmxa oUnitAdvanced.cmxa oUnit.cmxa -cclib -Ldist/build/lib-qmp messages.cmx
File "_none_", line 1:
Error: Cannot find file biniou.cmxa
make: *** [build] Error 7

Should I build the biniou.cmxa by myself? Give me the hand~~~ T_T

simonjbeaumont commented 8 years ago

Should I build the biniou.cmxa by myself?

No, it's probably a missing dependency from the the ocaml-qmp spec file. It looks like ocaml-qmp is using obuild which we've seen issues with (with ocaml-qmp actually) when it comes to dependency analysis. I'll see if I can upgrade it to use Oasis and bump a new release. I think biniou is a dependency of yojson now and it may be that our ocaml-yojson spec file needs to make that a Requires, rather than a BuildRequires.

simonjbeaumont commented 8 years ago

https://github.com/xapi-project/ocaml-qmp/pull/5

ghost commented 8 years ago

Tks : )

simonjbeaumont commented 8 years ago

There's also this: https://github.com/xenserver/buildroot/pull/681

But I'm not sure it will solve the issue. A definite improvement to move from obuild to oasis even if it doesn't.

simonjbeaumont commented 8 years ago

They're both merged now. Not sure if they've solved your issue because I haven't rebuilt buildroot from scratch again yet but you can try if you get there before me.

ghost commented 8 years ago

so sad,it don't work: log like that

File "_none_", line 1:
Error: Cannot find file /usr/lib64/ocaml/biniou/biniou.cmxa
Command exited with code 2.
E: Failure("Command ''/usr/bin/ocamlbuild' lib/qmp.cma lib/qmp.cmxa lib/qmp.a lib/qmp.cmxs cli/cli.native -tag debug' terminated with error code 10")
Jboggs-world commented 8 years ago

I'm receiving the same error on CentOS 6.7. The good news is that this is fixed on the xapi side as opam install xapi now builds correctly. Unsure how to translate that over to buildroot though.

simonjbeaumont commented 8 years ago

@Zahatric when you install via opam it installs all the dependencies and the opam packages do not distinguish between base and devel subpackages. Also transitive dependencies are picked up by default. In buildroot we use mock for each package we build so we only install the dependencies specified in the spec file. If there's a hidden dependency that isn't exposed through the transitive closure then we're boned.

It looks like ocaml-qmp is only using yojson so it should be enough to depend on ocaml-yojson-devel but I think that the Yojson module actually requires biniou to be present. It could be an issue with the way we're packaging yojson?

We could work around this by adding a dependency on biniou to qmp but it feels a bit of a hack.

@euanh, any ideas?

Jboggs-world commented 8 years ago

Tried adding: BuildRequires: ocaml-biniou-devel to ocaml.qmp.spec

then got new errors relating to an ocaml-easy-format dependency.

Added: BuildRequires: ocaml-easy-format-devel to ocaml.qmp.spec

This made a little progress but surfaced more errors that prevent ocaml-qmp from building.

cp: cannot create regular file '/usr/local/bin/cli': Permission denied E: Failure("Command ''cp' '/builddir/build/BUILD/ocaml-qmp-0.9.3/_build/cli/cli.native' '/usr/local/bin/cli'' terminated with error code 1")

Log follows:

Building target platforms: x86_64 Building for target x86_64 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.4moovx

simonjbeaumont commented 8 years ago

Sounds like these libraries might just be a bit pants. I'm not a packaging expert but it sounds like we're in a bit of a dependency mess. From the final error you mention it sounds like you might have cracked the dependency problem now the make install target failed for qmp.

Good progress. I'll try and find some time tomorrow to look at that. Unless you solve it in the meantime.

-- simon.beaumont@citrix.commailto:simon.beaumont@citrix.com (via iPhone)

On 9 Nov 2015, at 18:17, Zahatric notifications@github.com<mailto:notifications@github.com> wrote:

Tried adding: BuildRequires: ocaml-biniou-devel to ocaml.qmp.spec

then got new errors relating to an ocaml-easy-format dependency.

Added: BuildRequires: ocaml-easy-format-devel to ocaml.qmp.spec

This made a little progress but surfaced more errors that prevent ocaml-qmp from building.

cp: cannot create regular file '/usr/local/bin/cli': Permission denied E: Failure("Command ''cp' '/builddir/build/BUILD/ocaml-qmp-0.9.3/_build/cli/cli.native' '/usr/local/bin/cli'' terminated with error code 1")

Log follows:

Building target platforms: x86_64 Building for target x86_64 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.4moovx

— Reply to this email directly or view it on GitHubhttps://github.com/xenserver/buildroot/issues/680#issuecomment-155144694.

samoht commented 8 years ago

Would maybe be easier to get the metadata from opam ...

simonjbeaumont commented 8 years ago

@samoht I'm not sure. I think it might be a packaging error in buildroot for one of the packages up the chain. We can see in the opam file for qmp that it doesn't need a direct dependency on biniou: https://github.com/ocaml/opam-repository/blob/19aff7aa98c0762ccebc57b59313bcda564611e7/packages/qmp/qmp.0.9.1/opam

I suspect maybe there's something missing in our ocaml-yojson-devel package. Unless I misunderstood your suggestion?