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

CentOS 7 Build issue #65

Closed
TheRealMattLear opened this issue Dec 20, 2022 · 12 comments
Closed

CentOS 7 Build issue #65

TheRealMattLear opened this issue Dec 20, 2022 · 12 comments

Comments

@TheRealMattLear
Copy link

Having difficulty installing ocurl on CentOS 7 (as a dependency of liquidsoap 2.1.3). Here's the results from a new blank switch (4.12.1)

bash-4.2$ opam install ocurl
The following actions will be performed:
  ∗ install ocamlfind    1.9.5 [required by ocurl]
  ∗ install conf-libcurl 2     [required by ocurl]
  ∗ install ocurl        0.9.2
===== ∗ 3 =====
Do you want to continue? [Y/n] y

<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ocurl.0.9.2] downloaded from cache at https://opam.ocaml.org/cache
[ocamlfind.1.9.5] downloaded from cache at https://opam.ocaml.org/cache

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
∗ installed conf-libcurl.2
∗ installed ocamlfind.1.9.5
[ERROR] The compilation of ocurl failed at "/usr/local/mediacp/.opam/opam-init/hooks/sandbox.sh build make".

#=== ERROR while compiling ocurl.0.9.2 ========================================#
# context     2.0.9 | linux/x86_64 | ocaml-base-compiler.4.12.1 | https://opam.ocaml.org#750de479
# path        ~/.opam/4.12.1/.opam-switch/build/ocurl.0.9.2
# command     ~/.opam/opam-init/hooks/sandbox.sh build make
# exit-code   2
# env-file    ~/.opam/log/ocurl-22838-326a35.env
# output-file ~/.opam/log/ocurl-22838-326a35.out
### output ###
# curl-helper.c:4256:9: note: #pragma message: libcurl does not provide CURLINFO_ACTIVESOCKET
# [...]
#          ^
# curl-helper.c:4270:9: note: #pragma message: libcurl does not provide CURLINFO_HTTP_VERSION
#  #pragma message("libcurl does not provide CURLINFO_HTTP_VERSION")
#          ^
# curl-helper.c: At top level:
# curl-helper.c:2511:13: warning: ‘ocaml_HTTP_VERSION’ defined but not used [-Wunused-function]
#  static long ocaml_HTTP_VERSION(long curl_version)
#              ^
# make[1]: *** [curl-helper.o] Error 2
# make[1]: Leaving directory `/usr/local/mediacp/.opam/4.12.1/.opam-switch/build/ocurl.0.9.2'
# make: *** [all] Error 2



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build ocurl 0.9.2
└─
┌─ The following changes have been performed
│ ∗ install conf-libcurl 2
│ ∗ install ocamlfind    1.9.5
└─
# Run eval $(opam env) to update the current shell environment

The former state can be restored with:
    opam switch import "/usr/local/mediacp/.opam/4.12.1/.opam-switch/backup/state-20221220003654.export"

I've attempted to pin the latest as suggested from #63 but this has resulted in another problem:

The following dependencies couldn't be met:
  - ocurl → curl >= 0.9.2
      no matching version
@ygrek
Copy link
Owner

ygrek commented Dec 20, 2022

what is libcurl version?

@ygrek
Copy link
Owner

ygrek commented Dec 20, 2022

can you share the full output file (output-file ~/.opam/log/ocurl-22838-326a35.out) because what is shown above is warnings, shouldn't be the reason of failure

@TheRealMattLear
Copy link
Author

Thanks for the response! libcurl 7.29.0, output below:

make[1]: Entering directory `/usr/local/mediacp/.opam/4.12.1/.opam-switch/build/ocurl.0.9.2'
make[1]: Leaving directory `/usr/local/mediacp/.opam/4.12.1/.opam-switch/build/ocurl.0.9.2'
make[1]: Entering directory `/usr/local/mediacp/.opam/4.12.1/.opam-switch/build/ocurl.0.9.2'
ocamlc.opt -c -g -bin-annot curl.mli -o curl.cmi
ocamlc.opt -c -g -bin-annot curl.ml -o curl.cmo
ocamlc.opt -c -ccopt "-g -O2   -DHAVE_CONFIG_H -Wall -Wundef" curl-helper.c
In file included from /usr/local/mediacp/.opam/4.12.1/lib/ocaml/caml/alloc.h:23:0,
                 from curl-helper.c:25:
/usr/local/mediacp/.opam/4.12.1/lib/ocaml/caml/misc.h:40:7: warning: "_MSC_VER" is not defined [-Wundef]
 #elif _MSC_VER >= 1310
       ^
/usr/local/mediacp/.opam/4.12.1/lib/ocaml/caml/misc.h:67:7: warning: "_MSC_VER" is not defined [-Wundef]
 #elif _MSC_VER >= 1500
       ^
/usr/local/mediacp/.opam/4.12.1/lib/ocaml/caml/misc.h:110:7: warning: "_MSC_VER" is not defined [-Wundef]
 #elif _MSC_VER >= 1500
       ^
/usr/local/mediacp/.opam/4.12.1/lib/ocaml/caml/misc.h:127:7: warning: "_MSC_VER" is not defined [-Wundef]
 #elif _MSC_VER >= 1500
       ^
In file included from curl-helper.c:26:0:
/usr/local/mediacp/.opam/4.12.1/lib/ocaml/caml/memory.h:332:7: warning: "_MSC_VER" is not defined [-Wundef]
 #elif _MSC_VER >= 1500
       ^
curl-helper.c:1269:1: error: unknown type name ‘curl_sslbackend’
 curl_sslbackend sslBackendMap[] = {
 ^
In file included from curl-helper.c:23:0:
curl-helper.c: In function ‘handle_XFERINFOFUNCTION’:
curl-helper.c:1552:45: error: ‘CURLOPT_XFERINFOFUNCTION’ undeclared (first use in this function)
     result = curl_easy_setopt(conn->handle, CURLOPT_##name##FUNCTION, cb_##name##suffix); \
                                             ^
curl-helper.c:1559:31: note: in expansion of macro ‘SETOPT_FUNCTION_’
 #define SETOPT_FUNCTION(name) SETOPT_FUNCTION_(name,FUNCTION)
                               ^
curl-helper.c:1568:1: note: in expansion of macro ‘SETOPT_FUNCTION’
 SETOPT_FUNCTION( XFERINFO)
 ^
curl-helper.c:1552:45: note: each undeclared identifier is reported only once for each function it appears in
     result = curl_easy_setopt(conn->handle, CURLOPT_##name##FUNCTION, cb_##name##suffix); \
                                             ^
curl-helper.c:1559:31: note: in expansion of macro ‘SETOPT_FUNCTION_’
 #define SETOPT_FUNCTION(name) SETOPT_FUNCTION_(name,FUNCTION)
                               ^
curl-helper.c:1568:1: note: in expansion of macro ‘SETOPT_FUNCTION’
 SETOPT_FUNCTION( XFERINFO)
 ^
curl-helper.c:1554:45: error: ‘CURLOPT_XFERINFODATA’ undeclared (first use in this function)
     result = curl_easy_setopt(conn->handle, CURLOPT_##name##DATA, conn); \
                                             ^
curl-helper.c:1559:31: note: in expansion of macro ‘SETOPT_FUNCTION_’
 #define SETOPT_FUNCTION(name) SETOPT_FUNCTION_(name,FUNCTION)
                               ^
curl-helper.c:1568:1: note: in expansion of macro ‘SETOPT_FUNCTION’
 SETOPT_FUNCTION( XFERINFO)
 ^
curl-helper.c: In function ‘caml_curl_easy_getinfo’:
curl-helper.c:4256:9: note: #pragma message: libcurl does not provide CURLINFO_ACTIVESOCKET
 #pragma message("libcurl does not provide CURLINFO_ACTIVESOCKET")
         ^
curl-helper.c:4270:9: note: #pragma message: libcurl does not provide CURLINFO_HTTP_VERSION
 #pragma message("libcurl does not provide CURLINFO_HTTP_VERSION")
         ^
curl-helper.c: At top level:
curl-helper.c:2511:13: warning: ‘ocaml_HTTP_VERSION’ defined but not used [-Wunused-function]
 static long ocaml_HTTP_VERSION(long curl_version)
             ^
make[1]: *** [curl-helper.o] Error 2
make[1]: Leaving directory `/usr/local/mediacp/.opam/4.12.1/.opam-switch/build/ocurl.0.9.2'
make: *** [all] Error 2

@TheRealMattLear
Copy link
Author

Happy new year! Do you have any thoughts about this error?

@ygrek
Copy link
Owner

ygrek commented Jan 27, 2023

please check if building from git master works

@TheRealMattLear
Copy link
Author

Cloning and pinning seems to result in a curl dependency issue with CentOS Linux release 7.9.2009 (Core), not sure if I'm doing something wrong here?

bash-4.2$ opam switch create 4.12.1;
...
bash-4.2$ git clone https://github.com/ygrek/ocurl.git;
Cloning into 'ocurl'...
remote: Enumerating objects: 1583, done.
remote: Counting objects: 100% (158/158), done.
remote: Compressing objects: 100% (55/55), done.
remote: Total 1583 (delta 126), reused 118 (delta 103), pack-reused 1425
Receiving objects: 100% (1583/1583), 1.17 MiB | 0 bytes/s, done.
Resolving deltas: 100% (1122/1122), done.
bash-4.2$ cd ocurl/
bash-4.2$ opam pin .;
This will pin the following packages: ocurl, curl. Continue? [Y/n] Y
[ocurl.0.9.2] synchronised from git+file:///usr/local/mediacp/ocurl#master
[WARNING] ocurl's opam file has uncommitted changes, using the versioned one
ocurl is now pinned to git+file:///usr/local/mediacp/ocurl#master (version 0.9.2)
Package curl does not exist, create as a NEW package? [Y/n] Y
[curl.~dev] synchronised from git+file:///usr/local/mediacp/ocurl#master
curl is now pinned to git+file:///usr/local/mediacp/ocurl#master (version ~dev)
The following dependencies couldn't be met:
  - ocurl → curl >= 0.9.2
      no matching version

[NOTE] Pinning command successful, but your installed packages may be out of sync.

@Russsgithub
Copy link

Russsgithub commented Feb 2, 2023

Similar issues here.

libcurl version 7.68 on Debian bullseye. ....... edit ....... This actually seems to be a Mint install as a vm not debian ( not my computer )

The opam package gives this error.

[ERROR] The compilation of conf-libcurl failed at "/home/russ/.opam/opam-init/hooks/sandbox.sh build curl-config --libs".

=== ERROR while compiling conf-libcurl.2 =====================================
 context     2.0.5 | linux/x86_64 | ocaml-base-compiler.4.14.1 | https://opam.ocaml.org#3644be38
 path        ~/.opam/4.14.1/.opam-switch/build/conf-libcurl.2
 command     ~/.opam/opam-init/hooks/sandbox.sh build curl-config --libs
 exit-code   1
 env-file    ~/.opam/log/conf-libcurl-51282-e7966f.env
 output-file ~/.opam/log/conf-libcurl-51282-e7966f.out
 
 bwrap: execvp curl-config: No such file or directory


┌─ The following actions failed
│ λ build conf-libcurl 2
└─ 
╶─ No changes have been performed

Using the latest git code I get this.

[ocurl.0.9.2] no changes from git+file:///home/russ/ocurl#master

Sorry, no solution found: there seems to be a problem with your request.

No solution found, exiting

@TheRealMattLear
Copy link
Author

So sorry to bump this but just wondering if this is something that could still be resolved?

@AxisNL
Copy link

AxisNL commented Apr 18, 2023

Any news here? Running into the same issues as Matthew above. My C++ is non-existent, and I'd rather not manually patch code retrieved from repositories by people way smarter than me ;)

@ygrek
Copy link
Owner

ygrek commented Apr 23, 2023

bwrap: execvp curl-config: No such file or directory

this is unrelated, it means libcurl4-*-dev package is not installed

@TheRealMattLear
Copy link
Author

TheRealMattLear commented Jul 27, 2023

If i pin ocurl to master then i see a dependency issue. Seems to me that it's expecting curl to return a version greater than 0.9.2 but instead its getting ~dev, and failing.

[root@liquidsoap-test ocurl]# opam pin .
[WARNING] Running as root is not recommended
This will pin the following packages: curl, ocurl. Continue? [Y/n] Y
[NOTE] Package curl is already pinned to git+file:///root/ocurl#master (version ~dev).
curl is now pinned to git+file:///root/ocurl#master (version ~dev)
ocurl is now pinned to git+file:///root/ocurl#master (version 0.9.2)

[ERROR] Package conflict!
  * Missing dependency:
    - curl >= 0.9.2
    no matching version

[NOTE] Pinning command successful, but your installed packages may be out of sync.

If i edit the ocurl.opam file, remove the curl version constraint and then install curl first (separately to ocurl) then everything seems to install and work successfully.

  1. Remove dep constraint from ocurl.opam
opam-version: "2.0"
name: "ocurl"
maintainer: "[email protected]"
homepage: "https://ygrek.org/p/ocurl"
license: "MIT"
authors: [ "Lars Nilsson" "ygrek" ]
dev-repo: "git+https://github.com/ygrek/ocurl.git"
bug-reports: "https://github.com/ygrek/ocurl/issues"
build: [
]
depends: [
  "curl"
]
synopsis: "Transitional dummy package: ocurl -> curl"
description: "Use `opam install curl`"
  1. opam pin -y -n --working-dir .
  2. opam install curl;
  3. opam install ocurl

In any other order, or installing curl togethor with ocurl fails with the version matching problem.

Any thoughts?

@ygrek
Copy link
Owner

ygrek commented Feb 10, 2024

OP issue with CentOS is fixed I believe.
opam pin issue (with the workaround that works) is tracked in #74
Thanks for reports and investigations!

@ygrek ygrek closed this as completed Feb 10, 2024
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