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

Updated readme example for 1.0 #250

Open
IanButterworth opened this issue Nov 21, 2018 · 7 comments
Open

Updated readme example for 1.0 #250

IanButterworth opened this issue Nov 21, 2018 · 7 comments

Comments

@IanButterworth
Copy link
Member

Apart from the depreciated @osx_only macro, is there anything else outdated on the build.jl code on the readme? @staticfloat

using BinDeps
@BinDeps.setup
nettle = library_dependency("nettle", aliases = ["libnettle","libnettle-4-6"])

...
# Wrap in @static Sys.isapple() to avoid non-OSX users from erroring out
@static Sys.isapple()
    using Homebrew
    provides( Homebrew.HB, "nettle", nettle, os = :Darwin )
end
@staticfloat
Copy link
Member

staticfloat commented Nov 24, 2018

I'm not certain what you're asking? Could you be a little bit more specific? Are you seeing some kind of error?

@IanButterworth
Copy link
Member Author

You're right, apologies for lack of detail. The errors I'm experiencing in using the example are

  1. @osx_only is depreciated in 1.0
  2. The code below seems to attempt to install GraphViz with every build. I assumed that it would install once and detect from thereon
using BinDeps
@BinDeps.setup
graphviz = library_dependency("graphviz")

@static if Sys.isapple()    
    using Homebrew
    if !Homebrew.installed("graphviz")
        println("Installing GraphViz in local homebrew environment")
        provides( Homebrew.HB, "graphviz", graphviz, os = :Darwin )
    else
        println("GraphViz already installed in local homebrew environment")
    end
end

@staticfloat
Copy link
Member

The intention for this package is to have these commands within your deps/build.jl file. That file gets run once at Pkg.build() time, which typically happens directly after package installation. If you think the README can be worded better (it probably can) I would be happy to merge a documentation fix.

@IanButterworth
Copy link
Member Author

IanButterworth commented Nov 24, 2018

Indeed, the code I mentioned resides in deps/build.jl. I'm referring to the build process detecting whether a Homebrew package is installed already and acting accordingly.

i.e. Homebrew.installed("graphviz") is perpetually false when the package is built and rebuilt.

Or is that expected behavior? Is the Homebrew installation environment local to the package itself and thus destroyed at the start of a rebuild? (I had assumed it was a local julia-wide environment, thus sustained outside of packages)

@staticfloat
Copy link
Member

Hmmm, no, Homebrew.jl should definitely be installing into a Homebrew-version-specific directory. E.g. packages/Homebrew.jl/<homebrew/julia version hash>/deps/usr. So if you Homebrew.add("graphviz"), unless something goes wrong, Homebrew.installed("graphviz") should be true.

@IanButterworth
Copy link
Member Author

Indeed, Homebrew.add(pkg) does result in the package installing and being detectable. However the provides( line in the example doesn’t seem to invoke the installation of graphviz.

@staticfloat
Copy link
Member

That's correct; it only registers Homebrew as one possible provider of graphviz. You need a BinDeps.@install at the bottom of your installation script to actually do the installation. I've added that to the README now.

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

2 participants