scripted-diff: Remove #include <boost/foreach.hpp>#10193
scripted-diff: Remove #include <boost/foreach.hpp>#10193laanwj merged 5 commits intobitcoin:masterfrom
Conversation
549107d to
f55b6b8
Compare
|
concept ACK, but maybe follow [after verification/approval] with a removal of the includes too? |
4733a94 to
3a40f0b
Compare
|
concept ACK Very good! |
3a40f0b to
c90307c
Compare
c90307c to
c1b4089
Compare
|
Updated OP and code increasing the scope to fully Although I expect travis to pass, I encountered a problem and "fixed it" by commenting part of prevector_tests.cpp in cc40182 I tried eb83e88 and some trivial edits to the commented lines and I don't know what else to try. If anybody can help with this it would be very welcomed. If we cannot solve this soon or reverse_iterator.hpp is not acceptable even temporarily for some reason I suggest to go back to remove BOOST_FOREACH everywhere and #include <boost/foreach.hpp> everywhere except for the few places that use BOOST_REVERSE_FOREACH as a first step. But I hope we don't need to do that. |
src/reverse_iterator.hpp
Outdated
There was a problem hiding this comment.
is the decltype even needed?
There was a problem hiding this comment.
Yes, if I remove it I get ‘begin’ function uses ‘auto’ type specifier without trailing return type.
If I replace the auto with T::reverse_iterator I get need ‘typename’ before ‘T::reverse_iterator’ because ‘T’ is a dependent scope.
There was a problem hiding this comment.
@jtimon right, omitting decltype is a C++14 feature - my bad
src/init.cpp
Outdated
There was a problem hiding this comment.
PAIRTYPE only exists in service of BOOST_FOREACH, would it make sense to remove it in this PR as well?
|
Luke points out that if only travis is running this it is a vulnerability because we'll be falsely confident in the changes. Other people should run it, but then we're exposed because I assume many people have a workflow that will git pull / git diff and run scripts without reading all the commit messages. spudowiar suggested on IRC that the review script ask you to confirm the script it's going to run. And I think when it's run outside of travis thats what it should do, and it answers the above concerns... reviewers can check this without creating a gratuitous invisible script vector. |
|
The issue that you can not trust travis for the result of the run (i.e. red vs green) is true regardless of the scripted-diff script. Though, I agree with @gmaxwell that travis serves as a good tool to notify pr authors of issues with the commit. Also agree that the interactive approach should prevent most evil scripts from being run. |
c1b4089 to
f396834
Compare
|
It seems some more general comments really belong in #10189 . @tjps I tried to remove PAIRTYPE but it seems Q_FOREACH needs it too. EDIT: @ipoptika reminder that "UNDO: I really don't understand why this is failing" should get out of the PR (solved somehow) before merging this |
f396834 to
d0cbbbe
Compare
d0cbbbe to
aa6e83a
Compare
|
Rebased. I still don't know what's wrong with the reverse iterator, so I separated the first 3 commits in #10502 |
76dd40b to
02298d0
Compare
|
Needed rebase, see #10502 (comment) |
-BEGIN VERIFY SCRIPT- sed -i ':a;N;$!ba;s/#include <boost\/foreach.hpp>\n//' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ./src/*/*/*.h ./src/*/*/*.cpp -END VERIFY SCRIPT- Signed-off-by: Pasta <[email protected]>
-BEGIN VERIFY SCRIPT- sed -i 's/BOOST_REVERSE_FOREACH(\(.*\), \(.*\))/for (\1 : reverse_iterate(\2))/' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ; -END VERIFY SCRIPT- Signed-off-by: Pasta <[email protected]>
...where it will be needed Taken from https://gist.github.com/arvidsson/7231973 with small modifications to fit the bitcoin core project
4d4fb33 Rename member field according to the style guide. (Pavel Janík) Pull request description: After bitcoin#10193, approx. five instances of this warning are printed when compiling with `-Wshadow`: ``` In file included from txmempool.cpp:14: ./reverse_iterator.h:20:22: warning: declaration shadows a field of 'reverse_range<T>' [-Wshadow] reverse_range(T &x) : x(x) {} ^ ./reverse_iterator.h:17:8: note: previous declaration is here T &x; ^ 1 warning generated. ``` Tree-SHA512: 6c07c2ed6f4f232a3a8bdcdd6057040967c74552fd29d80f42e8a453b95baf203c410aa31dccc08ff2e765cbba02b1a282f6ea7804955f09b31ab20ef383792e
Backport Boost removal PRs Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#7613 - bitcoin/bitcoin#10502 - bitcoin/bitcoin#10193 - bitcoin/bitcoin#13961 - bitcoin/bitcoin#13734 - Only the second commit (we don't need the first). - bitcoin/bitcoin#14480 Part of #4819.
EDIT: Originally this was only going to remove 'BOOST_FOREACH' and '#include <boost/foreach.hpp>' from src/qr, then src/wallet too, but by popular demand, the scope is increased to fully remove #include <boost/foreach.hpp> the whole project.
Apart from a few small self documented commits in preparation for the scripted commits, the content of the scripted scripts themselves is:
Dependencies: