Skip to content

How are libraries as dependencies supposed to work? #2757

@richard-hajek

Description

@richard-hajek

Question

I am trying to build a ruby native extension, but it's failing because it can't find libyaml headers. I created a minimal example:

What happens

> devbox init
> ls
devbox.json

> devbox add libyaml gcc
Info: Adding package "libyaml@latest" to devbox.json
Info: Adding package "gcc@latest" to devbox.json
Info: Installing the following packages to the nix store: gcc@latest

> echo '#include <yaml.h>\nvoid main(){}' >> main.c
> cat main.c 
#include <yaml.h>
void main(){}

> devbox shell
Info: Ensuring packages are installed.
✓ Computed the Devbox environment.
Starting a devbox shell...

> ls
main.c  devbox.json  devbox.lock

> gcc main.c 
main.c:1:10: fatal error: yaml.h: No such file or directory
    1 | #include <yaml.h>
      |          ^~~~~~~~
compilation terminated.

What I expect to happen

For it to work.

It works when I just do nix-shell -p gcc libyaml

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions