Page MenuHomePhabricator

rename UNIQUE_NAME macro to UNIQUE_LOG_NAME
ClosedPublic

Authored by PiRK on Dec 4 2023, 08:01.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC3bb0c1d021c6: rename UNIQUE_NAME macro to UNIQUE_LOG_NAME
Summary

This is a workaround for the build failure with mingw-w64 due to UNIQUE_NAME being defined in nb30.h https://github.com/mingw-w64/mingw-w64/blob/7f54c78e35c2056a6d972261d70e8ba8fbf1191a/mingw-w64-headers/include/nb30.h#L78
The conflict happens in a win64 build with -DBUILD_BITCOIN_CHRONIK=ON

Test Plan

@bot build-win64

Diff Detail

Event Timeline

Tail of the build log:

[395/759] Building CXX object src/avalanche/test/CMakeFiles/test-avalanche.dir/util.cpp.obj
[396/759] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.obj
[397/759] Building CXX object src/avalanche/test/CMakeFiles/test-avalanche.dir/init_tests.cpp.obj
[398/759] Building CXX object src/avalanche/test/CMakeFiles/test-avalanche.dir/delegation_tests.cpp.obj
[399/759] Building CXX object src/avalanche/test/CMakeFiles/test-avalanche.dir/compactproofs_tests.cpp.obj
[400/759] Building CXX object src/avalanche/test/CMakeFiles/test-avalanche.dir/proofcomparator_tests.cpp.obj
[401/759] Building CXX object src/avalanche/test/CMakeFiles/test-avalanche.dir/stakingrewards_tests.cpp.obj
[402/759] Building CXX object src/avalanche/test/CMakeFiles/test-avalanche.dir/voterecord_tests.cpp.obj
[403/759] Building CXX object src/CMakeFiles/server.dir/validation.cpp.obj
[404/759] Building CXX object src/pow/test/CMakeFiles/test-pow.dir/daa_tests.cpp.obj
[405/759] Building CXX object src/wallet/CMakeFiles/wallet.dir/context.cpp.obj
[406/759] Building CXX object src/avalanche/test/CMakeFiles/test-avalanche.dir/proof_tests.cpp.obj
[407/759] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.obj
[408/759] Building CXX object src/avalanche/test/CMakeFiles/test-avalanche.dir/proofpool_tests.cpp.obj
[409/759] Building CXX object src/pow/test/CMakeFiles/test-pow.dir/aserti32d_tests.cpp.obj
[410/759] Building CXX object src/pow/test/CMakeFiles/test-pow.dir/eda_tests.cpp.obj
[411/759] Building CXX object src/wallet/CMakeFiles/wallet.dir/coincontrol.cpp.obj
[412/759] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.obj
[413/759] Building CXX object src/wallet/CMakeFiles/wallet.dir/bdb.cpp.obj
[414/759] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.obj
[415/759] Building CXX object src/pow/test/CMakeFiles/test-pow.dir/grasberg_tests.cpp.obj
[416/759] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.obj
[417/759] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.obj
[418/759] Building CXX object src/avalanche/test/CMakeFiles/test-avalanche.dir/fixture.cpp.obj
[419/759] Building CXX object src/wallet/CMakeFiles/wallet.dir/receive.cpp.obj
[420/759] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.obj
[421/759] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/util.cpp.obj
[422/759] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/signmessage.cpp.obj
[423/759] Building CXX object src/wallet/CMakeFiles/wallet.dir/transaction.cpp.obj
[424/759] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/encrypt.cpp.obj
[425/759] 
[426/759] Building RC object src/CMakeFiles/bitcoin-cli.dir/bitcoin-cli.rc.res
/work/abc-ci-builds/build-win64/src/bitcoin-cli.rc:25: use "" to put " in a string
/work/abc-ci-builds/build-win64/src/bitcoin-cli.rc:25: use "" to put " in a string
[427/759] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.obj
[428/759] 
[429/759] Building RC object src/CMakeFiles/bitcoin-tx.dir/bitcoin-tx.rc.res
/work/abc-ci-builds/build-win64/src/bitcoin-tx.rc:25: use "" to put " in a string
/work/abc-ci-builds/build-win64/src/bitcoin-tx.rc:25: use "" to put " in a string
[430/759] Building CXX object src/pow/test/CMakeFiles/test-pow.dir/fixture.cpp.obj
[431/759] 
[432/759] Building RC object src/CMakeFiles/bitcoinconsensus-shared.dir/bitcoinconsensus-shared.rc.res
/work/abc-ci-builds/build-win64/src/bitcoinconsensus-shared.rc:25: use "" to put " in a string
/work/abc-ci-builds/build-win64/src/bitcoinconsensus-shared.rc:25: use "" to put " in a string
[433/759] Linking CXX executable src/bitcoin-cli.exe
[434/759] Linking CXX shared library src/libbitcoinconsensus.dll
[435/759] Building CXX object src/avalanche/test/CMakeFiles/test-avalanche.dir/peermanager_tests.cpp.obj
[436/759] Building CXX object src/wallet/CMakeFiles/wallet.dir/interfaces.cpp.obj
[437/759] Linking CXX executable src/bitcoin-tx.exe
[438/759] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.obj
[439/759] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.obj
[440/759] Building CXX object src/wallet/CMakeFiles/wallet.dir/spend.cpp.obj
[441/759] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/backup.cpp.obj
[442/759] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.obj
[443/759] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.obj
[444/759] Building CXX object src/avalanche/test/CMakeFiles/test-avalanche.dir/processor_tests.cpp.obj
[445/759] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.obj
[446/759] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.obj
ninja: build stopped: cannot make progress due to previous errors.
Build build-win64 failed with exit code 1

debugging: try building without chronik to see if the error is specific to chronik code

PiRK retitled this revision from [build] workaround for UNIQUE_NAME redefinition to rename UNIQUE_NAME macro to NAME_AND_COUNTER.
PiRK edited the summary of this revision. (Show Details)

rename the macro to avoid the conflict

PiRK published this revision for review.Dec 4 2023, 09:14
Fabien requested changes to this revision.Dec 4 2023, 12:21
Fabien added a subscriber: Fabien.

don't leak the implementation in the name, what you want is a unique name for your logging macro, so UNIQUE_LOG_NAME is fine for example

This revision now requires changes to proceed.Dec 4 2023, 12:21
PiRK retitled this revision from rename UNIQUE_NAME macro to NAME_AND_COUNTER to rename UNIQUE_NAME macro to UNIQUE_LOG_NAME.

use a macro name that better reflects the purpose instead of the implementation

This revision is now accepted and ready to land.Dec 4 2023, 18:17
This revision was automatically updated to reflect the committed changes.