Skip to content

build: bump OpenBabel to 3.1.1 from upstream tag with in-tree <ctime> patch#3

Merged
PiTrem merged 2 commits into
masterfrom
openbabel-3.1.1-ctime
Jun 25, 2026
Merged

build: bump OpenBabel to 3.1.1 from upstream tag with in-tree <ctime> patch#3
PiTrem merged 2 commits into
masterfrom
openbabel-3.1.1-ctime

Conversation

@PiTrem

@PiTrem PiTrem commented Jun 25, 2026

Copy link
Copy Markdown
Member

Switches the gem to build OpenBabel 3.1.1 from the upstream openbabel/openbabel openbabel-3-1-1 tag (version-derived, OPENBABEL-overridable) instead of the ComPlat fork, and injects the missing #include <ctime> into obutil.h before cmake — the 3.1.1 release tag predates upstream PR #2533, so without it the build fails 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.

Also:

  • 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.
  • Fix an install-time NameErrorextconf.rb derived the OpenBabel git tag from OpenBabel::VERSION but never required openbabel/version, so RubyGems/Bundler's bare ruby extconf.rb died with uninitialized constant OpenBabel before any clone. This broke bundle install in chemotion_ELN / chemotion-builder. Now required path-resolved off the gem root.
  • Clone/patch failures now abort the build instead of falling through to the fake Makefile.
  • Add a verification Dockerfile on ruby:3.3-bookworm (GCC 12) matching production, building the gem the way RubyGems does (no constant preload) so a regression of the NameError would be caught.

Verified: docker build on GCC 12 succeeds, smoke test reports formula=C27H46O atoms=74, rake test passes.

PiTrem and others added 2 commits June 19, 2026 11:06
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.
@PiTrem PiTrem merged commit 54496ff into master Jun 25, 2026
@PiTrem PiTrem changed the title Build OpenBabel 3.1.1 from upstream tag with in-tree <ctime> patch build: bump OpenBabel to 3.1.1 from upstream tag with in-tree <ctime> patch Jun 25, 2026
@PiTrem PiTrem deleted the openbabel-3.1.1-ctime branch June 25, 2026 13:47
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.

1 participant