-
Notifications
You must be signed in to change notification settings - Fork 316
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
Order of build matters with respect to git2go and Go cross compiler building #158
Comments
In your second example you're running 'go build', which is not going to work regardless of when you do it. |
That is, if you're making 'go build' actually build git2go, it's not going to work no matter what. I you're building the corss-compiler after installing git2go, you've presumably made the timestamp of all the code in the go library/runtime be later than the build of git2go, so it tries to build it again, which is what won't work. |
Thanks for the reply. Much appreciated. I think you're making two separate points. The first point is do not try to build git2go using go build. I understand that, and I'm not doing that and never was doing that. The compilation failure I show which fails around git2.h occurs in the building of a sample app in package main located at sample app source path GOPATH/src/t/ (you can see this reflected in the shell prompt). This sample build is building an app that relies on previously built and installed git2go per your git2go README instructions. I'm sorry I was not more clear on that. Your second point is the one that I think really matters. If I build the cross compilers after installing git2go , then building any sample app using the installed git2go will fail. I think that is what you mean. Here is the successful Dockerfile in its entirety. Not shown now is the building of sample app that used git2go, which would have occurred after the last line (or in scripting in the container with "docker run -it tag bash" or some such). |
Yeah, I didn't notice you were building a different program with the Go's assumption that you can always just rebuild with its own tool is what's hitting us here. The way to work around this would be to link dynamically but that's not a very nice option when following the main branch. I am thinking of creating a branch to stay at libgit2 v0.22 (once it releases Real Soon Now) so you can use 'go build' to work around this (and partially solve #143), but it would require a release of libgit2 to exist on the system (though that shouldn't be a huge issue). |
Thank you for git2go. Very handy.
While building a Docker container image suitable for building Go apps that could leverage git2go, I ran across something interesting.
The container Dockerfile also happens to include building the Go cross compilers for darwin and windows. If I build the container with this ordering of statements with respect to the cross compilers and git2go
the resulting Go environment can successfully build a sample Go app that uses the git2go library.
However, if I reverse the order of building the cross compilers with the building of git2go, I cannot build the sample app. The sample app build in this case fails with
I don't know the reason for this, but wanted to make the observation here.
The text was updated successfully, but these errors were encountered: