-
Notifications
You must be signed in to change notification settings - Fork 859
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
building libgit2 for Fritzing limitations #3646
Comments
I think the workaround is the only way to go. It is good to be aware of this, however, and maybe it is possible to add a check and a warning in the .pri file. |
@mMerlin I have being trying to build on Linux and faced similar issues 😫 l can build the static version of libgit2, Fritzing finds the lib, but the build still fails. This happens because static libraries (in our case libgit2) need to be manually linked to external dependencies (e.g., http_parser) when building the Qt project. @KjellMorgenstern Fixing this issue should also make it easy for people to build on Linux by simply following the wiki instructions and hopefully save some struggling and frustrating moments 😉 Another approach is to build using dynamic library on Linux, see here. @Why-not-now this may be a similar issue, are you building on Win or Linux? |
@janclod does yout patch handle using the installed parser, when it exists, and falling back to the bundled version when it does not? I think the extra library needs to be conditionally included. Not always. |
@mMerlin well spotted! I was a bit too quick 😅 my patch allows static libgit2 to find the http_parser when libgit2 is built in the presence of http_parser. When libgit2 is built on a machine in the absence of http_parser, the build indeed fails. If it is possible, I will try to add conditional addition of http_parser and update the pull request. |
@mMerlin after some more testing I have to admit that I was definitely too naive when thinking this issue would be easy to fix 😓 I tried to build my code inside the Docker container fritzing/build:bionic... the build breaks 😩
|
In the meantime I did update the code to allow for building on different distributions (e.g., bionic, focal) and different setups (e.g. w/ or w/o http_parser installed in the system). I tested this on fritzing/build:bionic and my own focal distro. The build works 🥳 Perhaps one more test should be to build inside the fritzing/build:fedora? |
The pull request should allow for building fritzing both in the presence and absence of http_parser lib. The code successfully builds on:
|
Current Behaviour
While setting up the Qt Creator environment to build/run/debug Fritzing, I was reviewing the build information for libgit2. I noticed that it was using the bundled code for the http parser, even though http-parse was one of the dependencies included for libgit2-devel. So I tried installing http-parser-devel. That got the libgit2 build to show that it was no longer using the bundled code, BUT, when later attempting to build the phoenix project, I got a bunch or error messages just before the build failed.
It appears that the libgit build references the external http-parser library, but that the Fritzing build does not notice that, does not include the library in its build. Some research on the Internet found the same case for another project -- cargo build fails with undefined references to http-parser functions -- from 5+ years ago. Looking at the commits linked to that did not tell me what the real fix was, since that seems to be just updating versions for dependencies. Have to dig further down the chain to see what was needed. I expect it just needs an extra library passed to the linker, but need to also know when that is needed.
Operating System:
Fedora 31 workstation
boost_1_72_0
libgit2 v0.28.4
Qt 5.12.7
Steps to reproduce:
Expected Behaviour
The Fritzing build should work whether libgit2 is built with the bundled or external http-parser functions.
Workaround
For now, just DONT have http-parser-devel installed when building libgit2
The text was updated successfully, but these errors were encountered: