Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install openldap #2456

Open
pedro93 opened this issue Dec 17, 2024 · 1 comment
Open

Unable to install openldap #2456

pedro93 opened this issue Dec 17, 2024 · 1 comment
Labels
bug Something isn't working triage Issue needs triage

Comments

@pedro93
Copy link

pedro93 commented Dec 17, 2024

What happened?

On MacOS Sequoia 15.2, managed by nix-darwin I'm trying to create a devbox shell for a multi-language code repo where I need sasl.h to compile some python packages.

In order to do that I'm adding the openldap dependency to my devbox config but when computing the environment I get the following error:

$ devbox shell
Info: Ensuring packages are installed.
✓ Computed the Devbox environment.
Error: error installing packages in nix profile [/nix/store/a2wwllk1ikq2afd7p2mkfzb0ckhb4yfv-openldap-2.6.8 /nix/store/i91nkxcl4fd8al9vccgnaypcj50ld4ml-openldap-2.6.8-man /nix/store/qwlbs0xdxda0rx7z0yrx0bkwdxhm31g0-cyrus-sasl-2.1.28-bin /nix/store/vy9rkv8vkci8b2kxfaw810nb2k6gwp3g-cyrus-sasl-2.1.28-man]: nix: command error: nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' profile install --profile /Users/pedro/dev/acryl/datahub-fork/.devbox/nix/profile/default --offline --impure --priority 9 /nix/store/a2wwllk1ikq2afd7p2mkfzb0ckhb4yfv-openldap-2.6.8 /nix/store/i91nkxcl4fd8al9vccgnaypcj50ld4ml-openldap-2.6.8-man /nix/store/qwlbs0xdxda0rx7z0yrx0bkwdxhm31g0-cyrus-sasl-2.1.28-bin /nix/store/vy9rkv8vkci8b2kxfaw810nb2k6gwp3g-cyrus-sasl-2.1.28-man: exit code 1

Error: There was an internal error. Run with DEVBOX_DEBUG=1 for a detailed error message, and consider reporting it at https://github.com/jetify-com/devbox/issues

Steps to reproduce

  1. Just try to shell into the devbox shell.

Command

devbox shell

devbox.json

{
  "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.13.6/.schema/devbox.schema.json",
  "packages": [
    "jdk17@latest",
    "python310@latest",
    "nodejs@latest",
    "uv@latest",
    "openldap@latest",
    "cyrus_sasl@latest"
  ],
  "env": {
    "UV_PYTHON": "$PWD/metadata-ingestion/venv/bin/python",
    "LDFLAGS": "-L${pkgs.openldap}/lib -L${pkgs.cyrus_sasl}/lib",
    "CPPFLAGS": "-I${pkgs.openldap}/include -I${pkgs.cyrus_sasl}/include"
  },
  "shell": {
    "init_hook": [
      "echo 'Welcome to devbox!' > /dev/null"
    ],
    "scripts": {
      "test": [
        "echo \"Error: no test specified\" && exit 1"
      ]
    }
  }
}

Devbox version

0.13.6

Nix version

2.24.10

What system does this bug occur on?

macOS (Apple Silicon)

Debug logs

time=2024-12-17T11:41:03.612Z level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=cyrus_sasl mode=auto
⣾ Computing the Devbox environment...
time=2024-12-17T11:41:03.613Z level=DEBUG source=go.jetpack.io/devbox/internal/nix/nix.go:85 msg="running print-dev-env cmd" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' print-dev-env --json path:/Users/pedro/dev/acryl/datahub-fork/.devbox/gen/flake"
time=2024-12-17T11:41:03.614Z level=DEBUG source=go.jetpack.io/devbox/internal/nix/command.go:60 msg="nix command starting" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' print-dev-env --json path:/Users/pedro/dev/acryl/datahub-fork/.devbox/gen/flake" cmd.path=/run/current-system/sw/bin/ni⣯ Computing the Devbox environment...
time=2024-12-17T11:41:04.264Z level=DEBUG source=go.jetpack.io/devbox/internal/nix/command.go:67 msg="nix command exited" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' print-dev-env --json path:/Users/pedro/dev/acryl/datahub-fork/.devbox/gen/flake" cmd.path=/run/current-system/sw/bin/nix ✓ Computed the Devbox environment.
time=2024-12-17T11:41:04.265Z level=DEBUG source=go.jetpack.io/devbox/internal/nix/command.go:60 msg="nix command starting" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' profile list --profile /Users/pedro/dev/acryl/datahub-fork/.devbox/nix/profile/default --json" cmd.path=/run/current-system/sw/bin/nix
time=2024-12-17T11:41:04.314Z level=DEBUG source=go.jetpack.io/devbox/internal/nix/command.go:67 msg="nix command exited" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' profile list --profile /Users/pedro/dev/acryl/datahub-fork/.devbox/nix/profile/default --json" cmd.path=/run/current-system/sw/bin/nix cmd.pid=53967 cmd.code=0 cmd.dur=49.007291ms
time=2024-12-17T11:41:04.314Z level=DEBUG source=go.jetpack.io/devbox/internal/nix/command.go:47 msg="nix command starting" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' profile install --profile /Users/pedro/dev/acryl/datahub-fork/.devbox/nix/profile/default --offline --impure --priority 9 /nix/store/a2wwllk1ikq2afd7p2mkfzb0ckhb4yfv-openldap-2.6.8 /nix/store/i91nkxcl4fd8al9vccgnaypcj50ld4ml-openldap-2.6.8-man /nix/store/qwlbs0xdxda0rx7z0yrx0bkwdxhm31g0-cyrus-sasl-2.1.28-bin /nix/store/vy9rkv8vkci8b2kxfaw810nb2k6gwp3g-cyrus-sasl-2.1.28-man" cmd.path=/run/current-system/sw/bin/nix
time=2024-12-17T11:41:04.378Z level=DEBUG source=go.jetpack.io/devbox/internal/nix/command.go:54 msg="nix command exited" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' profile install --profile /Users/pedro/dev/acryl/datahub-fork/.devbox/nix/profile/default --offline --impure --priority 9 /nix/store/a2wwllk1ikq2afd7p2mkfzb0ckhb4yfv-openldap-2.6.8 /nix/store/i91nkxcl4fd8al9vccgnaypcj50ld4ml-openldap-2.6.8-man /nix/store/qwlbs0xdxda0rx7z0yrx0bkwdxhm31g0-cyrus-sasl-2.1.28-bin /nix/store/vy9rkv8vkci8b2kxfaw810nb2k6gwp3g-cyrus-sasl-2.1.28-man" cmd.path=/run/current-system/sw/bin/nix cmd.pid=53969 cmd.code=1 cmd.dur=63.651083ms
Error: error installing packages in nix profile [/nix/store/a2wwllk1ikq2afd7p2mkfzb0ckhb4yfv-openldap-2.6.8 /nix/store/i91nkxcl4fd8al9vccgnaypcj50ld4ml-openldap-2.6.8-man /nix/store/qwlbs0xdxda0rx7z0yrx0bkwdxhm31g0-cyrus-sasl-2.1.28-bin /nix/store/vy9rkv8vkci8b2kxfaw810nb2k6gwp3g-cyrus-sasl-2.1.28-man]: nix: command error: nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' profile install --profile /Users/pedro/dev/acryl/datahub-fork/.devbox/nix/profile/default --offline --impure --priority 9 /nix/store/a2wwllk1ikq2afd7p2mkfzb0ckhb4yfv-openldap-2.6.8 /nix/store/i91nkxcl4fd8al9vccgnaypcj50ld4ml-openldap-2.6.8-man /nix/store/qwlbs0xdxda0rx7z0yrx0bkwdxhm31g0-cyrus-sasl-2.1.28-bin /nix/store/vy9rkv8vkci8b2kxfaw810nb2k6gwp3g-cyrus-sasl-2.1.28-man: exit code 1

time=2024-12-17T11:41:04.378Z level=ERROR source=go.jetpack.io/devbox/internal/boxcli/midcobra/debug.go:68 msg="command error" stderr="" execid=bf51f293b83c4b75be636da21540a4b9 stack=<nil>
time=2024-12-17T11:41:04.378Z level=ERROR source=go.jetpack.io/devbox/internal/boxcli/midcobra/debug.go:70 msg="command error" execid=bf51f293b83c4b75be636da21540a4b9 stack=<nil>
time=2024-12-17T11:41:04.378Z level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:125 msg="searching for config file (including parent directories)" path=.
time=2024-12-17T11:41:04.378Z level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:146 msg="trying config file" path=devbox.json
time=2024-12-17T11:41:04.379Z level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:133 msg="config file found" path=/Users/pedro/dev/acryl/datahub-fork/devbox.json dur=183.166µs
time=2024-12-17T11:41:04.379Z level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=jdk17 mode=auto
time=2024-12-17T11:41:04.379Z level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=python310 mode=auto
time=2024-12-17T11:41:04.379Z level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=nodejs mode=auto
time=2024-12-17T11:41:04.379Z level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=uv mode=auto
time=2024-12-17T11:41:04.379Z level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=openldap mode=auto
time=2024-12-17T11:41:04.379Z level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=cyrus_sasl mode=auto
@pedro93 pedro93 added bug Something isn't working triage Issue needs triage labels Dec 17, 2024
@pedro93
Copy link
Author

pedro93 commented Dec 17, 2024

I was able to progress beyond Error: error installing packages in nix profile [/nix/store/a2wwllk1ikq2afd7p2mkfzb0ckhb4yfv-openldap-2.6.8 /nix/store/i91nkxcl4fd8al9vccgnaypcj50ld4ml-openldap-2.6.8-man /nix/store/qwlbs0xdxda0rx7z0yrx0bkwdxhm31g0-cyrus-sasl-2.1.28-bin /nix/store/vy9rkv8vkci8b2kxfaw810nb2k6gwp3g-cyrus-sasl-2.1.28-man]: nix: command error: nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' profile install --profile /Users/pedro/dev/acryl/datahub-fork/.devbox/nix/profile/default --offline --impure --priority 9 /nix/store/a2wwllk1ikq2afd7p2mkfzb0ckhb4yfv-openldap-2.6.8 /nix/store/i91nkxcl4fd8al9vccgnaypcj50ld4ml-openldap-2.6.8-man /nix/store/qwlbs0xdxda0rx7z0yrx0bkwdxhm31g0-cyrus-sasl-2.1.28-bin /nix/store/vy9rkv8vkci8b2kxfaw810nb2k6gwp3g-cyrus-sasl-2.1.28-man: exit code 1

By removing the "cyrus_sasl@latest" package.
Now the devbox shell loads but when running uv pip install python-ldap I get the following:

clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/nix/store/aizjnx3sf3zagnzvfidppr5vhn7xz03z-libxcrypt-4.4.36/include -DHAVE_SASL -DHAVE_TLS -DLDAPMODULE_VERSION=3.4.4 "-DLDAPMODULE_AUTHOR=python-ldap project" "-DLDAPMODULE_LICENSE=Python style" -IModules -I/Users/pedro/Library/Caches/uv/builds-v0/.tmp6r07d0/include -I/nix/store/ak3zf631ws2rwsl5qq0x3v7j18h0c2jj-python3-3.10.13/include/python3.10 -c Modules/LDAPObject.c -o build/temp.macosx-11.0-arm64-cpython-310/Modules/LDAPObject.o

[stderr]
/Users/pedro/Library/Caches/uv/builds-v0/.tmp6r07d0/lib/python3.10/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'test_suite'
  warnings.warn(msg)
no previously-included directories found matching 'Doc/.build'
Modules/LDAPObject.c:16:10: fatal error: 'sasl/sasl.h' file not found
#include <sasl/sasl.h>
         ^~~~~~~~~~~~~
1 error generated.
error: command '/nix/store/sa6hywsm1mqfyd1xakyzv4ljjsb3hawh-clang-wrapper-11.1.0/bin/clang' failed with exit code 1
  Caused by: This error likely indicates that you need to install a library that provides "sasl/sasl.h" for [email protected]

This tells me that C libraries are not getting accessed in devbox, is there a way to fix this?
The header file exists in: ls /Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/usr/include/sasl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Issue needs triage
Development

No branches or pull requests

1 participant