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

Need help building the c-bindings #719

Open
JanosGit opened this issue Aug 7, 2023 · 0 comments
Open

Need help building the c-bindings #719

JanosGit opened this issue Aug 7, 2023 · 0 comments

Comments

@JanosGit
Copy link

JanosGit commented Aug 7, 2023

I want to integrate jsonnet support into a C++ application, so I want to build the c-bindings. Being no go developer I'm having a hard time getting it build. I'm on Windows right now, but I want to build a macOS version as well.

My first approach was just running

go build .\c-bindings

which returned without errors but unexpectedly created a c-bindings.exe file which is a bit unexpected since I expect it to generate library that I can link against in my application.

My second approach was trying out Bazel as it is recommended as an alternative way to build it and I see that the c-bindings folder contains a BUILD.bazel file. I tried to run

bazel build //c-bindings

which results in an error like this

ERROR: An error occurred during the fetch of repository 'bazel_gazelle_go_repository_config':
   Traceback (most recent call last):
        File "C:/users/janos/_bazel_janos/l5gznqzr/external/bazel_gazelle/internal/go_repository_config.bzl", line 45, column 40, in _go_repository_config_impl
                macro_label = Label("@" + ctx.attr.config.workspace_name + "//:" + f)
Error in Label: invalid label in Label(): invalid target name 'bazel\deps.bzl': target names may not contain '\'

Again, I also have not used Bazel before, so it might be a simple usage error on my side or some misconfiguration or whatever.

Since I only need the libary to integrate it in my C++ application (which is an environment I'm much more familiar with) I'd love to get some instructions on how to build the c-bindings correctly without needing to dive deep into development tools I have never worked with before. Would you consider adding a section with some instructions to the Readme?

I'm using the latest master commit of go-jsonnet and use go 1.20.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant