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

cohttp 0.11.0 fails to compile via opam #113

Closed
ericbmerritt opened this issue Apr 15, 2014 · 15 comments
Closed

cohttp 0.11.0 fails to compile via opam #113

ericbmerritt opened this issue Apr 15, 2014 · 15 comments

Comments

@ericbmerritt
Copy link

I figured this would be the best place to post. The latest release of cohttp in opam fails to compile consistently.

===== ERROR while upgrading to cohttp.0.11.0 =====
# opam-version 1.1.1
# os           linux
# command      make PREFIX=/home/ubuntu/.opam/system
# path         /home/ubuntu/.opam/system/build/cohttp.0.11.0
# compiler     system (4.01.0)
# exit-code    2
# env-file     /home/ubuntu/.opam/system/build/cohttp.0.11.0/cohttp-21252-fbcac7.env
# stdout-file  /home/ubuntu/.opam/system/build/cohttp.0.11.0/cohttp-21252-fbcac7.out
# stderr-file  /home/ubuntu/.opam/system/build/cohttp.0.11.0/cohttp-21252-fbcac7.err
### stdout ###
# ...[truncated]
# Warning: Module or module type Cohttp.Response not found
# Warning: Module or module type Cohttp.Request.S not found
# Warning: Module or module type Cohttp.Request not found
# Warning: Module type Cohttp.IO.S not found
# rm -rf async/cohttp_async.docdir
# mkdir -p async/cohttp_async.docdir
# /home/ubuntu/.opam/system/bin/ocamlfind ocamldoc -load async/cohttp_async_io.odoc -load async/cohttp_async.odoc -html -syntax camlp4o -d async/cohttp_async.docdir
# + /home/ubuntu/.opam/system/bin/ocamlfind ocamldoc -load async/cohttp_async_io.odoc -load async/cohttp_async.odoc -html -syntax camlp4o -d async/cohttp_async.docdir
# ocamlfind: Using -syntax, but no package is selected specifying a preprocessor as required for -syntax
# Command exited with code 2.
### stderr ###
# /bin/sh: 1: ocamlopt.opt: not found
# W: Cannot find source file matching module 'cohttp' in library cohttp
# W: Tests are turned off, consider enabling with 'ocaml setup.ml -configure --enable-tests'
# E: Failure("Command ''/usr/bin/ocamlbuild' async/cohttp_async.docdir/index.html -tag debug' terminated with error code 10")
# make: *** [doc] Error 1
@avsm
Copy link
Member

avsm commented Apr 15, 2014

# /bin/sh: 1: ocamlopt.opt: not found

Do you have the native code version of the native code compiler installed? That is, ocamlopt.opt. It should work without it, but it would be good to check if it work when ocamlopt.opt is actually available.

@ericbmerritt
Copy link
Author

Basically things are installed like this.

- name: Add ocaml ppa
  action: apt_repository repo="ppa:avsm/ppa"
          update_cache=yes

- name: make sure essential build tools are in place
  action: apt name={{ item }} state=latest
  with_items:
    - ocaml
    - opam
    - camlp4-extra

That is the equivelent of installing your ppa and running apt-get install ocaml and apt-get install opam. I take it there is another installation I need to be doing. I will check on that as soon as I get to a place that I can.

@avsm
Copy link
Member

avsm commented Apr 15, 2014

Yeah, if you install 'ocaml-native-compilers' then it'll work. However, this should not be required, so I will leave this bug open to fix it to work even when ocamlopt.opt is not available.

On 15 Apr 2014, at 19:27, Eric Merritt notifications@github.com wrote:

Basically things are installed like this.

  • name: Add ocaml ppa
    action: apt_repository repo="ppa:avsm/ppa"
    update_cache=yes
  • name: make sure essential build tools are in place
    action: apt name={{ item }} state=latest
    with_items:
    • ocaml
    • opam
    • camlp4-extra
      That is the equivelent of installing your ppa and running apt-get install ocaml and apt-get install opam. I take it there is another installation I need to be doing. I will check on that as soon as I get to a place that I can.


Reply to this email directly or view it on GitHub.

@rgrinberg
Copy link
Member

shouldn't you install a compiler with opam and not use the system compiler? I'm not sure how you'd drive opam to cleanly switch compilers via ansible however.

@avsm
Copy link
Member

avsm commented Apr 15, 2014

The system compiler should work fine with OPAM, as long as it's not upgraded after the OPAM initialization (but OPAM will detect this if the system compiler version changes)

On 15 Apr 2014, at 19:33, Rudi Grinberg notifications@github.com wrote:

shouldn't you install a compiler with opam and not use the system compiler? I'm not sure how you'd drive opam to cleanly switch compilers via ansible however.


Reply to this email directly or view it on GitHub.

@ericbmerritt
Copy link
Author

So should I need to install something extra to build cohttp?

On Tue, Apr 15, 2014 at 11:35 AM, Anil Madhavapeddy <
notifications@github.com> wrote:

The system compiler should work fine with OPAM, as long as it's not
upgraded after the OPAM initialization (but OPAM will detect this if the
system compiler version changes)

On 15 Apr 2014, at 19:33, Rudi Grinberg notifications@github.com wrote:

shouldn't you install a compiler with opam and not use the system
compiler? I'm not sure how you'd drive opam to cleanly switch compilers via
ansible however.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHubhttps://github.com/avsm/ocaml-cohttp/issues/113#issuecomment-40517605
.

@avsm
Copy link
Member

avsm commented Apr 15, 2014

apt-get install ocaml-native-compilers

On 15 Apr 2014, at 20:39, Eric Merritt notifications@github.com wrote:

So should I need to install something extra to build cohttp?

On Tue, Apr 15, 2014 at 11:35 AM, Anil Madhavapeddy <
notifications@github.com> wrote:

The system compiler should work fine with OPAM, as long as it's not
upgraded after the OPAM initialization (but OPAM will detect this if the
system compiler version changes)

On 15 Apr 2014, at 19:33, Rudi Grinberg notifications@github.com wrote:

shouldn't you install a compiler with opam and not use the system
compiler? I'm not sure how you'd drive opam to cleanly switch compilers via
ansible however.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHubhttps://github.com/avsm/ocaml-cohttp/issues/113#issuecomment-40517605
.


Reply to this email directly or view it on GitHub.

@avsm
Copy link
Member

avsm commented Apr 15, 2014

the cohttp travis script installs these, for completeness:
https://github.com/avsm/ocaml-cohttp/blob/master/.travis-ci.sh#L13

On 15 Apr 2014, at 20:42, Anil Madhavapeddy anil@recoil.org wrote:

apt-get install ocaml-native-compilers

On 15 Apr 2014, at 20:39, Eric Merritt notifications@github.com wrote:

So should I need to install something extra to build cohttp?

On Tue, Apr 15, 2014 at 11:35 AM, Anil Madhavapeddy <
notifications@github.com> wrote:

The system compiler should work fine with OPAM, as long as it's not
upgraded after the OPAM initialization (but OPAM will detect this if the
system compiler version changes)

On 15 Apr 2014, at 19:33, Rudi Grinberg notifications@github.com wrote:

shouldn't you install a compiler with opam and not use the system
compiler? I'm not sure how you'd drive opam to cleanly switch compilers via
ansible however.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHubhttps://github.com/avsm/ocaml-cohttp/issues/113#issuecomment-40517605
.


Reply to this email directly or view it on GitHub.

@ericbmerritt
Copy link
Author

This may have been a stupidity on my part, but is there any way to raise
this to users in opam? That is, its not quite obvious to an external user
that an opam package requires external, non-opam resources. This is true
for libraries as well as compilers. Is there a way to print out some
message on failure to tell the user 'we have requirement x and y you should
install those and try again' type of thing?

On Tue, Apr 15, 2014 at 12:42 PM, Anil Madhavapeddy <
notifications@github.com> wrote:

the cohttp travis script installs these, for completeness:
https://github.com/avsm/ocaml-cohttp/blob/master/.travis-ci.sh#L13

On 15 Apr 2014, at 20:42, Anil Madhavapeddy anil@recoil.org wrote:

apt-get install ocaml-native-compilers

On 15 Apr 2014, at 20:39, Eric Merritt notifications@github.com
wrote:

So should I need to install something extra to build cohttp?

On Tue, Apr 15, 2014 at 11:35 AM, Anil Madhavapeddy <
notifications@github.com> wrote:

The system compiler should work fine with OPAM, as long as it's not
upgraded after the OPAM initialization (but OPAM will detect this if
the
system compiler version changes)

On 15 Apr 2014, at 19:33, Rudi Grinberg notifications@github.com
wrote:

shouldn't you install a compiler with opam and not use the system
compiler? I'm not sure how you'd drive opam to cleanly switch
compilers via
ansible however.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub<
https://github.com/avsm/ocaml-cohttp/issues/113#issuecomment-40517605>
.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHubhttps://github.com/avsm/ocaml-cohttp/issues/113#issuecomment-40525052
.

@rgrinberg
Copy link
Member

@ericbmerritt

I think there's still a problem on our end here. We should allow users to install cohttp with only the bytecode compiled compiler (ocamlopt and not ocamlopt.opt).

avsm says we have a fallback: https://github.com/avsm/ocaml-cohttp/blob/master/Makefile#L13

but it's not working...

As a general tip though you still want to have the native compiler package since it will speed up compilation a lot usually.

@ericbmerritt
Copy link
Author

I just added it to our provisioning. I just didn't realize that it was needed and not installed.

Btw, I just installed ocaml-native-compiler and got the following error.

$> which ocamlopt.opt
/usr/bin/ocamlopt.opt

$> opam install cohttp
===== ERROR while installing cohttp.0.11.0 =====
# opam-version 1.1.1
# os           linux
# command      make PREFIX=/home/ubuntu/.opam/system
# path         /home/ubuntu/.opam/system/build/cohttp.0.11.0
# compiler     system (4.01.0)
# exit-code    2
# env-file     /home/ubuntu/.opam/system/build/cohttp.0.11.0/cohttp-4167-ffb3fd.env
# stdout-file  /home/ubuntu/.opam/system/build/cohttp.0.11.0/cohttp-4167-ffb3fd.out
# stderr-file  /home/ubuntu/.opam/system/build/cohttp.0.11.0/cohttp-4167-ffb3fd.err
### stdout ###
# ...[truncated]
# Warning: Module or module type Cohttp.Response not found
# Warning: Module or module type Cohttp.Request.S not found
# Warning: Module or module type Cohttp.Request not found
# Warning: Module type Cohttp.IO.S not found
# rm -rf async/cohttp_async.docdir
# mkdir -p async/cohttp_async.docdir
# /home/ubuntu/.opam/system/bin/ocamlfind ocamldoc -load async/cohttp_async_io.odoc -load async/cohttp_async.odoc -html -syntax camlp4o -d async/cohttp_async.docdir
# + /home/ubuntu/.opam/system/bin/ocamlfind ocamldoc -load async/cohttp_async_io.odoc -load async/cohttp_async.odoc -html -syntax camlp4o -d async/cohttp_async.docdir
# ocamlfind: Using -syntax, but no package is selected specifying a preprocessor as required for -syntax
# Command exited with code 2.
### stderr ###
# W: Cannot find source file matching module 'cohttp' in library cohttp
# W: Tests are turned off, consider enabling with 'ocaml setup.ml -configure --enable-tests'
# E: Failure("Command ''/usr/bin/ocamlbuild' async/cohttp_async.docdir/index.html -tag debug' terminated with error code 10")
# make: *** [doc] Error 1

@rayokota
Copy link

I get the same error as above after installing ocaml-native-compiler

@rgrinberg
Copy link
Member

it also fails for me :/

@rgrinberg
Copy link
Member

#114 fixes this i think

@avsm
Copy link
Member

avsm commented Apr 17, 2014

Fixed in cohttp 0.11.1, uploaded to opam

@avsm avsm closed this as completed Apr 17, 2014
@avsm avsm modified the milestone: 1.0 Stable API Nov 9, 2014
mseri pushed a commit to mseri/ocaml-cohttp that referenced this issue Jun 16, 2022
pythongen test: make pylint checks stricter
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

No branches or pull requests

4 participants