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

fix vendoring with go mod vendor #88

Merged
merged 2 commits into from
May 24, 2020
Merged

fix vendoring with go mod vendor #88

merged 2 commits into from
May 24, 2020

Conversation

vrischmann
Copy link
Contributor

A directory with a single C file in it will not be vendored by go mod vendor, see this issue.

This commits adds a workaround by putting dummy Go files which makes go mod behave correctly.

It's not ideal but I don't see another way (other than requiring users to manually copy the file in their vendor directory).

A directory with a single C file in it will not be vendored by `go mod
vendor`.

This commits adds a workaround by putting dummy Go files which makes go
mod behave correctly.
@AdamSLevy
Copy link
Collaborator

Thanks for catching this. So according to that issue its a no-no to put those C files in a sub-directory because if they change it won't trigger a rebuild. This is a bit of a dilemma because compilation time is super slow and I moved the files there to allow for two different compilation modes: static and linked. I may need to rethink my approach in light of this detail.

In any case I think this is a decent solution. I need to test it still but I would also like to see comments added to the dummy.go files that explain what purpose they are serving.

@AdamSLevy
Copy link
Collaborator

Looks good. Once I test it I'll get this merged.

@vrischmann
Copy link
Contributor Author

Thanks !

@AdamSLevy AdamSLevy merged commit e49f25b into crawshaw:master May 24, 2020
nwidger pushed a commit to nwidger/golua that referenced this pull request Jul 22, 2020
A directory with only C files will not be vendored by go mod vendor,
see this issue: golang/go#26366,
specifically, Russ Cox's response
golang/go#26366 (comment).

Because of this, when vendoring github.com/aarzilli/golua with go mod
vendor, the C header files under github.com/aarzilli/golua/lua/lua are
not vendored.  This commits adds a workaround to this issue by adding
dummy Go files which makes go mod behave correctly.  This workaround
was based on a similar one found here:
crawshaw/sqlite#88.
aarzilli pushed a commit to aarzilli/golua that referenced this pull request Jul 30, 2020
A directory with only C files will not be vendored by go mod vendor,
see this issue: golang/go#26366,
specifically, Russ Cox's response
golang/go#26366 (comment).

Because of this, when vendoring github.com/aarzilli/golua with go mod
vendor, the C header files under github.com/aarzilli/golua/lua/lua are
not vendored.  This commits adds a workaround to this issue by adding
dummy Go files which makes go mod behave correctly.  This workaround
was based on a similar one found here:
crawshaw/sqlite#88.
aarzilli pushed a commit to aarzilli/golua that referenced this pull request Jul 30, 2020
A directory with only C files will not be vendored by go mod vendor,
see this issue: golang/go#26366,
specifically, Russ Cox's response
golang/go#26366 (comment).

Because of this, when vendoring github.com/aarzilli/golua with go mod
vendor, the C header files under github.com/aarzilli/golua/lua/lua are
not vendored.  This commits adds a workaround to this issue by adding
dummy Go files which makes go mod behave correctly.  This workaround
was based on a similar one found here:
crawshaw/sqlite#88.
aarzilli pushed a commit to aarzilli/golua that referenced this pull request Jul 30, 2020
A directory with only C files will not be vendored by go mod vendor,
see this issue: golang/go#26366,
specifically, Russ Cox's response
golang/go#26366 (comment).

Because of this, when vendoring github.com/aarzilli/golua with go mod
vendor, the C header files under github.com/aarzilli/golua/lua/lua are
not vendored.  This commits adds a workaround to this issue by adding
dummy Go files which makes go mod behave correctly.  This workaround
was based on a similar one found here:
crawshaw/sqlite#88.
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

Successfully merging this pull request may close these issues.

2 participants