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

Update README with install note #149

Closed
wants to merge 2 commits into from

Conversation

ranjanan
Copy link

Does not seem obvious to me, so this note may be useful. Thanks.

@timholy
Copy link
Member

timholy commented Jun 28, 2016

I suspect this advice is quite specific to OSX, and it might be good to clarify that before you get to the part about "removing Cairo from your system." On Linux, it would probably be bad advice to remove Cairo, since that seems likely to also force removal of the majority of graphical programs on the user's system.

@ranjanan
Copy link
Author

Oh I see. I wasn't aware of the Linux issue. I'll modify this.

@timholy
Copy link
Member

timholy commented Jun 29, 2016

I trust this is good advice, but I'm going to let someone with a Mac make the merge decision---having literally zero experience with the beasts, I'm not the one to do it.

@ranjanan
Copy link
Author

@StefanKarpinski ?

@Keno
Copy link
Contributor

Keno commented Jun 29, 2016

What part of the tests fail? Ideally that would be in the binary verification hook to disallow loading that library.

@ranjanan
Copy link
Author

The build for this PR is failing because the AppVeyor build is failing on the latest 32-bit version, and the latest Mac version is segfaulting on Master.

@tkelman
Copy link
Contributor

tkelman commented Jun 30, 2016

That's not what Keno meant. He was asking about what happened before you ran the steps you're describing here. What didn't work about Homebrew's version of Cairo?

@ranjanan
Copy link
Author

ranjanan commented Jun 30, 2016

Oh I see. Pkg.build("Cairo") did seemingly nothing for me, and I got the error as described in #148. @StefanKarpinski got a similar error on his system earlier and he told me how to fix it. I summarized what he said in that note.

@tkelman
Copy link
Contributor

tkelman commented Jun 30, 2016

What version of Cairo.jl are you using? I think we haven't tagged in some time but the error message for that should be better on recent versions. It basically means Pkg.build didn't actually populate deps.jl with anything useful.

@ranjanan
Copy link
Author

I did a Pkg.add first, which should trigger build and then nothing discernable happened. I then did a Pkg.checkout and then tried Pkg.build before getting that error on Pkg.test

@tkelman
Copy link
Contributor

tkelman commented Jun 30, 2016

If you can reproduce it again, what is the content of the file at Pkg.dir("Cairo", "deps", "deps.jl") if any?

@jiahao
Copy link

jiahao commented Jul 8, 2016

Here is a horrible hack for the BinDeps issue @tkelman mentioned:

#Work around annoying BinDeps bug where BinDeps doesn't save location of binary
#dependencies
#This comes up most often in Cairo...
pkgdir=`julia -e 'print(Pkg.dir())'` #Change path to julia binary as necessary
if [ -d $pkgdir/Cairo -a `grep -c _jl_libgobject  $pkgdir/Cairo/deps/deps.jl` -eq 0 ]; then
cat >> $pkgdir/Cairo/deps/deps.jl << ENDPATCH
const _jl_libpangocairo = "/usr/local/lib/libpangocairo-1.0.dylib"
const _jl_libpango = "/usr/local/lib/libpango-1.0.dylib"
const _jl_libcairo = "/usr/local/lib/libcairo.dylib"
const _jl_libgobject = "/usr/local/lib/libgobject-2.0.dylib"
ENDPATCH
fi

@tkelman
Copy link
Contributor

tkelman commented Jul 8, 2016

Could we actually get steps to reproduce the bug so we can attempt to fix it?

@ranjanan
Copy link
Author

ranjanan commented Jul 8, 2016

Ah, sorry, I was travelling a fair bit. I'll work on reproducing it now.

@ranjanan
Copy link
Author

I think this is a way to reproduce this on Mac. Have a fresh install of Julia v0.5 with cairo already installed with homebrew. Then do:

Pkg.update()
Pkg.add("Cairo")
Pkg.test("Cairo")

You're likely to see the same _jl_libcairo error as described in #148 .

Now, after brew unlink cairo, and a fresh Pkg.build("Cairo"), the error goes away.

@tkelman
Copy link
Contributor

tkelman commented Jul 25, 2016

If you can reproduce it again, what is the content of the file at Pkg.dir("Cairo", "deps", "deps.jl") if any?

@ranjanan
Copy link
Author

 This is an auto-generated file; do not edit

# Pre-hooks

# Macro to load a library
macro checked_lib(libname, path)
    ((VERSION >= v"0.4.0-dev+3844" ? Base.Libdl.dlopen_e : Base.dlopen_e)(path) == C_NULL) && error("Unable to load \n\n$libname ($path)\n\nPlease re-run Pkg.build(package), and restart Julia.")
    quote const $(esc(libname)) = $path end
end

# Load dependencies

# Load-hooks

@tkelman
Copy link
Contributor

tkelman commented Jul 25, 2016

And Pkg.build succeeds without an error? We should track that through to find out why that file is coming out empty.

@ranjanan
Copy link
Author

Yeah. Only once I unlink my system's cairo does Pkg.build do anything.

@tkelman
Copy link
Contributor

tkelman commented Jul 25, 2016

please be more specific than "do anything." Exactly what do you see happen?

@ranjanan
Copy link
Author

ranjanan commented Jul 25, 2016

Alrighty. Please forgive me for the long comment.

In the beginning, I have cairo on my system, installed through Homebrew, and I have a blank ~/.julia/v0.5 folder. I open Julia v0.5, do a Pkg.update() and a Pkg.add("Cairo"). Now, the package manager begins installing dependencies:

julia> Pkg.add("Cairo")
INFO: Installing BinDeps v0.4.0
INFO: Installing Cairo v0.2.33
INFO: Installing ColorTypes v0.2.5
INFO: Installing Colors v0.6.6
INFO: Installing Compat v0.8.6
INFO: Installing FixedPointNumbers v0.1.4
INFO: Installing Graphics v0.1.3
INFO: Installing Homebrew v0.3.2
INFO: Installing JSON v0.6.0
INFO: Installing Reexport v0.0.3
INFO: Installing SHA v0.1.2
INFO: Installing URIParser v0.1.5
INFO: Building Homebrew
INFO: Recompiling stale cache file /Users/ranjan/.julia/lib/v0.5/Homebrew.ji for module Homebrew.
INFO: Recompiling stale cache file /Users/ranjan/.julia/lib/v0.5/JSON.ji for module JSON.
INFO: Recompiling stale cache file /Users/ranjan/.julia/lib/v0.5/Compat.ji for module Compat.
INFO: Recompiling stale cache file /Users/ranjan/.julia/lib/v0.5/BinDeps.ji for module BinDeps.

Now after that, it begins to download brew:

INFO: Downloading brew...
######################################################################## 100.0%
==> Tapping homebrew/core
Cloning into '/Users/ranjan/.julia/v0.5/Homebrew/deps/usr/Library/Taps/homebrew/homebrew-core'...
remote: Counting objects: 261606, done.
remote: Total 261606 (delta 0), reused 0 (delta 0), pack-reused 261606
Receiving objects: 100% (261606/261606), 61.90 MiB | 892.00 KiB/s, done.
Resolving deltas: 100% (137135/137135), done.
Checking connectivity... done.
Tapped 3594 formulae (3,741 files, 74.9M)
==> Tapping staticfloat/juliadeps
Cloning into '/Users/ranjan/.julia/v0.5/Homebrew/deps/usr/Library/Taps/staticfloat/homebrew-juliadeps'...
remote: Counting objects: 1689, done.
remote: Total 1689 (delta 0), reused 0 (delta 0), pack-reused 1689
Receiving objects: 100% (1689/1689), 306.44 KiB | 160.00 KiB/s, done.
Resolving deltas: 100% (1017/1017), done.
Checking connectivity... done.
Tapped 17 formulae (42 files, 407K)
==> Tapping staticfloat/juliatranslated
Cloning into '/Users/ranjan/.julia/v0.5/Homebrew/deps/usr/Library/Taps/staticfloat/homebrew-juliatranslated'...
remote: Counting objects: 5, done.
remote: Total 5 (delta 0), reused 0 (delta 0), pack-reused 5
Unpacking objects: 100% (5/5), done.
Checking connectivity... done.
Tapped 0 formulae (28 files, 21.5K)
Initialized empty Git repository in /Users/ranjan/.julia/v0.5/Homebrew/deps/usr/.git/
remote: Counting objects: 520, done.
remote: Compressing objects: 100% (463/463), done.
remote: Total 520 (delta 30), reused 315 (delta 26), pack-reused 0
Receiving objects: 100% (520/520), 783.65 KiB | 139.00 KiB/s, done.
Resolving deltas: 100% (30/30), done.
From https://github.com/Homebrew/brew
 * [new branch]      master     -> origin/master
HEAD is now at 1455aa3 Fix spelling of penryn (#580)
Already up-to-date.

And then it begins to build Cairo:

INFO: Building Cairo
<<<skipping deprecation warnings>>>
==> Installing gettext from staticfloat/juliatranslated
==> Downloading https://homebrew.bintray.com/bottles/gettext-0.19.8.1.el_capitan.bottle.tar.gz
Already downloaded: /Users/ranjan/Library/Caches/Homebrew.jl/gettext-0.19.8.1.el_capitan.bottle.tar.gz
==> Pouring gettext-0.19.8.1.el_capitan.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /Users/ranjan/.julia/v0.5/Homebrew/deps/usr.

OS X provides the BSD gettext library and some software gets confused if both are in the library path.

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/Users/ranjan/.julia/v0.5/Homebrew/deps/usr/opt/gettext/lib
    CPPFLAGS: -I/Users/ranjan/.julia/v0.5/Homebrew/deps/usr/opt/gettext/include

==> Summary
🍺  /Users/ranjan/.julia/v0.5/Homebrew/deps/usr/Cellar/gettext/0.19.8.1: 1,934 files, 16.9M
INFO: Package database updated

Pkg.test("Cairo") at this point fails, so I do a Pkg.build("Cairo"). I get the following:

julia> Pkg.build("Cairo")
INFO: Building Homebrew
Already up-to-date.
INFO: Building Cairo
<<<skipping deprecation warnings>>>

And that's it; it returns to julia>. And tests continue to fail.

@tkelman
Copy link
Contributor

tkelman commented Jul 25, 2016

Okay. So we need to figure out what happened with that first build, why BinDeps.@install generated a mostly empty deps.jl file.

@giordano
Copy link
Contributor

giordano commented Sep 7, 2019

This is not necessary anymore

@Keno Keno closed this Sep 7, 2019
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

Successfully merging this pull request may close these issues.

6 participants