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

missing post-message for sqlite3-ocaml #50

Closed
samoht opened this issue Sep 16, 2012 · 13 comments
Closed

missing post-message for sqlite3-ocaml #50

samoht opened this issue Sep 16, 2012 · 13 comments

Comments

@samoht
Copy link
Member

samoht commented Sep 16, 2012

No description provided.

@avsm
Copy link
Member

avsm commented Oct 1, 2012

Should there be a base-sqlite3? I just ran into a failure with orm, and it was because the ocaml-sqlite3 was expecting pkg-config to be installed (which it isnt by default on MacOS X). So I did brew install pkg-config sqlite3 and got the latest versions, and that worked: it would be good to suggest this to users automatically.

@yminsky
Copy link
Contributor

yminsky commented Sep 29, 2013

This still fails for me, even trying Anil's trick. In particular, I
got this. Obviously, brew isn't really happy to install sqlite3, and
there's some more flag-tweaking to do to make this work in OPAM.

So, what's next?

~ $ brew install pkg-config sqlite3
Warning: pkg-config-0.28 already installed
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/sqlite-3.8.0.2.mountain_lion.bottle.tar.gz
Already downloaded: /Library/Caches/Homebrew/sqlite-3.8.0.2.mountain_lion.bottle.tar.gz
==> Pouring sqlite-3.8.0.2.mountain_lion.bottle.tar.gz
==> Caveats
This formula is keg-only: so it was not symlinked into /usr/local.

Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.

OS X provides an older sqlite3.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/sqlite/lib
    CPPFLAGS: -I/usr/local/opt/sqlite/include

==> Summary
 /usr/local/Cellar/sqlite/3.8.0.2: 9 files, 2.0M
~ $ opam install sqlite3-ocaml
The following actions will be performed:
 - install sqlite3-ocaml.2.0.4
1 to install | 0 to reinstall | 0 to upgrade | 0 to downgrade | 0 to remove

=-=-= Installing sqlite3-ocaml.2.0.4 =-=-=
The archive for sqlite3-ocaml.2.0.4 is in the local cache.
Extracting /Users/yminsky/.opam/archives/sqlite3-ocaml.2.0.4+opam.tar.gz.
Building sqlite3-ocaml.2.0.4:
  ocaml setup.ml -configure
  ocaml setup.ml -build
  ocaml setup.ml -install
The compilation of sqlite3-ocaml.2.0.4 failed.
Uninstalling sqlite3-ocaml.2.0.4:
  ocamlfind remove sqlite3


==== ERROR [while installing sqlite3-ocaml.2.0.4] ====
# opam-version    1.0.0
# os              darwin
# command         ocaml setup.ml -build
# path            /Users/yminsky/.opam/4.01.0/build/sqlite3-ocaml.2.0.4
# exit-code       1
# env-file        /Users/yminsky/.opam/4.01.0/build/sqlite3-ocaml.2.0.4/sqlite3-ocaml-ffb3fd.env
# stdout-file     /Users/yminsky/.opam/4.01.0/build/sqlite3-ocaml.2.0.4/sqlite3-ocaml-ffb3fd.out
# stderr-file     /Users/yminsky/.opam/4.01.0/build/sqlite3-ocaml.2.0.4/sqlite3-ocaml-ffb3fd.err
### stdout ###
/Users/yminsky/.opam/4.01.0/bin/ocamlopt.opt unix.cmxa -I /Users/yminsky/.opam/4.01.0/lib/ocaml/ocamlbuild /Users/yminsky/.opam/4.01.0/lib/ocaml/ocamlbuild/ocamlbuildlib.cmxa myocamlbuild.ml /Users/yminsky/.opam/4.01.0/lib/ocaml/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
Failure: pkg-config failed for cflags.
### stderr ###
Package sqlite3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `sqlite3.pc'
to the PKG_CONFIG_PATH environment variable
No package 'sqlite3' found
E: Failure("Command ''/Users/yminsky/.opam/4.01.0/bin/ocamlbuild' lib/libsqlite3_stubs.a lib/dllsqlite3_stubs.so lib/sqlite3.cma lib/sqlite3.cmxa lib/sqlite3.a lib/sqlite3.cmxs -tag debug' terminated with error code 2")

'opam install sqlite3-ocaml' failed.

@yminsky
Copy link
Contributor

yminsky commented Sep 29, 2013

FWIW, the following trick, stolen from the Ocsigen website, does it:

ln -s /usr/local/Cellar/sqlite/3.8.0.2/lib/pkgconfig/sqlite3.pc /usr/local/lib/pkgconfig/sqlite3.pc

Obviously, you'll need to change the path if you upgrade to a new sqlite, so the whole thing is fairly brittle.

@avsm
Copy link
Member

avsm commented Sep 29, 2013

I added

export PKG_CONFIG_PATH=/usr/local//Cellar/sqlite/3.8.0.2/lib/pkgconfig

to my ~/.bash_profile. No need for symlinks then, but there's clearly something broken with the Homebrew pkg

@hhugo
Copy link
Contributor

hhugo commented Sep 29, 2013

@avsm
Copy link
Member

avsm commented Sep 29, 2013

I think we should be able to use the new OPAM 1.1 post-install messages field for this. @samoht @AltGr, can this be constrained on a per-OS basis so that we could display post-install messages for MacOS X only?

@samoht
Copy link
Member Author

samoht commented Sep 29, 2013

These use the exact same filter as all the other commands (but as two new local variables in scope success and failure to indicate the build status. So yes, you can filter the messages per OS (or per ocaml version).

@brabalan
Copy link

I just encountered this problem, and it took me a while to find this page. Could you add a notification at the end of the build failure pointing to this issue?

@AltGr
Copy link
Member

AltGr commented Jun 27, 2014

You can do something like:

post-messages: [
  "Could not get system sqlite3: you may need to adjust your config..." { failure & (os = "darwin") }
]

I believe the parens are necessary with 1.1

@dsheets
Copy link
Member

dsheets commented Jul 6, 2015

This should be fixed and preferably with an automatic solution (not just a message).

smondet/trakeva#16 is the kind of annoying downstream breakage that results. If someone has easy test access to OS X/homebrew, please help out!

P.S. nearly 3 years to fix a packaging bug is a bit long...

@dsheets
Copy link
Member

dsheets commented Jul 6, 2015

Oh, I should also mention that this error came up while testing revdep updates for lwt 2.5.0 (#4365 and #4390) so if we want to test that thoroughly, this should be fixed.

@rleonid
Copy link
Contributor

rleonid commented Nov 4, 2015

@dsheets In regard to this issue, would it be possible to pass arguments (via environment variables?) to opam targets? I can't seem to find anything to this effect, but I would like to be able to say opam install sqlite3.brewed and then modify the sqlite3-ocaml build accordingly.

@samoht
Copy link
Member Author

samoht commented Sep 27, 2016

sqlite3-ocaml now compiles with the right flags to avoid this.

@samoht samoht closed this as completed Sep 27, 2016
gasche added a commit to gasche/opam-repository that referenced this issue Nov 24, 2017
  * Fix ppx_deriving_yojson.runtime META file
    (ocaml-ppx/ppx_deriving_yojson/ocaml#47)
    Étienne Millon
  * Support for inline records in variant types
    (ocaml-ppx/ppx_deriving_yojson/ocaml#50)
    Gerd Stolpmann
  * OCaml 4.06 compatibility
    (ocaml-ppx/ppx_deriving_yojson/ocaml#64, ocaml-ppx/ppx_deriving_yojson/ocaml#66)
    Leonid Rozenberg, Gabriel Scherer
NathanReb pushed a commit to NathanReb/opam-repository that referenced this issue Nov 26, 2021
NathanReb pushed a commit to NathanReb/opam-repository that referenced this issue Nov 26, 2021
update conduit suite to 2.0.1
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

8 participants