build: bump OpenBabel to 3.1.1 from upstream tag with in-tree <ctime> patch#3
Merged
Conversation
Clone OpenBabel from the upstream openbabel/openbabel openbabel-3-1-1 tag (version-derived, OPENBABEL-overridable) instead of the ComPlat fork, and inject the missing `#include <ctime>` into obutil.h before cmake. The 3.1.1 release tag predates upstream PR #2533, so without this it fails to compile on GCC 11+ (clock / CLOCKS_PER_SEC not declared). This folds the fix previously carried by the third-party ptrxyz/openbabel-gem@ptrxyz-ctime-fix into this ComPlat-owned gem. Clone/patch failures now abort the build instead of falling through to the fake Makefile. Fix GEMVERSION to a valid Gem::Version (3.1.1.1); the prior v3.0.0-ob3.1.1 was non-numeric and broke `gem build`. Move the verification Dockerfile off the deliberate ruby:3.1-bullseye (GCC 10) pin to ruby:3.3-bookworm (GCC 12), matching production's modern toolchain, and add CLAUDE.md documenting the build. Verified: docker build on GCC 12 succeeds, smoke test reports formula=C27H46O atoms=74, rake test passes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
extconf.rb derives the OpenBabel git tag from OpenBabel::VERSION but never required openbabel/version. RubyGems/Bundler invoke the build as a bare `ruby extconf.rb` with the gem's lib/ off the load path, so the constant was undefined and the build died with `uninitialized constant OpenBabel (NameError)` before any clone or compile — surfacing as the generic "Could not create Makefile due to ... lack of necessary libraries and/or headers." This broke `bundle install` in chemotion_ELN / chemotion-builder. Require the version file from within extconf (path-resolved off the gem root) so the constant is always available regardless of how the build is invoked. The verification Dockerfile previously ran `ruby -I../../lib -ropenbabel/version extconf.rb`, pre-loading the constant and masking exactly this failure — which is why CI stayed green while real installs failed. Drop the preload so the image builds the gem the way RubyGems does and would catch a regression.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Switches the gem to build OpenBabel 3.1.1 from the upstream
openbabel/openbabelopenbabel-3-1-1tag (version-derived,OPENBABEL-overridable) instead of the ComPlat fork, and injects the missing#include <ctime>intoobutil.hbefore cmake — the 3.1.1 release tag predates upstream PR #2533, so without it the build fails on GCC 11+ (clock/CLOCKS_PER_SECnot declared). This folds the fix previously carried by the third-partyptrxyz/openbabel-gem@ptrxyz-ctime-fixinto this ComPlat-owned gem.Also:
GEMVERSIONto a validGem::Version(3.1.1.1); the priorv3.0.0-ob3.1.1was non-numeric and brokegem build.NameError—extconf.rbderived the OpenBabel git tag fromOpenBabel::VERSIONbut never requiredopenbabel/version, so RubyGems/Bundler's bareruby extconf.rbdied withuninitialized constant OpenBabelbefore any clone. This brokebundle installin chemotion_ELN / chemotion-builder. Now required path-resolved off the gem root.Dockerfileonruby:3.3-bookworm(GCC 12) matching production, building the gem the way RubyGems does (no constant preload) so a regression of theNameErrorwould be caught.Verified: docker build on GCC 12 succeeds, smoke test reports
formula=C27H46O atoms=74,rake testpasses.