Skip to content

Problems finding files in devbox shell #2829

Description

@pluxain

What happened?

I try to use https://github.com/hajimehoshi/ebiten Go game engine and followed the instructions.

To confirm the environment, one can run the following command: go run github.com/hajimehoshi/ebiten/v2/examples/rotate@latest

If I install go on my computer (Ubuntu) with all the required system dependencies and run go run github.com/hajimehoshi/ebiten/v2/examples/rotate@latest then it works.

If I remove Go from my computer, create a devbox environment, add Go package to it, open a devbox shell and then run the same command I get an error:

# github.com/hajimehoshi/ebiten/v2/internal/glfw
In file included from pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.9.9/internal/glfw/native_linbsd.go:14:
./glfw3native_unix.h:105:12: fatal error: X11/Xlib.h: No such file or directory
  105 |   #include <X11/Xlib.h>
      |            ^~~~~~~~~~~~
compilation terminated.

Steps to reproduce

  1. Install system dependencies
  2. add go to devbox environment
  3. run a devbox shell
  4. run go run github.com/hajimehoshi/ebiten/v2/examples/rotate@latest

Command

shell

devbox.json

{
  "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.16.0/.schema/devbox.schema.json",
  "packages": ["curl@latest", "gettext@latest", "go@latest"],
  "env": {
    "GOPATH": "$PWD",
    "PATH": "$PATH:$PWD"
  },
  "shell": {
    "init_hook": ["echo 'Welcome to devbox!' > /dev/null"],
    "scripts": {
      "test": ["echo \"Error: no test specified\" && exit 1"]
    }
  }
}

Devbox version

0.17.2

Nix version

nix (Nix) 2.31.1

What system does this bug occur on?

Linux (x86-64)

Debug logs

No response

Activity

  1. added
    bugSomething isn't working
    triageIssue needs triage
    on May 12, 2026
  2. 0xMurage commented on May 19, 2026

    @0xMurage

    If you haven't figured this,

    You need to install C compiler for that isolated dev environment i.e. devbox add gcc

  3. pluxain commented on May 20, 2026

    @pluxain
    Author

    Thanks for the recommandation.

    It did not work unfortunately (I had tried already and retried just to be certain).

    I also tried to install the libx11-dev package in the isolated dev enrironment but this package is not available.

    Probably I could try to make a symlink to the file on the non isolated shell into the isolated shell, but I do not know how to do and this seems pretty clumsy.

  4. mikeland73 commented on Sep 28, 2026

    @mikeland73
    Collaborator

    Triage: unrelated, p3

    This is expected behavior of a Nix-based environment, not a devbox bug. Inside devbox shell, cgo uses the Nix toolchain, which does not search the host's /usr/include. Installing libx11-dev with apt therefore has no effect. The X11/GL headers that ebiten needs have to come from Nix packages in devbox.json.

    All of these resolve on the search index today (search.devbox.sh/v2/resolve): libx11, libxcursor, libxrandr, libxinerama, libxi, libxxf86vm, libGL, alsa-lib, pkg-config (the xorg.* names resolve too). The following should work, though I couldn't run the full ebiten build in my sandbox:

    devbox add gcc pkg-config libx11 libxcursor libxrandr libxinerama libxi libxxf86vm libGL alsa-lib
    

    If headers are still missing after that, please share the output of echo $NIX_CFLAGS_COMPILE from inside the shell. It's possible the dev outputs aren't being included, which would be a devbox issue.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions