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

Building go application generate fatal error on C header missing #2475

Open
mbocek opened this issue Jan 6, 2025 · 2 comments
Open

Building go application generate fatal error on C header missing #2475

mbocek opened this issue Jan 6, 2025 · 2 comments
Labels
bug Something isn't working triage Issue needs triage

Comments

@mbocek
Copy link

mbocek commented Jan 6, 2025

What happened?

During the building of our application build is finishing with the error:

# github.com/shoenig/go-m1cpu
../../../../go/pkg/mod/github.com/shoenig/[email protected]/cpu.go:8:11: fatal error: 'IOKit/IOKitLib.h' file not found
 #include <IOKit/IOKitLib.h>

If we are building go application outside of devbox shell build is succesfull.

Steps to reproduce

No response

Command

shell

devbox.json

{
  "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.13.7/.schema/devbox.schema.json",
  "packages": [
    "[email protected]"
  ],
  "shell": {
    "init_hook": [
      "echo 'Welcome to devbox!' > /dev/null"
    ],
    "scripts": {
      "test": [
        "echo \"Error: no test specified\" && exit 1"
      ]
    }
  }
}

Devbox version

0.13.7

Nix version

nix (Nix) 2.24.11

What system does this bug occur on?

macOS (Apple Silicon)

Debug logs

No response

@mbocek mbocek added bug Something isn't working triage Issue needs triage labels Jan 6, 2025
@Lagoja
Copy link
Contributor

Lagoja commented Jan 6, 2025

Try adding IOKit with:
devbox add darwin.apple_sdk.frameworks.IOKit

@mbocek
Copy link
Author

mbocek commented Jan 7, 2025

I moved forward, but I got another error:

ld: library not found for -lsasl2
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)

I think you might have some suggestions.

I expected that devbox would take system libraries from the system.

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

2 participants