Closed ainar-g closed 6 years ago
Looking https://github.com/golang/go/issues/26366#issuecomment-405683150, it seems that using a tree of C files will not work correctly.
But I still have to use code from a library that is organized as a tree. So I need to flatten that tree as files in my package directory.
Has anyone built a tool that will take a C file and resolve and inline all #include
that are relative to a base directory? This is a subset of what a preprocessor does...
Here is a workaround that may be useful for other projects:
For package github.com/dolmen-go/hid (which embeds C libraries libusb
and hidapi
) I've implemented an ad-hoc C preprocessor (triggered by go generate
) that concatenates all required C files from the subdirectories and produces 3 .h
files (one for each supported platform). The cgo source just includes the the local .h file corresponding to GOOS.
All,
I'm a packager on Gentoo, and I'm hitting this with https://git.sr.ht/~rjarry/aerc.git.
I am required to vendor to build packages under our package manager, and it doesn't look like that is going to change any time soon. Our package manager team sees allowing me to reach out to the network during a build as a massive security hole they don't want to open, and they tell me that having builds that are required to reach out to the network breaks building on unconnected systems.
So, what is the best way to deal with this issue?
Thanks,
William
I have packaged the vend tool from @nomad-software on Gentoo, thanks for writing it.
IMO this is a pretty significant issue since go mod vendor creates vendor directories that are unusable in some situations.
We will use vend for now, but please count me in as someone requesting that this discussion be restarted.
Thanks much for your time,
William
@williamh
Is it acceptable to install athens
as a private proxy for Go modules?
In this way, only athens
needs to access the internet.
Why is this closed? This is still a major issue. Go dep was able to handle this with "unused-packages = false" which means many cannot and will not switch over to go mod.
Why is this closed?
See https://github.com/golang/go/issues/26366#issuecomment-405683150.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?What did you do?
What did you expect to see?
Successful build.
What did you see instead?
The problem is that
go mod -vendor
pruned theexternal/aacenc
folder, which contains the C code needed to build this package.