Skip to content
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

fix build with EOSIO_COMPILE_TEST_CONTRACTS and cdt 4.1 #1029

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

spoonincode
Copy link
Member

@spoonincode spoonincode commented Nov 13, 2024

This EOSIO_DISPATCH was causing a build failure,

/spring/unittests/contracts/eosio.system/eosio.system.cpp:313:29: error: use of undeclared identifier 'sellram'
      (buyrambytes)(buyram)(sellram)(delegatebw)(undelegatebw)(refund)
                            ^
/spring/unittests/contracts/eosio.system/eosio.system.cpp:304:1: error: no member named 'BLUEGRASS_META_SEQ_ENUM_BLUEGRASS_META_SEQ_SIZE_BLUEGRASS_META_SEQ_SIZE_33' in 'eosiosystem::system_contract'
EOSIO_DISPATCH( eosiosystem::system_contract,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/opt/cdt/4.1.0/bin/../include/eosiolib/contracts/eosio/dispatcher.hpp:126:13: note: expanded from macro 'EOSIO_DISPATCH'
            EOSIO_DISPATCH_HELPER( TYPE, MEMBERS ) \
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/opt/cdt/4.1.0/bin/../include/eosiolib/contracts/eosio/dispatcher.hpp:103:5: note: expanded from macro 'EOSIO_DISPATCH_HELPER'
    BLUEGRASS_META_FOREACH_SEQ( EOSIO_DISPATCH_INTERNAL, TYPE, MEMBERS )
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/opt/cdt/4.1.0/bin/../include/bluegrass/meta/preprocessor.hpp:196:125: note: expanded from macro 'BLUEGRASS_META_FOREACH_SEQ'
   BLUEGRASS_META_EXPAND(BLUEGRASS_META_EXPAND(BLUEGRASS_META_GET_NTH_ARG BLUEGRASS_META_GET_NTH_ARG_SEQ_ARGS(__VA_ARGS__)) BLUEGRASS_META_FOREACH_SEQ_ARGS(MAC, D, ##__VA_ARGS__))
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
note: (skipping 7 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
/usr/opt/cdt/4.1.0/bin/../include/bluegrass/meta/preprocessor.hpp:122:47: note: expanded from macro 'BLUEGRASS_META_FE1'
#define BLUEGRASS_META_FE1(MAC,  A, B) MAC(A, B)
                                              ^
/usr/opt/cdt/4.1.0/bin/../include/eosiolib/contracts/eosio/dispatcher.hpp:98:78: note: expanded from macro 'EOSIO_DISPATCH_INTERNAL'
       eosio::execute_action( eosio::name(receiver), eosio::name(code), &OP::elem ); \
                                                                             ^
/usr/opt/cdt/4.1.0/bin/../include/bluegrass/meta/preprocessor.hpp:10:36: note: expanded from macro 'BLUEGRASS_META_EXPAND_I'
#define BLUEGRASS_META_EXPAND_I(x) x

(and more similar errors)

I can't see any reason to use EOSIO_DISPATCH? So just remove it. This allows building EOSIO_COMPILE_TEST_CONTRACTS with cdt 4.1. I at least passed unit_test locally so let's see how this goes...

I am hesitant to touch #677; I don't see the same errors locally (like in eosio.mechanics) so maybe there is some other issue? idk maybe someone else chime in and/or try themselves to see if we should close out #677

@spoonincode
Copy link
Member Author

spoonincode commented Nov 13, 2024

okay after some discussion will consider this closing #677; I hadn't noticed 677 had been partially worked already so this probably just resolved the final lingering issue.

@spoonincode spoonincode linked an issue Nov 13, 2024 that may be closed by this pull request
@spoonincode spoonincode merged commit 22a6dde into main Nov 13, 2024
36 checks passed
@spoonincode spoonincode deleted the compile_test_contracts_fix_cdt41 branch November 13, 2024 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix compilation of test contracts in spring (using cdt 4.1.0-rc3)
3 participants