NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.29k stars 13.54k forks source link

Build failure: Openbabel #325741

Closed Daru-san closed 1 month ago

Daru-san commented 1 month ago

Steps To Reproduce

Steps to reproduce the behavior:

  1. build openbabel or any package that depends on it, i.e Kalzium

Build log

┏━ 1 Errors: 
 ⋮ 
┃        > -- Set non-toolchain portion of runtime path of "/nix/store/h7kpjljvzr2zhy06jr1sz5p5wlslyl0d-openbabel-unstable-06-12-23/bin/obspectrophore" to "/nix/store
/h7kp…
┃        > -- Installing: /nix/store/h7kpjljvzr2zhy06jr1sz5p5wlslyl0d-openbabel-unstable-06-12-23/bin/obrms
┃        > -- Set non-toolchain portion of runtime path of "/nix/store/h7kpjljvzr2zhy06jr1sz5p5wlslyl0d-openbabel-unstable-06-12-23/bin/obrms" to "/nix/store/h7kpjljv
zr2zh…
┃        > -- Installing: /nix/store/h7kpjljvzr2zhy06jr1sz5p5wlslyl0d-openbabel-unstable-06-12-23/bin/roundtrip
┃        > -- Set non-toolchain portion of runtime path of "/nix/store/h7kpjljvzr2zhy06jr1sz5p5wlslyl0d-openbabel-unstable-06-12-23/bin/roundtrip" to "/nix/store/h7kp
jljvz…
┃        > CMake Error at scripts/cmake_install.cmake:60 (file):
┃        >   file cannot create directory: /openbabel.  Maybe need administrative
┃        >   privileges.
┃        > Call Stack (most recent call first):
┃        >   cmake_install.cmake:115 (include)
┃        >
┃        > 
┃        > make: *** [Makefile:110: install] Error 1
┃        For full logs, run 'nix log /nix/store/hqmxz2my2zb8bpfkap7hw9afx2xwfv52-openbabel-unstable-06-12-23.drv'.

Additional context

The issue seems to have appeared in the most recent push to nixos-unstable, it seems to be an issue with the openbabel dependency

Notify maintainers

@danielbarter

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.9.8-cachyos, NixOS, 24.11 (Vicuna), 24.11.20240708.655a58a`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.23.2`
 - nixpkgs: `/nix/store/dk2rpyb6ndvfbf19bkb2plcz5y3k8i5v-source`

Add a :+1: reaction to issues you find important.

Daru-san commented 1 month ago

Actually after properly inspecting this issue I realize that it is rather an issue with it's dependency, openbabel that fails to build

sheepforce commented 1 month ago

The problem is exactly this line and Python 3.12, which removed distutils: https://github.com/openbabel/openbabel/blob/master/scripts/CMakeLists.txt#L114 We can work around it by setting PYTHON_INSTDIR in CMake , but I didn't manage to get the Python bindings to build again, as the nix expression also crafts a custom setup.py like that:

from setuptools import setup

setup(
    name = 'pyopenbabel',
    version = '3.2b1',
    packages = ['openbabel'],
    package_data = {'openbabel' : ['_openbabel.so']}
)