-
Notifications
You must be signed in to change notification settings - Fork 37.7k
build: Finish up out-of-tree changes #8133
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
Conversation
Don't glob the leveldb for dist. That means we need to enumerate the headers.
- clear the __pycache__ during 'make clean' - Copy the qrc locale file to a temp location and remove it when finished (rcc expects everything to be in the same path)
- Link pull-tester/rpc-tests.py to the build dir - Add the build-dir's config to the python path so that tests can find it - The tests themselves are in srcdir - Clean up __pycache__ in 'make clean'
c2c7a4d
to
142ffc7
Compare
The plist is generated, lives in builddir.
@@ -37,7 +38,7 @@ | |||
# terminal via ANSI escape sequences: | |||
BOLD = ('\033[0m', '\033[1m') | |||
|
|||
RPC_TESTS_DIR = BUILDDIR + '/qa/rpc-tests/' | |||
RPC_TESTS_DIR = SRCDIR + '/qa/rpc-tests/' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to myself: Does the cache (from create_cache.py
et al.) end up in SRCDIR now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't it always (and still is) the case that the cache ends up in the current directory when the tests are launched?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct.
Though, this should be changed. Having different caches lying around in folders that happen to be your working dir right then is misleading at best.
Anyway, this is unrelated to this pull.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm having a hard time answering that question because of the symlink interaction with Python. builddir/rpc-tests.py is now a symlink to sourcedir/rpc-tests.py because it needs to be writable. But that makes the definition of "current dir" hazy.
@MarcoFalke I suppose it would be best to make the location explicit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, this is on my list of cleanups. If no one beats me to it, you can expect it some time after feature freeze. ;)
Concept ACK |
Generally speaking, if it's used as-is from git, it's srcdir. If it's generated or pre-processed, it's builddir. Put another way: after checkout, think of srcdir as read-only. If anything is modified, it must happen in builddir. |
utACK 142ffc7 |
Running test/bitcoin-util-test.py...
Traceback (most recent call last):
File "../../src/test/bitcoin-util-test.py", line 8, in <module>
import buildenv
ImportError: bad magic number in 'buildenv': b'\x03\xf3\r\n' |
@MarcoFalke Yes, I just saw that as well while trying to answer the question above. I'm not sure why Travis passes. I'll fix that one up. |
Pushed a quick fix for @MarcoFalke's problem. I'm not sure if we really need that or not, but it's probably better than each dev running into the problem and googling for themselves. The issue is this: previous invocations of python2 in an in-tree build would leave a buildenv.pyc hanging around in srcdir. We prepend python's search path with builddir, but for some reason it ends up finding the srcdir/buildenv.pyc (and missing .py) before the builddir/buildenv.py. python3 refuses to load the old python2 .pyc, and errors because it can't find a .py at the same path for recompilation. With python3, pyc's are organized into a pycache dir, and tagged like: pycache/buildenv.cpython-35.pyc. So it should not be possible to hit this case anymore. |
…builds This was caused by an pyc files hanging around from previous python2 invocations, when the matching .py missing from that path. This should not be a problem with python3's tagged caches.
Tested ACK 340012d |
@@ -29,6 +29,7 @@ | |||
import tempfile | |||
import re | |||
|
|||
sys.path.append("qa/pull-tester/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it safe to assume everyone runs the tests from the root of buildir?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not, but FWIW at least I do...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh, I run them from qa/pull-tester. I had no idea you could run them from the root...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how to fix this...
What about byte-compiling the rpc-tests.py instead of linking?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh, I run them from qa/pull-tester. I had no idea you could run them from the root...
Same here. But running from the root is ok with me.
Extensively-tested, with the following results: I built,
Note that:
Observations:
|
BTW seems |
Looks like this is enough: diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include
index 3b39919..327a3d1 100644
--- a/src/Makefile.qt.include
+++ b/src/Makefile.qt.include
@@ -390,13 +390,13 @@ QT_QM=$(QT_TS:.ts=.qm)
SECONDARY: $(QT_QM)
-qt/bitcoinstrings.cpp: $(libbitcoin_server_a_SOURCES) $(libbitcoin_wallet_a_SOURCES)
+$(srcdir)/qt/bitcoinstrings.cpp: $(libbitcoin_server_a_SOURCES) $(libbitcoin_wallet_a_SOURCES)
@test -n $(XGETTEXT) || echo "xgettext is required for updating translations"
$(AM_V_GEN) cd $(srcdir); XGETTEXT=$(XGETTEXT) PACKAGE_NAME="$(PACKAGE_NAME)" COPYRIGHT_HOLDERS="$(COPYRIGHT_HOLDERS)" COPYRIGHT_HOLDERS_SUBSTITUTION="$(COPYRIGHT_HOLDERS_SUBSTITUTION)" $(PYTHON) ../share/qt/extract_strings_qt.py $^
-translate: qt/bitcoinstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(BITCOIN_MM)
+translate: $(srcdir)/qt/bitcoinstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(BITCOIN_MM)
@test -n $(LUPDATE) || echo "lupdate is required for updating translations"
- $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(LUPDATE) $^ -locations relative -no-obsolete -ts qt/locale/bitcoin_en.ts
+ $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(LUPDATE) $^ -locations relative -no-obsolete -ts $(srcdir)/qt/locale/bitcoin_en.ts
$(QT_QRC_LOCALE_CPP): $(QT_QRC_LOCALE) $(QT_QM)
@test -f $(RCC) Updated: Also available at: https://github.com/laanwj/bitcoin/tree/2016_06_translate_out_of_tree |
Let's try to get this merged soon. |
@luke-jr I believe I've found the issue here. When you "chown -R root:root .", you're setting the git index to read-only. That makes "git diff" fail to update the index, which makes the diff-index fail. For the sake of this PR, I'm ok with that not working correctly, since git is in a pretty bad state. |
That sounds ominous. Time to switch to mercurial or bzr? :-) |
"works for me" ACK d1a3d57 |
d1a3d57 bulid: fix "make translate" when out-of-tree (Cory Fields) 340012d build: add temporary fix for "bad magic number" error in out-of-tree builds (Cory Fields) 142ffc7 travis: use out-of-tree build (Cory Fields) 92e37a3 build: fix out-of-tree 'make deploy' for osx (Cory Fields) ab95d5d build: a few ugly hacks to get the rpc tests working out-of-tree (Cory Fields) fc4ad0c build: more out-of-tree fixups (Cory Fields) 0cb0f26 build: out-of-tree fixups (Cory Fields)
Haha. That was a half-complete thought as usual. Should read: "I'm ok with that not working correctly, since if you're hitting this case, your git repo is already unreliable". |
d1a3d57 bulid: fix "make translate" when out-of-tree (Cory Fields) 340012d build: add temporary fix for "bad magic number" error in out-of-tree builds (Cory Fields) 142ffc7 travis: use out-of-tree build (Cory Fields) 92e37a3 build: fix out-of-tree 'make deploy' for osx (Cory Fields) ab95d5d build: a few ugly hacks to get the rpc tests working out-of-tree (Cory Fields) fc4ad0c build: more out-of-tree fixups (Cory Fields) 0cb0f26 build: out-of-tree fixups (Cory Fields)
d1a3d57 bulid: fix "make translate" when out-of-tree (Cory Fields) 340012d build: add temporary fix for "bad magic number" error in out-of-tree builds (Cory Fields) 142ffc7 travis: use out-of-tree build (Cory Fields) 92e37a3 build: fix out-of-tree 'make deploy' for osx (Cory Fields) ab95d5d build: a few ugly hacks to get the rpc tests working out-of-tree (Cory Fields) fc4ad0c build: more out-of-tree fixups (Cory Fields) 0cb0f26 build: out-of-tree fixups (Cory Fields)
Update LevelDB to upstream commit f545dfabf Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#7911 - bitcoin/bitcoin#7982 - bitcoin/bitcoin#8133 - bitcoin/bitcoin#8784 - Only the missing changes. - bitcoin/bitcoin#8826 - bitcoin/bitcoin#8613 - bitcoin/bitcoin#10544 - bitcoin/bitcoin#10633 - Only the changes to files and code we have. - bitcoin/bitcoin#10806 - bitcoin/bitcoin#10958 - bitcoin/bitcoin#12451 - bitcoin/bitcoin#13925 - bitcoin/bitcoin#15270 This upgrades LevelDB in the exact same commit progression as upstream, up to January 2019.
Backport migration from rpc-tests.sh to rpc-tests.py Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#6567 - bitcoin/bitcoin#6523 - bitcoin/bitcoin#6616 - bitcoin/bitcoin#6788 - Only the commit fixing `rpc-tests.py` - bitcoin/bitcoin#6791 - Only the fix to `qa/rpc-tests/README.md` - bitcoin/bitcoin#6827 - bitcoin/bitcoin#6930 - bitcoin/bitcoin#6804 - bitcoin/bitcoin#7029 - bitcoin/bitcoin#7028 - bitcoin/bitcoin#7027 - bitcoin/bitcoin#7135 - bitcoin/bitcoin#7209 - bitcoin/bitcoin#7635 - bitcoin/bitcoin#7778 - bitcoin/bitcoin#7851 - bitcoin/bitcoin#7814 - Only the changes to the new .py files in this PR. - bitcoin/bitcoin#7971 - bitcoin/bitcoin#7972 - bitcoin/bitcoin#8056 - Only the first commit. - bitcoin/bitcoin#8098 - bitcoin/bitcoin#8104 - bitcoin/bitcoin#8133 - Only the `rpc-tests.py` commit. - bitcoin/bitcoin#8066 - bitcoin/bitcoin#8216 - Only the last two commits. - bitcoin/bitcoin#8254 - bitcoin/bitcoin#8400 - bitcoin/bitcoin#8482 - Excluding the first commit (only affects RPC tests we don't have). - bitcoin/bitcoin#8551 - bitcoin/bitcoin#8607 - Only the pull-tester commit, for conflict removal. - bitcoin/bitcoin#8625 - bitcoin/bitcoin#8713 - bitcoin/bitcoin#8750 - bitcoin/bitcoin#8789 - bitcoin/bitcoin#9098 - bitcoin/bitcoin#9276 - Excluding the second commit (we don't have the changes it requires). - bitcoin/bitcoin#9657 - bitcoin/bitcoin#9807 - bitcoin/bitcoin#9766 - bitcoin/bitcoin#9823
Backport migration from rpc-tests.sh to rpc-tests.py Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#6567 - bitcoin/bitcoin#6523 - bitcoin/bitcoin#6616 - bitcoin/bitcoin#6788 - Only the commit fixing `rpc-tests.py` - bitcoin/bitcoin#6791 - Only the fix to `qa/rpc-tests/README.md` - bitcoin/bitcoin#6827 - bitcoin/bitcoin#6930 - bitcoin/bitcoin#6804 - bitcoin/bitcoin#7029 - bitcoin/bitcoin#7028 - bitcoin/bitcoin#7027 - bitcoin/bitcoin#7135 - bitcoin/bitcoin#7209 - bitcoin/bitcoin#7635 - bitcoin/bitcoin#7778 - bitcoin/bitcoin#7851 - bitcoin/bitcoin#7814 - Only the changes to the new .py files in this PR. - bitcoin/bitcoin#7971 - bitcoin/bitcoin#7972 - bitcoin/bitcoin#8056 - Only the first commit. - bitcoin/bitcoin#8098 - bitcoin/bitcoin#8104 - bitcoin/bitcoin#8133 - Only the `rpc-tests.py` commit. - bitcoin/bitcoin#8066 - bitcoin/bitcoin#8216 - Only the last two commits. - bitcoin/bitcoin#8254 - bitcoin/bitcoin#8400 - bitcoin/bitcoin#8482 - Excluding the first commit (only affects RPC tests we don't have). - bitcoin/bitcoin#8551 - bitcoin/bitcoin#8607 - Only the pull-tester commit, for conflict removal. - bitcoin/bitcoin#8625 - bitcoin/bitcoin#8713 - bitcoin/bitcoin#8750 - bitcoin/bitcoin#8789 - bitcoin/bitcoin#9098 - bitcoin/bitcoin#9276 - Excluding the second commit (we don't have the changes it requires). - bitcoin/bitcoin#9657 - bitcoin/bitcoin#9807 - bitcoin/bitcoin#9766 - bitcoin/bitcoin#9823
This fixes the remaining out-of-tree issues:
make deploy
was brokenmake distcheck
now passes, and Travis has been switched to an out-of-tree build for dogfooding purposes. Fingers-crossed that it works.