[CDRIVER-2607] brew packaging should honor --HEAD Created: 12/Apr/18  Updated: 28/Oct/23  Resolved: 31/May/18

Status: Closed
Project: C Driver
Component/s: packaging
Affects Version/s: None
Fix Version/s: 1.10.0

Type: Task Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: A. Jesse Jiryu Davis
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on CDRIVER-1349 Delete Autotools build system, use CM... Closed
Related
related to CDRIVER-2629 Update mongo-c-driver and libbson hom... Closed

 Description   

Many homebrew packages offer --HEAD, which pulls from master of the project. We should offer this for the C driver, for times when the C++ driver master is not currently buildable against the stable C driver.



 Comments   
Comment by A. Jesse Jiryu Davis [ 31/May/18 ]

Homebrew maintainers have already fixed our config to deal with CMake. My PR adding the "head" link has been accepted.

Comment by A. Jesse Jiryu Davis [ 17/Apr/18 ]

The Autotools build still works on master. There's a wart in src/libbson/autogen.sh, it wants to symlink from README to README.rst in src/libbson, and then the symlink named README is a dependency for the "install" target. The tarball is generated after this symlink is created, so that works in Homebrew, but not when Homebrew builds from a repo clone.

If Homebrew executed ./autogen.sh instead of autoreconf, that would probably generate the symlink. If we kept Autotools it would be worthwhile to clean this up, but in the CMake config we're simply not creating the symlink named README and not expecting it to be created.

Let's keep this open until someone ports the whole Homebrew formula for the driver to CMake.

Comment by Andrew Morrow (Inactive) [ 17/Apr/18 ]

OK, so I tried this, following the instructions here: https://docs.brew.sh/How-To-Open-a-Homebrew-Pull-Request.

I made the following edit:

diff --git a/Formula/mongo-c-driver.rb b/Formula/mongo-c-driver.rb
index 5cc86bc..2f296ef 100644
--- a/Formula/mongo-c-driver.rb
+++ b/Formula/mongo-c-driver.rb
@@ -3,6 +3,7 @@ class MongoCDriver < Formula
   homepage "https://github.com/mongodb/mongo-c-driver"
   url "https://github.com/mongodb/mongo-c-driver/releases/download/1.9.4/mongo-c-driver-1.9.4.tar.gz"
   sha256 "910c2f1b2e3df4d0ea39c2f242160028f90fcb8201f05339a730ec4ba70811fb"
+  head "https://github.com/mongodb/mongo-c-driver.git"
 
   bottle do
     cellar :any

But when I try to build it with --HEAD I get an error:

brew install --build-from-source --HEAD mongo-c-driver
==> Cloning https://github.com/mongodb/mongo-c-driver.git
Cloning into '/Users/acm/Library/Caches/Homebrew/mongo-c-driver--git'...
remote: Counting objects: 2147, done.
remote: Compressing objects: 100% (1730/1730), done.
remote: Total 2147 (delta 607), reused 1103 (delta 323), pack-reused 0
Receiving objects: 100% (2147/2147), 5.74 MiB | 7.09 MiB/s, done.
Resolving deltas: 100% (607/607), done.
==> Checking out branch master
==> autoreconf -fiv
==> ./configure --disable-silent-rules --prefix=/usr/local/Cellar/mongo-c-driver/HEAD-58441ff --enable-man-pages --with-libbson=bundled
==> make install
Last 15 lines from /Users/acm/Library/Logs/Homebrew/mongo-c-driver/03.make:
2018-04-17 10:41:37 -0400
 
make
install
 
Making install in src/libbson
make[1]: *** No rule to make target `README', needed by `all-am'.  Stop.
make[1]: *** Waiting for unfinished jobs....
make: *** [install-recursive] Error 1
 
READ THIS: https://docs.brew.sh/Troubleshooting

Is the autotools build no longer useable on master for the C driver? If so, I guess we will need to wait until after the upstream homebrew package maintainer switches over to CMake.

Comment by A. Jesse Jiryu Davis [ 12/Apr/18 ]

Good idea! But we don't maintain the Homebrew package, would you like to open an issue in their tracker?

Generated at Wed Feb 07 21:15:46 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.