GithubHelp home page GithubHelp logo

Ship GIT about portacle HOT 8 CLOSED

portacle avatar portacle commented on June 23, 2024
Ship GIT

from portacle.

Comments (8)

Shinmera avatar Shinmera commented on June 23, 2024

As per f3d8981 onwards this should be in now.

from portacle.

Shinmera avatar Shinmera commented on June 23, 2024

Reopening this because GIT is being absolutely horrendous to ship. When built on certain systems some of its components seem to segfault for no (to me) discernible reason. The failure point is usually git-remote-http, in some libcurl call.

Configurations known to work:

  • OS X 10.11, Brew
  • Linux Mint 17.1

Configurations known to break:

  • Arch Linux
  • Windows, MinGWx86_64

from portacle.

Shinmera avatar Shinmera commented on June 23, 2024

The previous breakage is explained by the following fun story:
The thing I was testing was git-remote-http which apparently segfaulted under strange circumstances. The one difference between the setups that I did not notice was that on Arch the root repository that I ran the git-remote-http in had an SSH origin. Apparently git-remote-http does not test whether the origin it gets is even valid for itself, and instead just segfaults if it encounters an URL it does not handle. Since my test machines were set up with an HTTPS clone they worked fine.

Now, on to Windows. Windows has a few more issues, namely every git command crashing if you compile it with NO_GETTEXT, saying something akin to "your vsnprintf is broken". The only reference to this that I could find is a prior bug in gettext itself that stemmed from a _vsnprintf and vsnprintf definition difference in MinGW that was not handled. I assume this special casing has not been backported to Git because there's probably nobody who ever built Git without gettext on Windows. We "solve" this by begrudgingly including gettext anyway.

Now, the next issue is getting Curl/Git to find the ca-certificates.crt file. No matter whether I place the file as curl-ca-bundle.crt right next to all the git binaries or set the CURL_CA_BUNDLE envvar to its location, nothing seems to work properly. straceing the execution does not even show an attempt to find that file. I assume Git has the path hardcoded into itself and passes it on to Curl. We can tell Git about the location of the file through the http.sslcainfo configuration value. However, since we can't use relative paths in that and absolute paths are a no-go due to relocation, we have to do more work. The solution is to introduce a proper unix shell environment (bash.bat) from which the git commands can bootstrap themselves. This environment sets the portacle root as the filesystem root, thus allowing us to specify an "absolute path" in the git configuration, while the path is actually relative to the entire system.

More fun because that's not directly possible. Git bakes the content of the prefix envvar into its executable to calculate the system-wide config from, so we have to change our build to use a prefix that is relative to the portacle root.

from portacle.

Shinmera avatar Shinmera commented on June 23, 2024

My brain is collapsing in on itself

from portacle.

Shinmera avatar Shinmera commented on June 23, 2024

We are almost done. The last remaining hurdle was fortunately no longer a matter of recompiling git, but rather an issue in the scripting and wrapping of the binaries that got resolved through some emacs config changes.

See 06e1248

from portacle.

Shinmera avatar Shinmera commented on June 23, 2024

Ayyyy, I really thought I was done there, eh. Well, time to think again, lol.

The ld-linux.so trick doesn't work any longer when another program is execed. The new program will use the system ld-linux, so we need to actually also wrap execve to inject ld-linux.so again for all future calls. Great!

from portacle.

Shinmera avatar Shinmera commented on June 23, 2024

I got a wrapper that seems to kinda work (ld-wrap.c), except git doesn't like it for to me unknown reasons. It just fails on things like git fetch and push.

from portacle.

Shinmera avatar Shinmera commented on June 23, 2024

Thanks to LD_PRELOAD and the exec* wrappers, this is now dealt with.

from portacle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.