BinDeps - building source with commit ids in dirname

I am trying to write a build.jl that relies on a BitBucket repo. The problem is that when unpacked BitBucket repos/tars contain commit id’s (mypackage/deps/src/bitbucket user - packagename - commit id/ ) so users will keep getting build errors whenever the commit id changes.

My build.jl:

using BinDeps
@BinDeps.setup
packagename_uri = URI("https://bitbucket.org/bitbucketuser/packagename/get/develop.tar.gz")
packagename = library_dependency("packagename")
provides(Sources, packagename_uri, packagename)
provides(BuildProcess, Dict(Autotools(libtarget = "packagename.so") => packagename)
@BinDeps.install  Dict(:packagename => :packagename)

How can I modify this so that make and make install are run in the correct location, whatever commit id is presetn in the .tar file?

I’m not familiar with BitBucket, but you shouldn’t have users download the latest development version: depending on when they install you package, they will use different versions of dependencies, and they will have no way to update them (even reinstalling the package won’t necessarily rebuild it). And sometimes the library might be updated and break the existing versions of the package, which is annoying for users but also for automated test builds shown on pkg.julialang.org/pulse.

So I’d recommend using the URI to a specific library version, and tag a new version of the package when you want to update the dependencies. That way the tarballs will also have stable names.

Ok, thanks, makes sense.

I second suggestion @nalimilan. This is also a matter of reproducibility of a package: a given version of a package is supposed to give always the same exact results. Using external dependencies that may change over time is a problem, and this is related to the possible breaking of the package, without any change of its code. I’d also done the same in the past in a package of mine, but was advised not to do it in order to preserve reproducibility.