cimgui-go: go vendor does not work
I feel like I’m missing a piece of the puzzle 🧩 to getting started with this…
Edit: In case you don’t want to read this whole thread:
It’s a
go vendor
issue (which they won’t fix).go vendor
won’t vendor any directories unless they contain a go file (which C/C++ libraries obviously won’t) and there’s no way to request that it do so.
–
I’m trying to use it like any other go package.
go get "github.com/AllenDang/cimgui-go"
go mod vendor
I import:
import (
"github.com/AllenDang/cimgui-go"
)
It shows up properly in my go.mod:
require github.com/AllenDang/cimgui-go v0.0.0-20221118092040-698de0565142
But when I go build
my application:
% go build
# github.com/AllenDang/cimgui-go
In file included from vendor/github.com/AllenDang/cimgui-go/backend.go:20:
In file included from ./backend.h:3:
./cimgui_wrapper.h:3:10: fatal error: 'cimgui/cimgui.h' file not found
#include "cimgui/cimgui.h"
^~~~~~~~~~~~~~~~~
1 error generated.
If I clone this repo separately and go build
it seems to build fine.
I’m guessing it has to do with the way vendored modules work? Any idea how to fix it?
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 15 (7 by maintainers)
Commits related to this issue
- makefile: create placeholder doc.go packages in C dependencies to include them in vendor see #34 — committed to gucio321/cimgui-go by gucio321 a year ago
- makefile: create placeholder doc.go packages in C dependencies to include them in vendor see #34 — committed to gucio321/cimgui-go by gucio321 a year ago
- makefile: generate common dummy.go for the whole project this is in order to include all sub-dymmies in vendor directory see https://github.com/AllenDang/cimgui-go/issues/34 see https://github.com/g... — committed to gucio321/cimgui-go by gucio321 4 months ago
git submodules aren’t the problem - we want those!
It’s
go vendor
. It won’t vendor any directories unless they contain a go file - which C/C++ libraries won’t.not really - this problem doesn’t depend on cimgui/cimplot being submodules or not; it is caused by lack of go files in cimgui/cimplot dirs
yah and it will not work, because git will complain about these files
well, so we may try write a
design-doc
and fill a proposal in go’s repo or do a workaround a create aMakefile
like @asmaloney suggestedYes, I looked through all of this and another option is to try to use dummy files, but you would need to put one in every single directory that needs to be copied. I saw an example of this somewhere and it’s messy & error prone.
Since this project doesn’t control the external ones, you would also need to run an extra command anyways to make it happen, so I figured if we have proper submodules people can do what they like - e.g. I would use Makefiles some other people might write a shellscript.
It’s a total mess & I don’t get why the golang people don’t want to help solve it, but 🤷
If I:
vendor/
go get "github.com/AllenDang/cimgui-go"
go mod vendor
go build
It builds properly.