-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Add UniValue as subtree #6637
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
Add UniValue as subtree #6637
Conversation
concept ACK, of course :) |
Please use --squash when modifying subtrees. It avoids the confusing incorporation of the other project's commits in our history, and allows the contrib/devtools/git-subtree-check.sh tool to verify that the claimed included commit actually has the intended contents. |
ccf8779
to
8f13ec9
Compare
@sipa: done. |
Better, but this should really be an external shared library... Concept ACK |
Is there any modern package management solution for C++? |
pkg-config works great. |
Wouldn't dynamic library and or pkg-config require broad support in various distributions over their package management? Personally I would recommend static linking of the JSON stack. It's a critical library and an a hacked JSON stack could lead to coin stealing. |
@jonasschnelli It's not a consensus-critical library, which is the only exception where static linking makes sense. A hacked glibc, or even any other software on the PC can lead to coin stealing - there is nothing special about the JSON library. (obviously the gitian binaries and depends system would be used to continue to static link regardless of proper dependency handling) |
@luke-jr: ok, fair enough. |
@jonasschnelli: can you explain why the univalue tests cannot be included?
I don't see how the current code in Bitcoin Core matters, as it is replaced
by upstream UniValue.
|
@sipa: Recently we have coupled UniValue with For bitcoin-core, we compile univalue without the number parse functions because we have them already over |
FWIW, the numberparse code is very nicely C/C++ standard and not tied to Univalue or bitcoin at all. For the univalue tests, we could create an optional libtest for this case, if no better solution appears. |
Well that's not good, libunivalue should not depend on any code from
bitcoin. And apparently, it doesn't even need to because it has its own
number conversion functions. Why not just use those?
|
@sipa It's not a dependency so much as a commonality. univalue and bitcoin both use ParseInt32 test/util_tests.cpp uses ParseInt32, ParseInt64 and ParseDouble, but that is a circular unit test dependency to be ignored. |
How about renaming the one in libunivalue, or putting it in another
namespace, so they don't clash. I don't care about duplication of such a
tiny function.
|
UniValue doesn't depend on any code. It now just have an option ( I think it would make sense to just namespace the |
Got it. Yeah, that seems like the cleanest approach.
|
15c92ac
to
74f8e69
Compare
Updated this PR:
|
Travis issue is because of missing -fPIC support in UniValue. This PR (jgarzik/univalue#6) should fix it (add libtool script). |
@jonasschnelli What build object needs -fPIC? UniValue has been built as a *.a library without problems... |
I think it's recommended to build a *.la (libtool) library to gain more flexibility. Travis complains about missing -fPIC recompile support: Secp256k1 also uses libtool and fPIC: |
74f8e69
to
6b148e3
Compare
b8d5e45
to
5aa54a9
Compare
It's already one more thing to keep in sync, as univalue is being developed
outside of Bitcoin Core. Using a subtree is just one way of keeping track.
|
I hadn't used subtrees before, was confused as to the intention. After some further research, concept ACK 👍 |
5aa54a9
to
2c3e80a
Compare
@jonasschnelli @theuni @jgarzik Is this ready for merge? If so I think we should do a rebase and then immediately merge, to prevent it getting out of sync due to large number of files touched. |
git-subtree-dir: src/univalue git-subtree-split: 87d9045
2c3e80a
to
a852943
Compare
Rebased and force-pushed, ... waiting for travis now. |
a852943
to
8a046aa
Compare
similar to secp256k1 include and compile univalue over a subtree
8a046aa
to
9623e93
Compare
Upstream univalue tree has all the changes from @theuni - should be ready for merge. |
"make[3]: *** No rule to make target `libunivalue.la'. Stop." hrm, might need LT_INIT in bitcoin configure.ac. |
db762c6
to
d5d195d
Compare
d5d195d
to
95acf3c
Compare
Travis is happy now. |
Note: As usual after large build system changes, if you get:
You need to re-do Edit: ACK |
ACK |
"git clean -dfx" is your friend. :) |
Add UniValue as subtree Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#6637 - bitcoin/bitcoin#6239 - bitcoin/bitcoin#6379 - bitcoin/bitcoin#6456 - bitcoin/bitcoin#6788
This PR adds UniValue over a git subtree. Main repository is currently https://github.com/jgarzik/univalue.
Edit:
You need to re-do ./autogen.sh and ./configure after this is merged