[opam-devel] Using binaries

Louis Gesbert louis.gesbert at ocamlpro.com
Sat Jan 23 12:00:56 GMT 2016


Le samedi 23 janvier 2016, 01:01:56 Edgar Aroutiounian a écrit :
> Okay.
> 
> I have my url file looking like:
> 
> archive:"https://github.com/fxfactorial/ocamlios64/archive/v1.0.tar.gz"
> checksum:”9bdb96ca81a08cabaec686b90cfcd338"
> 
> and my opam file:
> 
> opam-version:"1"
> maintainer:"edgar.factorial at gmail.com"
> build:[
>   "./install.sh" "%{prefix}%"
> ]

This should be `install:` rather than `build:`; and `opam-version: "1"` is 
old. Please refer to
  http://opam.ocaml.org/doc/Manual.html#opam

for up-to-date documentation.
But that's not the issue that's causing the problem, Opam would still accept 
it.

Opam does copy the contents of files/ into the unpacked tarball directory, 
and runs all commands from there. A return code of 127 indicates that the 
shell didn't find the file to execute, though -- so I would guess something 
got mixed up in installing your new metadata:

- is the package pinned (which is the recommended way of testing) ? In this 
case, the metadata from the repo may be masked locally. See `opam show ocaml-
ios64 --where` to see the location of the metadata used by Opam.

- did you `opam update` ?

- if your repository is under version control, did you commit the new files ?

Hope this helps

Louis Gesbert - OCamlPro

> 
> remove:[
>   ["./remove.sh" "%{prefix}%"]
> ]
> 
> depends :[
>   "ocamlfind" {>= "1.5.4"}
> ]
> 
> available: [ ocaml-version = "4.02.3”]
> 
> 
> and my install.sh which is under the files directory,
> 
> #!/bin/sh -e
> 
> PREFIX="$1"
> 
> echo "Hello World”
> 
> 
> And when I try to install this with my local repo I get:
> 
> opam install ocaml-ios
> The following actions will be performed:
>   ∗  install ocaml-ios64 4.02.3               [required by ocaml-ios]
>   ∗  install ocaml-ios   4.02.3
> ===== ∗  2 =====
> Do you want to continue ? [Y/n] y
> 
> =-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=
>  🐫 [ocaml-ios64.4.02.3]
> https://github.com/fxfactorial/ocamlios64/archive/v1.0.tar.gz downloaded
> 
> =-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=
>  🐫 [ERROR] The compilation of ocaml-ios64 failed at "./install.sh
> /Users/Edgar/.opam/ios_coding". Processing  1/2: [ocaml-ios64: ./remove.sh]
> #=== ERROR while installing ocaml-ios64.4.02.3
> ================================# # opam-version 1.2.2
> # os           darwin
> # command      ./install.sh /Users/Edgar/.opam/ios_coding
> # path         /Users/Edgar/.opam/ios_coding/build/ocaml-ios64.4.02.3
> # compiler     4.02.3
> # exit-code    127
> # env-file    
> /Users/Edgar/.opam/ios_coding/build/ocaml-ios64.4.02.3/ocaml-ios64-46180-c6
> 1e7b.env # stdout-file 
> /Users/Edgar/.opam/ios_coding/build/ocaml-ios64.4.02.3/ocaml-ios64-46180-c6
> 1e7b.out # stderr-file 
> /Users/Edgar/.opam/ios_coding/build/ocaml-ios64.4.02.3/ocaml-ios64-46180-c6
> 1e7b.err
> 
> 
> 
> =-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=
>  🐫 The following actions were aborted
>   ∗  install ocaml-ios 4.02.3
> The following actions failed
>   ∗  install ocaml-ios64 4.02.3
> No changes have been performed
> 
> 
> I’m confused now. Does the install.sh script assume that its in the
> directory of the unzipped tarball? Does opam expect the build or install
> step to do something? Does it expect a build and install step at all? How
> about for remove?
> 
> -Edgar
> 
> > On Jan 22, 2016, at 4:37 AM, Louis Gesbert <louis.gesbert at ocamlpro.com>
> > wrote:
> > 
> > The package/compiler descriptions fetch an archive and run custom 
commands
> > for build and install, so although the standard repo only provides source
> > packages, you are free to build from source or just download and install
> > a precompiled binary: Opam itself is agnostic in that regard.
> > 
> > Hope this helps,
> > Louis Gesbert - OCamlPro
> > 
> > Le jeudi 21 janvier 2016, 09:42:45 Edgar Aroutiounian a écrit :
> >> Greetings all,
> >> 
> >> I’m trying to wrap up a compiler for opam, specifically this one
> >> 
> >> http://psellos.com/ocaml/compile-to-iphone.html
> >> <http://psellos.com/ocaml/compile-to-iphone.html>
> >> 
> >> Its an ocaml compiler ready for iOS. Right now I have the repo here,
> >> 
> >> https://github.com/fxfactorial/opam-ios
> >> <https://github.com/fxfactorial/opam-ios>
> >> 
> >> and its essentially in the same vein as:
> >> 
> >> https://github.com/whitequark/opam-android
> >> <https://github.com/whitequark/opam-android>
> >> 
> >> but I very much would like to avoid having to do though the process of
> >> building etc. Does opam not have to just be given a binary? This would
> >> make
> >> it much easier methinks.
> >> 
> >> -Edgar Aroutiounian


More information about the opam-devel mailing list