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

language.c.includes collision when trying to use libX11 and xorgproto #241

Open
duckpuppy opened this issue Dec 29, 2022 · 0 comments
Open
Labels
bug Something isn't working

Comments

@duckpuppy
Copy link

duckpuppy commented Dec 29, 2022

Describe the bug

xorg.libX11 and xorg.xorgproto both contain some of the same files, but both are often needed when working with X11 libs. Including both of them in language.c.includes causes a collision.

To Reproduce

Steps to reproduce the behavior:

  1. Initialize a devshell flake.nix
  2. Create a devshell.toml file with:
imports = [ "language/c" ]
[language.c]
compiler = "pkgs.gcc-unwrapped"
includes = [ "xorg.libX11", "xorg.xorgproto" ]

Expected behavior

Include files from both packages are on the include path

System information

WSL2 / Debian Bullseye

Additional context

I'm trying to work on a golang project that uses SDL2 (and as such needs the C compiler as well), and SDL2 requires both libX11 and xorgproto.

flake.nix:

{
  description = "virtual environments";

  inputs.devshell.url = "github:numtide/devshell";
  inputs.flake-utils.url = "github:numtide/flake-utils";

  outputs = { self, flake-utils, devshell, nixpkgs }:
    flake-utils.lib.eachDefaultSystem (system: {
      devShell =
        let pkgs = import nixpkgs {
          inherit system;

          overlays = [ devshell.overlay ];
        };
        in
        pkgs.devshell.mkShell {
          imports = [ (pkgs.devshell.importTOML ./devshell.toml) ];
        };
    });
}

devshell.toml:

# https://numtide.github.io/devshell
imports = [
  "language/c"
]

[language.c]
compiler = "pkgs.gcc-unwrapped"
includes = [
  "SDL2", 
  "xorg.libX11",
  "xorg.xorgproto"
]

[[commands]]
package = "devshell.cli"
help = "Per project developer environments"

[[commands]]
package = "go"
help = "Golang language compiler"

[devshell]
packages = [
  "delve",
  "golangci-lint",
  "gopls",
  "gomodifytags",
  "pkg-config"
]

The above configuration gives the following error:

error: builder for '/nix/store/fv8qvjd82wmrm1s0qb6ca3w5d6q9z2ab-devshell-dir.drv' failed with exit code 25;
       last 1 log lines:
       > error: collision between `/nix/store/2dspcvr8zwwcl35pilbsgqhnid3kfh68-xorgproto-2021.5/include/X11/extensions/XKBgeom.h' and `/nix/store/sgw0sxwx46hqwlcm3d834f10p1qx7c5y-libX11-1.8.1-dev/include/X11/extensions/XKBgeom.h'
       For full logs, run 'nix log /nix/store/fv8qvjd82wmrm1s0qb6ca3w5d6q9z2ab-devshell-dir.drv'.
error: 1 dependencies of derivation '/nix/store/2cb7rrqfrx2ry2aw1qi4cx3kbpkbi2sa-devshell-env.drv' failed to build
@duckpuppy duckpuppy added the bug Something isn't working label Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant