Skip to content

[Feature request] auto-detect missing libstdc++.so.6 issue, and suggest fix or auto-apply fix #1596

Open
@aidigital

Description

@aidigital

EDIT by @savil:
we resolved the immediate bug via being able to add stdenv.cc.cc.lib. However, the developer-UX here could be improved and this task is now tracking that:

  • we could auto-detect this scenario and suggest a fix or auto-apply the fix.
  • we also need a better story around locking and updating stdenv.cc.cc.lib.

Original bug report:

Current Behavior (bug)
Most (python) packages won't suffer from the problem I'm describing below, but some will.
Still, I think the problem can be addressed by devbox.

dagster is a popular python framework, whose installation provides a package and a executable.
What works:

  • first of all, dagster can be installed with your python pip example in the venv
  • it can be imported from the venv (i.e. import dagster works)

What doesn't work:

  • running the executable fails, due to not finding libstdc++.so.6.
    In my experience, not finding that library is a pretty common error that executables installed via nix run into.
# in the venv
$ dagster
Traceback (most recent call last):
  File "/tmp/tmp.Y07SaqoKmV/.devbox/virtenv/python310Packages.pip/.venv/bin/dagster", line 5, in <mod
ule>
    from dagster.cli import main
  File "/tmp/tmp.Y07SaqoKmV/.devbox/virtenv/python310Packages.pip/.venv/lib/python3.10/site-packages/
dagster/_module_alias_map.py", line 72, in exec_module
    base_module = importlib.import_module(self.base_spec.name)
  File "/nix/store/qpwrwhkz7hkp8069v369mclp3yd93p6v-python3-3.10.13/lib/python3.10/importlib/__init__
.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/tmp/tmp.Y07SaqoKmV/.devbox/virtenv/python310Packages.pip/.venv/lib/python3.10/site-packages/
dagster/_cli/__init__.py", line 4, in <module>
    from .api import api_cli
  File "/tmp/tmp.Y07SaqoKmV/.devbox/virtenv/python310Packages.pip/.venv/lib/python3.10/site-packages/
dagster/_cli/api.py", line 14, in <module>
    from dagster._cli.workspace.cli_target import (
  File "/tmp/tmp.Y07SaqoKmV/.devbox/virtenv/python310Packages.pip/.venv/lib/python3.10/site-packages/
dagster/_cli/workspace/__init__.py", line 1, in <module>
    from .cli_target import (
  File "/tmp/tmp.Y07SaqoKmV/.devbox/virtenv/python310Packages.pip/.venv/lib/python3.10/site-packages/
dagster/_cli/workspace/cli_target.py", line 29, in <module>
    from dagster._core.host_representation.code_location import CodeLocation
  File "/tmp/tmp.Y07SaqoKmV/.devbox/virtenv/python310Packages.pip/.venv/lib/python3.10/site-packages/
dagster/_core/host_representation/__init__.py", line 9, in <module>
    from .external import (
  File "/tmp/tmp.Y07SaqoKmV/.devbox/virtenv/python310Packages.pip/.venv/lib/python3.10/site
dagster/_core/host_representation/external.py", line 38, in <module>
    from dagster._core.host_representation.origin import (
  File "/tmp/tmp.Y07SaqoKmV/.devbox/virtenv/python310Packages.pip/.venv/lib/python3.10/site
dagster/_core/host_representation/origin.py", line 16, in <module>
    import grpc
  File "/tmp/tmp.Y07SaqoKmV/.devbox/virtenv/python310Packages.pip/.venv/lib/python3.10/site
grpc/__init__.py", line 22, in <module>
    from grpc import _compression
  File "/tmp/tmp.Y07SaqoKmV/.devbox/virtenv/python310Packages.pip/.venv/lib/python3.10/site
grpc/_compression.py", line 20, in <module>
    from grpc._cython import cygrpc
ImportError: libstdc++.so.6: cannot open shared object file: No such file or directory

Expected Behavior (fix)

  • Ideally, install the missing dependecy and/or export some missing Env Vars so it can find it
  • or at least to least inform the user: "hey, the dependecy you asked for installed a pkg (which will work), and an executable, and we're detecting that the executable will not work"

Why do I think this problem should be addressed by devbox ?
Imagine I didn't use devbox, and I had a global python installation in /nix/store.
I can create a venv off of that global python, run pip install dagster in the venv, and I'd be in a similar place: import dagster would work, but running the executable would fail.
devbox can be a step-up from that experience, and either fix or at least inform the user of the problem and suggest a solution.
As a side note, the above scenario is how I currently do things, except that the global python which I create venvs from is from asdf, because doing that will allow the dagster binary to work.

Additional context

  • devbox version
$ devbox version -v
Version:     0.7.1
Platform:    linux_arm64
Commit:      9444baeabcb69c2ec8d67ce57536a44171843d9d
Commit Time: 2023-10-19T19:11:54Z
Go Version:  go1.21.3
Launcher:    0.2.0
$ fd --unrestricted --ignore-case --absolute-path --glob "libstdc++.so.6" /
/usr/lib/aarch64-linux-gnu/libstdc++.so.6 
# it's also in nix store itself, as I've installed gcc

Metadata

Metadata

Assignees

No one assigned

    Labels

    aarch64aarch64 (or arm64) systemsbugSomething isn't workinglinkerRelated to linking (ld, ld.so or dyld)linuxLinux systemspythonSupport for Python, pip, Poetry, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions