From 01e65f481cf10226b8c0aaa8f163157810b1b53a Mon Sep 17 00:00:00 2001 From: PeosDev Date: Mon, 4 Mar 2019 18:24:29 +0200 Subject: [PATCH 01/33] Configurable stack size --- tools/include/compiler_options.hpp.in | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/include/compiler_options.hpp.in b/tools/include/compiler_options.hpp.in index 9f2650b214..975697b8d4 100644 --- a/tools/include/compiler_options.hpp.in +++ b/tools/include/compiler_options.hpp.in @@ -63,6 +63,11 @@ static cl::opt fno_stack_first_opt( "fno-stack-first", cl::desc("Don't set the stack first in memory"), cl::cat(LD_CAT)); +static cl::opt stack_size_opt( + "stack-size", + cl::desc("Specifies the maximum stack size for the contract. Defaults to ${EOSIO_STACK_SIZE} bytes."), + cl::init(${EOSIO_STACK_SIZE}), + cl::cat(LD_CAT)); static cl::opt fno_post_pass_opt( "fno-post-pass", cl::desc("Don't run post processing pass"), @@ -413,7 +418,6 @@ static void GetLdDefaults(std::vector& ldopts) { if (!fnative_opt) { ldopts.emplace_back("--gc-sections"); ldopts.emplace_back("--strip-all"); - ldopts.emplace_back("-zstack-size="+std::string("${EOSIO_STACK_SIZE}")); ldopts.emplace_back("--merge-data-segments"); if (fquery_opt || fquery_server_opt || fquery_client_opt) { ldopts.emplace_back("--export-table"); @@ -715,10 +719,12 @@ static Options CreateOptions(bool add_defaults=true) { else { ldopts.emplace_back("--lto-O3"); } + ldopts.emplace_back("-zstack-size=" + std::to_string(stack_size_opt)); #else if (fno_stack_first_opt) { ldopts.emplace_back("-fno-stack-first"); } + ldopts.emplace_back("-stack-size=" + std::to_string(stack_size_opt)); if (fno_lto_opt) { ldopts.emplace_back("-fno-lto-opt"); } From 39ccc55baba74f5d7dc2acf10820b8d7b51842ca Mon Sep 17 00:00:00 2001 From: PeosDev Date: Tue, 12 Mar 2019 15:27:07 +0200 Subject: [PATCH 02/33] Update .md files concerning the stack-size parameter --- docs/tools/eosio-cpp.md | 1 + docs/tools/eosio-ld.md | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/tools/eosio-cpp.md b/docs/tools/eosio-cpp.md index 6ebab10a56..2cde5b53df 100644 --- a/docs/tools/eosio-cpp.md +++ b/docs/tools/eosio-cpp.md @@ -54,6 +54,7 @@ compiler options: -fno-lto - Disable LTO -fno-post-pass - Don't run post processing pass -fno-stack-first - Don't set the stack first in memory + -stack-size - Specifies the maximum stack size for the contract -fstack-protector - Enable stack protectors for functions potentially vulnerable to stack smashing -fstack-protector-all - Force the usage of stack protectors for all functions -fstack-protector-strong - Use a strong heuristic to apply stack protectors to functions diff --git a/docs/tools/eosio-ld.md b/docs/tools/eosio-ld.md index 41c29e2532..87f368e834 100644 --- a/docs/tools/eosio-ld.md +++ b/docs/tools/eosio-ld.md @@ -20,6 +20,7 @@ ld options: -fno-lto - Disable LTO -fno-post-pass - Don't run post processing pass -fno-stack-first - Don't set the stack first in memory + -stack-size - Specifies the maximum stack size for the contract -fuse-main - Use main as entry -l= - Root name of library to link -lto-opt= - LTO Optimization level (O0-O3) From 618c23a7e2b83c188bfa06723c607577836ef1b6 Mon Sep 17 00:00:00 2001 From: Jeeyong Um Date: Sat, 23 Mar 2019 15:55:00 +0900 Subject: [PATCH 03/33] Fix typo and error in action_wrapper documentation --- libraries/eosiolib/contracts/eosio/action.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/eosiolib/contracts/eosio/action.hpp b/libraries/eosiolib/contracts/eosio/action.hpp index 17b66a4025..0a7348fc0e 100644 --- a/libraries/eosiolib/contracts/eosio/action.hpp +++ b/libraries/eosiolib/contracts/eosio/action.hpp @@ -425,7 +425,7 @@ namespace eosio { * Example: * @code * // defined by contract writer of the actions - * using transfer act = action_wrapper<"transfer"_n, &token::transfer>;( *this, transfer, {st.issuer,N(active)}, {st.issuer, to, quantity, memo} ); + * using transfer_act = action_wrapper<"transfer"_n, &token::transfer>; * // usage by different contract writer * transfer_act{"eosio.token"_n, {st.issuer, "active"_n}}.send(st.issuer, to, quantity, memo); * // or From a70cf5f1b8c9aea3f0c41f791f58a90f0ca865f7 Mon Sep 17 00:00:00 2001 From: Jeeyong Um Date: Sat, 23 Mar 2019 16:17:45 +0900 Subject: [PATCH 04/33] Allow to instantiate action_wrapper without permission_level --- libraries/eosiolib/contracts/eosio/action.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/eosiolib/contracts/eosio/action.hpp b/libraries/eosiolib/contracts/eosio/action.hpp index 17b66a4025..dd5733dc7e 100644 --- a/libraries/eosiolib/contracts/eosio/action.hpp +++ b/libraries/eosiolib/contracts/eosio/action.hpp @@ -451,6 +451,10 @@ namespace eosio { constexpr action_wrapper(Code&& code, const eosio::permission_level& perm) : code_name(std::forward(code)), permissions({1, perm}) {} + template + constexpr action_wrapper(Code&& code) + : code_name(std::forward(code)) {} + static constexpr eosio::name action_name = eosio::name(Name); eosio::name code_name; std::vector permissions; From d472125c27bcd9fd673043c679af3d49e7f33e2b Mon Sep 17 00:00:00 2001 From: Jeeyong Um Date: Mon, 25 Mar 2019 00:20:31 +0900 Subject: [PATCH 05/33] Include source path for header directory by default --- tools/cc/eosio-cc.cpp.in | 5 +++++ tools/cc/eosio-cpp.cpp.in | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/cc/eosio-cc.cpp.in b/tools/cc/eosio-cc.cpp.in index 1d3860cf13..9674a4093e 100644 --- a/tools/cc/eosio-cc.cpp.in +++ b/tools/cc/eosio-cc.cpp.in @@ -45,6 +45,11 @@ int main(int argc, const char **argv) { std::string tmp_file = std::string(res.c_str())+"/"+input+"-tmp.c"; std::string output; + auto src = SmallString<64>(input); + llvm::sys::path::remove_filename(src); + std::string source_path = src.str().empty() ? "." : src.str(); + new_opts.insert(new_opts.begin(), "-I" + source_path); + output = tmp_file+".o"; new_opts.insert(new_opts.begin(), input); diff --git a/tools/cc/eosio-cpp.cpp.in b/tools/cc/eosio-cpp.cpp.in index c2f69dbe9f..d8a1cdd288 100644 --- a/tools/cc/eosio-cpp.cpp.in +++ b/tools/cc/eosio-cpp.cpp.in @@ -195,9 +195,14 @@ int main(int argc, const char **argv) { llvm::sys::path::system_temp_directory(true, res); std::string tmp_file = std::string(res.c_str())+"/"+llvm::sys::path::filename(input).str(); std::string output; - + generate(opts.comp_options, input, opts.abigen_contract, opts.abigen_resources, opts.abigen); + auto src = SmallString<64>(input); + llvm::sys::path::remove_filename(src); + std::string source_path = src.str().empty() ? "." : src.str(); + new_opts.insert(new_opts.begin(), "-I" + source_path); + if (llvm::sys::fs::exists(tmp_file)) { input = tmp_file; } From 3e10892d15f8b2f548a8529f0ffc554325f4aafb Mon Sep 17 00:00:00 2001 From: smlu Date: Thu, 28 Mar 2019 14:08:49 +0100 Subject: [PATCH 06/33] Fix duplicated symbol error --- libraries/eosiolib/contracts/eosio/transaction.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/eosiolib/contracts/eosio/transaction.hpp b/libraries/eosiolib/contracts/eosio/transaction.hpp index 8f4875ac3c..b1306ddfca 100644 --- a/libraries/eosiolib/contracts/eosio/transaction.hpp +++ b/libraries/eosiolib/contracts/eosio/transaction.hpp @@ -172,7 +172,7 @@ namespace eosio { * @param size - The size of the packed transaction, required for persistence. * @param replace - If true, will replace an existing transaction. */ - void send_deferred(const uint128_t& sender_id, name payer, const char* serialized_transaction, size_t size, bool replace = false) { + inline void send_deferred(const uint128_t& sender_id, name payer, const char* serialized_transaction, size_t size, bool replace = false) { internal_use_do_not_use::send_deferred(sender_id, payer.value, serialized_transaction, size, replace); } /** From af48d9480647be06624289c534522d6119c103d7 Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Fri, 12 Apr 2019 17:04:05 -0400 Subject: [PATCH 07/33] fix for on_notify wild card --- eosio_llvm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eosio_llvm b/eosio_llvm index a41b8e7653..3c026f8b78 160000 --- a/eosio_llvm +++ b/eosio_llvm @@ -1 +1 @@ -Subproject commit a41b8e7653258a4f1a5911ef28c95672efce051e +Subproject commit 3c026f8b7813ad693749d3551353a554c5ca33e7 From 24d47c941be385d47b22798a2b10e46478ed455f Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Fri, 12 Apr 2019 17:32:17 -0400 Subject: [PATCH 08/33] various small fixes --- libraries/eosiolib/contracts/eosio/action.hpp | 4 +++- libraries/eosiolib/contracts/eosio/permission.hpp | 4 ++-- libraries/eosiolib/contracts/eosio/transaction.hpp | 2 +- tools/include/compiler_options.hpp.in | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/libraries/eosiolib/contracts/eosio/action.hpp b/libraries/eosiolib/contracts/eosio/action.hpp index 17b66a4025..283c3039af 100644 --- a/libraries/eosiolib/contracts/eosio/action.hpp +++ b/libraries/eosiolib/contracts/eosio/action.hpp @@ -412,7 +412,9 @@ namespace eosio { template constexpr bool type_check() { static_assert(sizeof...(Ts) == std::tuple_size>::value); - return check_types::value; + if constexpr (sizeof...(Ts) != 0) + return check_types::value; + return true; } /// @endcond diff --git a/libraries/eosiolib/contracts/eosio/permission.hpp b/libraries/eosiolib/contracts/eosio/permission.hpp index 5b2aac1bcc..8660b19d91 100644 --- a/libraries/eosiolib/contracts/eosio/permission.hpp +++ b/libraries/eosiolib/contracts/eosio/permission.hpp @@ -49,7 +49,7 @@ namespace eosio { check_transaction_authorization( const char* trx_data, uint32_t trx_size, const char* pubkeys_data, uint32_t pubkeys_size, const char* perms_data, uint32_t perms_size ) { - internal_use_do_not_use::check_transaction_authorization( trx_data, trx_size, pubkeys_data, pubkeys_size, perms_data, perms_size ); + return internal_use_do_not_use::check_transaction_authorization( trx_data, trx_size, pubkeys_data, pubkeys_size, perms_data, perms_size ); } /** @@ -74,7 +74,7 @@ namespace eosio { microseconds delay ) { int64_t delay_us = delay.count(); check(delay_us >= 0, "negative delay is not allowed"); - internal_use_do_not_use::check_permission_authorization( account.value, permission.value, pubkeys_data, pubkeys_size, perms_data, perms_size, static_cast(delay_us) ); + return internal_use_do_not_use::check_permission_authorization( account.value, permission.value, pubkeys_data, pubkeys_size, perms_data, perms_size, static_cast(delay_us) ); } diff --git a/libraries/eosiolib/contracts/eosio/transaction.hpp b/libraries/eosiolib/contracts/eosio/transaction.hpp index 8f4875ac3c..b1306ddfca 100644 --- a/libraries/eosiolib/contracts/eosio/transaction.hpp +++ b/libraries/eosiolib/contracts/eosio/transaction.hpp @@ -172,7 +172,7 @@ namespace eosio { * @param size - The size of the packed transaction, required for persistence. * @param replace - If true, will replace an existing transaction. */ - void send_deferred(const uint128_t& sender_id, name payer, const char* serialized_transaction, size_t size, bool replace = false) { + inline void send_deferred(const uint128_t& sender_id, name payer, const char* serialized_transaction, size_t size, bool replace = false) { internal_use_do_not_use::send_deferred(sender_id, payer.value, serialized_transaction, size, replace); } /** diff --git a/tools/include/compiler_options.hpp.in b/tools/include/compiler_options.hpp.in index c26558f8a6..d65c88c9f8 100644 --- a/tools/include/compiler_options.hpp.in +++ b/tools/include/compiler_options.hpp.in @@ -544,6 +544,7 @@ static Options CreateOptions(bool add_defaults=true) { #endif #endif #ifndef ONLY_LD + copts.emplace_back("-I./"); if (!sysroot_opt.empty()) { copts.emplace_back("--sysroot="+sysroot_opt); copts.emplace_back("-I"+sysroot_opt+"/include/libcxx"); @@ -555,7 +556,7 @@ static Options CreateOptions(bool add_defaults=true) { copts.emplace_back("-I"+sysroot_opt+"/include/eosiolib/native"); } #ifndef CPP_COMP - copts.emplace_back("-I"+sysroot_opt+"/include/eosiolib/capi"); + copts.emplace_back("-I"+sysroot_opt+"/include/eosiolib/capi"); #endif copts.emplace_back("-I"+sysroot_opt+"/include/eosiolib/core"); copts.emplace_back("-I"+sysroot_opt+"/include/eosiolib/contracts"); From 77bc8a1e07207f5f6f49b176aae50b450baeb1b2 Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Tue, 16 Apr 2019 11:24:27 -0400 Subject: [PATCH 09/33] Update TestsExternalProject.txt --- modules/TestsExternalProject.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/TestsExternalProject.txt b/modules/TestsExternalProject.txt index 4a793d0ce0..b82ed22b60 100644 --- a/modules/TestsExternalProject.txt +++ b/modules/TestsExternalProject.txt @@ -34,7 +34,7 @@ if (EOSIO_RUN_INTEGRATION_TESTS) EosioIntegrationTests SOURCE_DIR "${CMAKE_SOURCE_DIR}/tests/integration" BINARY_DIR "${CMAKE_BINARY_DIR}/tests/integration" - CMAKE_ARGS -DCMAKE_BUILD_TYPE=${TEST_BUILD_TYPE} -DCMAKE_FRAMEWORK_PATH=${TEST_FRAMEWORK_PATH} -DCMAKE_MODULE_PATH=${TEST_MODULE_PATH} -DEOSIO_ROOT=${EOSIO_ROOT} -DLLVM_DIR=${LLVM_DIR} + CMAKE_ARGS -DCMAKE_BUILD_TYPE=${TEST_BUILD_TYPE} -DCMAKE_FRAMEWORK_PATH=${TEST_FRAMEWORK_PATH} -DCMAKE_MODULE_PATH=${TEST_MODULE_PATH} -DEOSIO_ROOT=${EOSIO_ROOT} -DLLVM_DIR=${LLVM_DIR} -DBOOST_ROOT=${BOOST_ROOT} UPDATE_COMMAND "" PATCH_COMMAND "" TEST_COMMAND "" From 478f96fb42f79d6c68f6f043d57da21e2c502fbb Mon Sep 17 00:00:00 2001 From: Zach Butler Date: Tue, 16 Apr 2019 12:05:45 -0400 Subject: [PATCH 10/33] Added Buildkite dependencies for integration tests --- dependencies | 2 ++ tests/CMakeLists.txt | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 dependencies diff --git a/dependencies b/dependencies new file mode 100644 index 0000000000..2c15f5b2f3 --- /dev/null +++ b/dependencies @@ -0,0 +1,2 @@ +# dependencies to pull for cdt integration tests, by branch, tag, or commit hash +eosio=release/1.7.x \ No newline at end of file diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 6108af4e2a..70a8655c14 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,17 +1,32 @@ +@@ -1,18 +1,33 @@ add_test( asset_tests ${CMAKE_BINARY_DIR}/tests/unit/asset_tests ) +set_property(TEST asset_tests PROPERTY LABELS unit_tests) add_test( binary_extension_tests ${CMAKE_BINARY_DIR}/tests/unit/binary_extension_tests ) +set_property(TEST binary_extension_tests PROPERTY LABELS unit_tests) add_test( crypto_tests ${CMAKE_BINARY_DIR}/tests/unit/crypto_tests ) +set_property(TEST crypto_tests PROPERTY LABELS unit_tests) add_test( datastream_tests ${CMAKE_BINARY_DIR}/tests/unit/datastream_tests ) +set_property(TEST datastream_tests PROPERTY LABELS unit_tests) add_test( fixed_bytes_tests ${CMAKE_BINARY_DIR}/tests/unit/fixed_bytes_tests ) +set_property(TEST fixed_bytes_tests PROPERTY LABELS unit_tests) add_test( name_tests ${CMAKE_BINARY_DIR}/tests/unit/name_tests ) +set_property(TEST name_tests PROPERTY LABELS unit_tests) add_test( rope_tests ${CMAKE_BINARY_DIR}/tests/unit/rope_tests ) +set_property(TEST rope_tests PROPERTY LABELS unit_tests) add_test( print_tests ${CMAKE_BINARY_DIR}/tests/unit/print_tests ) +set_property(TEST print_tests PROPERTY LABELS unit_tests) add_test( serialize_tests ${CMAKE_BINARY_DIR}/tests/unit/serialize_tests ) +set_property(TEST serialize_tests PROPERTY LABELS unit_tests) add_test( symbol_tests ${CMAKE_BINARY_DIR}/tests/unit/symbol_tests ) +set_property(TEST symbol_tests PROPERTY LABELS unit_tests) add_test( system_tests ${CMAKE_BINARY_DIR}/tests/unit/system_tests ) +set_property(TEST system_tests PROPERTY LABELS unit_tests) add_test( time_tests ${CMAKE_BINARY_DIR}/tests/unit/time_tests ) +set_property(TEST time_tests PROPERTY LABELS unit_tests) add_test( varint_tests ${CMAKE_BINARY_DIR}/tests/unit/varint_tests ) +set_property(TEST varint_tests PROPERTY LABELS unit_tests) if (eosio_FOUND AND EOSIO_RUN_INTEGRATION_TESTS) add_test(integration_tests ${CMAKE_BINARY_DIR}/tests/integration/integration_tests) -endif() + set_property(TEST integration_tests PROPERTY LABELS integration_tests) +endif() \ No newline at end of file From 66cd2afcac9700fc8ad3a09b6887198fbbb01969 Mon Sep 17 00:00:00 2001 From: Zach Butler Date: Tue, 16 Apr 2019 20:38:27 -0400 Subject: [PATCH 11/33] dependencies file points to zach-1.7-centos-lib pending merge into release/1.7.x --- dependencies | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies b/dependencies index 2c15f5b2f3..7f9178bce8 100644 --- a/dependencies +++ b/dependencies @@ -1,2 +1,2 @@ # dependencies to pull for cdt integration tests, by branch, tag, or commit hash -eosio=release/1.7.x \ No newline at end of file +eosio=zach-1.7-centos-lib # change back to "release/1.7.x" when eos pull request 7140 is merged: https://github.com/EOSIO/eos/pull/7140 \ No newline at end of file From 7a348e236bf632795194409f512083df4e7fad19 Mon Sep 17 00:00:00 2001 From: Zach Butler Date: Tue, 16 Apr 2019 20:42:56 -0400 Subject: [PATCH 12/33] Copy-pasta error --- tests/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 70a8655c14..18c1759423 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,4 +1,3 @@ -@@ -1,18 +1,33 @@ add_test( asset_tests ${CMAKE_BINARY_DIR}/tests/unit/asset_tests ) set_property(TEST asset_tests PROPERTY LABELS unit_tests) add_test( binary_extension_tests ${CMAKE_BINARY_DIR}/tests/unit/binary_extension_tests ) From 35a17ef930e475ed92ba31b40344b9995114e6d4 Mon Sep 17 00:00:00 2001 From: Zach Butler Date: Wed, 17 Apr 2019 19:57:18 -0400 Subject: [PATCH 13/33] EOSIO PR7140 has been merged, reverting dependencies file to release/1.7.x --- dependencies | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies b/dependencies index 7f9178bce8..2c15f5b2f3 100644 --- a/dependencies +++ b/dependencies @@ -1,2 +1,2 @@ # dependencies to pull for cdt integration tests, by branch, tag, or commit hash -eosio=zach-1.7-centos-lib # change back to "release/1.7.x" when eos pull request 7140 is merged: https://github.com/EOSIO/eos/pull/7140 \ No newline at end of file +eosio=release/1.7.x \ No newline at end of file From 59ce33c0b775fed0dad974b784260cdca9966be4 Mon Sep 17 00:00:00 2001 From: Zach Butler Date: Tue, 30 Apr 2019 14:35:05 -0400 Subject: [PATCH 14/33] Created universal pipeline configuration file --- dependencies | 2 -- pipeline.jsonc | 10 ++++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) delete mode 100644 dependencies create mode 100644 pipeline.jsonc diff --git a/dependencies b/dependencies deleted file mode 100644 index 2c15f5b2f3..0000000000 --- a/dependencies +++ /dev/null @@ -1,2 +0,0 @@ -# dependencies to pull for cdt integration tests, by branch, tag, or commit hash -eosio=release/1.7.x \ No newline at end of file diff --git a/pipeline.jsonc b/pipeline.jsonc new file mode 100644 index 0000000000..508acc722c --- /dev/null +++ b/pipeline.jsonc @@ -0,0 +1,10 @@ +{ + "eosio-dot-cdt": + { + "pipeline-branch": "master", + "dependencies": // dependencies to pull for cdt integration tests, by branch, tag, or commit hash + { + "eosio": "release/1.7.x" + } + } +} \ No newline at end of file From f394c58b6b40d55e9f981e6a5ac899be4b8f58aa Mon Sep 17 00:00:00 2001 From: Zach Butler Date: Wed, 8 May 2019 14:35:43 -0400 Subject: [PATCH 15/33] Run CDT pipeline on my test branch --- pipeline.jsonc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipeline.jsonc b/pipeline.jsonc index 508acc722c..c6c367a339 100644 --- a/pipeline.jsonc +++ b/pipeline.jsonc @@ -1,7 +1,7 @@ { "eosio-dot-cdt": { - "pipeline-branch": "master", + "pipeline-branch": "zach-cdt-fixes", "dependencies": // dependencies to pull for cdt integration tests, by branch, tag, or commit hash { "eosio": "release/1.7.x" From c02876849c1100e7f8a636af061eae7f955394ad Mon Sep 17 00:00:00 2001 From: Zach Butler Date: Fri, 10 May 2019 22:17:48 -0400 Subject: [PATCH 16/33] Pipeline has been deployed, point Buildkite back to master --- pipeline.jsonc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipeline.jsonc b/pipeline.jsonc index c6c367a339..508acc722c 100644 --- a/pipeline.jsonc +++ b/pipeline.jsonc @@ -1,7 +1,7 @@ { "eosio-dot-cdt": { - "pipeline-branch": "zach-cdt-fixes", + "pipeline-branch": "master", "dependencies": // dependencies to pull for cdt integration tests, by branch, tag, or commit hash { "eosio": "release/1.7.x" From 3d8e9eb7367d527b996499938d33756e9d5b056d Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Fri, 17 May 2019 14:42:05 -0400 Subject: [PATCH 17/33] fix for missing structs needed for variants --- tools/include/eosio/abigen.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/include/eosio/abigen.hpp b/tools/include/eosio/abigen.hpp index 69a52e96b7..179a38b019 100644 --- a/tools/include/eosio/abigen.hpp +++ b/tools/include/eosio/abigen.hpp @@ -392,6 +392,12 @@ namespace eosio { namespace cdt { if (as.name == _translate_type(remove_suffix(f.type))) return true; } + for ( auto v : _abi.variants ) { + for ( auto vt : v.types ) { + if (as.name == _translate_type(remove_suffix(vt))) + return true; + } + } if (s.base == as.name) return true; } From f8a8e0c8a9bc76dc08df7a4a3030c8c3e2382e2e Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Mon, 20 May 2019 14:05:00 -0400 Subject: [PATCH 18/33] add type during discovery --- tools/include/eosio/abigen.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/include/eosio/abigen.hpp b/tools/include/eosio/abigen.hpp index 179a38b019..3090a92db1 100644 --- a/tools/include/eosio/abigen.hpp +++ b/tools/include/eosio/abigen.hpp @@ -241,8 +241,10 @@ namespace eosio { namespace cdt { auto pt = llvm::dyn_cast(t.getTypePtr()); auto tst = llvm::dyn_cast(pt->desugar().getTypePtr()); var.name = get_type(t); - for (int i=0; i < tst->getNumArgs(); ++i) + for (int i=0; i < tst->getNumArgs(); ++i) { var.types.push_back(translate_type(get_template_argument( t, i ).getAsType())); + add_type(get_template_argument( t, i ).getAsType()); + } _abi.variants.insert(var); } From cf73c5a8140033a49e0d233c76728781626830f3 Mon Sep 17 00:00:00 2001 From: Zach Butler Date: Thu, 13 Jun 2019 14:25:50 -0400 Subject: [PATCH 19/33] Add support for sccache and ccache to CMake --- libraries/CMakeLists.txt | 14 ++++++++++++++ tests/CMakeLists.txt | 14 ++++++++++++++ tools/CMakeLists.txt | 17 ++++++++++++----- 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/libraries/CMakeLists.txt b/libraries/CMakeLists.txt index b49105f81f..d53ed094f5 100644 --- a/libraries/CMakeLists.txt +++ b/libraries/CMakeLists.txt @@ -1,5 +1,19 @@ project(eosio_libraries) +find_program(SCCACHE_FOUND sccache) +if (SCCACHE_FOUND) + message(STATUS "Using sccache") + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE sccache) + set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK sccache) +else() + find_program(CCACHE_FOUND ccache) + if (CCACHE_FOUND) + message(STATUS "Using ccache") + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) + set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) + endif() +endif() + list(APPEND CMAKE_MODULE_PATH ${EOSIO_CDT_BIN}) include(EosioCDTMacros) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 18c1759423..2a08096078 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,3 +1,17 @@ +find_program(SCCACHE_FOUND sccache) +if (SCCACHE_FOUND) + message(STATUS "Using sccache") + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE sccache) + set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK sccache) +else() + find_program(CCACHE_FOUND ccache) + if (CCACHE_FOUND) + message(STATUS "Using ccache") + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) + set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) + endif() +endif() + add_test( asset_tests ${CMAKE_BINARY_DIR}/tests/unit/asset_tests ) set_property(TEST asset_tests PROPERTY LABELS unit_tests) add_test( binary_extension_tests ${CMAKE_BINARY_DIR}/tests/unit/binary_extension_tests ) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 2e02a3a990..df4516e494 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -3,11 +3,18 @@ find_package(LLVM REQUIRED CONFIG) message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}") -find_program(CCACHE_FOUND ccache) -if (CCACHE_FOUND) - message(STATUS "Using ccache") - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) +find_program(SCCACHE_FOUND sccache) +if (SCCACHE_FOUND) + message(STATUS "Using sccache") + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE sccache) + set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK sccache) +else() + find_program(CCACHE_FOUND ccache) + if (CCACHE_FOUND) + message(STATUS "Using ccache") + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) + set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) + endif() endif() include_directories(${LLVM_INCLUDE_DIRS}) From 260904a857b4475583d5e76ba8759c46704322b7 Mon Sep 17 00:00:00 2001 From: Zach Butler Date: Mon, 17 Jun 2019 15:28:32 -0400 Subject: [PATCH 20/33] Update eosio_llvm to support sccache --- eosio_llvm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eosio_llvm b/eosio_llvm index a41b8e7653..8bd2fa5bb1 160000 --- a/eosio_llvm +++ b/eosio_llvm @@ -1 +1 @@ -Subproject commit a41b8e7653258a4f1a5911ef28c95672efce051e +Subproject commit 8bd2fa5bb12b59551540a5676e02b15d1ff5b580 From 7d913bc341fa651ef7e2e8fab1920b4080d0f135 Mon Sep 17 00:00:00 2001 From: Zach Butler Date: Wed, 19 Jun 2019 15:47:40 -0400 Subject: [PATCH 21/33] Remove support for sccache from /libraries because eosio-cc is not a supported compiler --- libraries/CMakeLists.txt | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/libraries/CMakeLists.txt b/libraries/CMakeLists.txt index d53ed094f5..a84135a67f 100644 --- a/libraries/CMakeLists.txt +++ b/libraries/CMakeLists.txt @@ -1,17 +1,10 @@ project(eosio_libraries) -find_program(SCCACHE_FOUND sccache) -if (SCCACHE_FOUND) - message(STATUS "Using sccache") - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE sccache) - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK sccache) -else() - find_program(CCACHE_FOUND ccache) - if (CCACHE_FOUND) - message(STATUS "Using ccache") - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) - endif() +find_program(CCACHE_FOUND ccache) +if (CCACHE_FOUND) + message(STATUS "Using ccache") + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) + set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) endif() list(APPEND CMAKE_MODULE_PATH ${EOSIO_CDT_BIN}) From b99cc694e044add9ac0ad132d434e1b20d833ae6 Mon Sep 17 00:00:00 2001 From: Zach Butler Date: Wed, 19 Jun 2019 18:14:14 -0400 Subject: [PATCH 22/33] Removed "RULE_LAUNCH_LINK ccache" as ccache does not accelerate linking --- CMakeLists.txt | 1 - libraries/CMakeLists.txt | 1 - tests/CMakeLists.txt | 1 - tools/CMakeLists.txt | 1 - 4 files changed, 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5346831d17..be1bd50e3b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,6 @@ else() if (CCACHE_FOUND) message(STATUS "Using ccache") set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) endif() endif() diff --git a/libraries/CMakeLists.txt b/libraries/CMakeLists.txt index a84135a67f..f4e6b33b13 100644 --- a/libraries/CMakeLists.txt +++ b/libraries/CMakeLists.txt @@ -4,7 +4,6 @@ find_program(CCACHE_FOUND ccache) if (CCACHE_FOUND) message(STATUS "Using ccache") set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) endif() list(APPEND CMAKE_MODULE_PATH ${EOSIO_CDT_BIN}) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2a08096078..6f443ad908 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -8,7 +8,6 @@ else() if (CCACHE_FOUND) message(STATUS "Using ccache") set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) endif() endif() diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index df4516e494..52fb033186 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -13,7 +13,6 @@ else() if (CCACHE_FOUND) message(STATUS "Using ccache") set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) endif() endif() From d70cfd0ac707ad3cb4f82996f5c9ca632c6e98ea Mon Sep 17 00:00:00 2001 From: Zach Butler Date: Wed, 19 Jun 2019 18:58:22 -0400 Subject: [PATCH 23/33] Removed "RULE_LAUNCH_LINK sccache" as sccache does not support "ar" or linking in general --- CMakeLists.txt | 1 - tests/CMakeLists.txt | 1 - tools/CMakeLists.txt | 1 - 3 files changed, 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index be1bd50e3b..fa67f18725 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,6 @@ find_program(SCCACHE_FOUND sccache) if (SCCACHE_FOUND) message(STATUS "Using sccache") set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE sccache) - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK sccache) else() find_program(CCACHE_FOUND ccache) if (CCACHE_FOUND) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 6f443ad908..ab8a503bee 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -2,7 +2,6 @@ find_program(SCCACHE_FOUND sccache) if (SCCACHE_FOUND) message(STATUS "Using sccache") set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE sccache) - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK sccache) else() find_program(CCACHE_FOUND ccache) if (CCACHE_FOUND) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 52fb033186..a563e73dd5 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -7,7 +7,6 @@ find_program(SCCACHE_FOUND sccache) if (SCCACHE_FOUND) message(STATUS "Using sccache") set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE sccache) - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK sccache) else() find_program(CCACHE_FOUND ccache) if (CCACHE_FOUND) From cd67425ebdf06c5315eb39dd9f1079822aaa7166 Mon Sep 17 00:00:00 2001 From: Zach Butler Date: Wed, 19 Jun 2019 19:00:23 -0400 Subject: [PATCH 24/33] Update eosio_llvm to remove linker caching --- eosio_llvm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eosio_llvm b/eosio_llvm index 8bd2fa5bb1..ce49c87984 160000 --- a/eosio_llvm +++ b/eosio_llvm @@ -1 +1 @@ -Subproject commit 8bd2fa5bb12b59551540a5676e02b15d1ff5b580 +Subproject commit ce49c87984047fe2ecdcfa1c6ce5c53d9ea6e7c1 From 301691c94a42df5b2be1ef412c19ad90ad9a8ce1 Mon Sep 17 00:00:00 2001 From: learnforpractice Date: Mon, 24 Jun 2019 20:35:31 +0800 Subject: [PATCH 25/33] Fix index_by example --- libraries/eosiolib/contracts/eosio/multi_index.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/eosiolib/contracts/eosio/multi_index.hpp b/libraries/eosiolib/contracts/eosio/multi_index.hpp index e20603cb38..5d3dac4e40 100644 --- a/libraries/eosiolib/contracts/eosio/multi_index.hpp +++ b/libraries/eosiolib/contracts/eosio/multi_index.hpp @@ -350,7 +350,7 @@ namespace _multi_index_detail { * uint64_t primary; * uint128_t secondary; * uint64_t primary_key() const { return primary; } - * uint64_t get_secondary() const { return secondary; } + * uint128_t get_secondary() const { return secondary; } * }; * public: * mycontract(name receiver, name code, datastream ds):contract(receiver, code, ds){} From f22e34d7ccca2c0bb5db054f23491bcccfb1dce7 Mon Sep 17 00:00:00 2001 From: swatanabe-b1 <52169356+swatanabe-b1@users.noreply.github.com> Date: Tue, 25 Jun 2019 12:05:05 -0400 Subject: [PATCH 26/33] Fix doc typo Same as #537 --- docs/guides/generator-attributes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guides/generator-attributes.md b/docs/guides/generator-attributes.md index ee690aaa46..7b0bdca566 100644 --- a/docs/guides/generator-attributes.md +++ b/docs/guides/generator-attributes.md @@ -55,12 +55,12 @@ This will mark this `class` as being an `EOSIO` contract, this allows for namesp #### [[eosio::on_notify("\::\")]] ``` [[eosio::on_notify("eosio.token::transfer")]] -void on_token_transfer(name from, name to, assert quantity, std::string memo) { +void on_token_transfer(name from, name to, asset quantity, std::string memo) { do something on transfer from eosio.token... } [[eosio::on_notify("*::transfer")]] -void on_any_transfer(name from, name to, assert quantity, std::string memo) { +void on_any_transfer(name from, name to, asset quantity, std::string memo) { do something on transfer from any account... } ``` From f42df0749de4fe226047f51e1afacdfffce305c6 Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Thu, 27 Jun 2019 15:43:59 -0400 Subject: [PATCH 27/33] fixes to installation --- CMakeLists.txt | 11 +++++++---- install.sh | 2 +- modules/InstallCDT.cmake | 15 +++++++++------ 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5346831d17..ac95a45e0f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,7 @@ else() set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") endif() + if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) message(WARNING "CMAKE_INSTALL_PREFIX is set to default path of ${CMAKE_INSTALL_PREFIX}, resetting to ${CMAKE_INSTALL_PREFIX}/eosio.cdt") set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/eosio.cdt") @@ -34,6 +35,8 @@ elseif ("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/local") message(WARNING "CMAKE_INSTALL_PREFIX is explicitly set to /usr/local. This is not recommended.") endif() +set(CDT_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/eosio.cdt) + include(GNUInstallDirs) include(modules/ClangExternalProject.txt) @@ -47,13 +50,13 @@ configure_file(${CMAKE_SOURCE_DIR}/modules/eosio.cdt-config.cmake ${CMAKE_BINARY configure_file(${CMAKE_SOURCE_DIR}/modules/EosioCDTMacros.cmake.in ${CMAKE_BINARY_DIR}/lib/cmake/eosio.cdt/EosioCDTMacros.cmake @ONLY) configure_file(${CMAKE_SOURCE_DIR}/modules/EosioWasmToolchain.cmake.in ${CMAKE_BINARY_DIR}/lib/cmake/eosio.cdt/EosioWasmToolchain.cmake @ONLY) -set(CDT_ROOT_DIR ${CMAKE_INSTALL_PREFIX}) +set(CDT_ROOT_DIR ${CDT_INSTALL_PREFIX}) configure_file(${CMAKE_SOURCE_DIR}/modules/eosio.cdt-config.cmake ${CMAKE_BINARY_DIR}/modules/eosio.cdt-config.cmake @ONLY) install(FILES ${CMAKE_BINARY_DIR}/modules/eosio.cdt-config.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/eosio.cdt) configure_file(${CMAKE_SOURCE_DIR}/modules/EosioCDTMacros.cmake.in ${CMAKE_BINARY_DIR}/modules/EosioCDTMacros.cmake @ONLY) configure_file(${CMAKE_SOURCE_DIR}/modules/EosioWasmToolchain.cmake.in ${CMAKE_BINARY_DIR}/modules/EosioWasmToolchain.cmake @ONLY) install(FILES ${CMAKE_BINARY_DIR}/modules/EosioWasmToolchain.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/eosio.cdt) -install(FILES ${CMAKE_BINARY_DIR}/modules/EosioCDTMacros.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/eosio.cdt) +install(FILES ${CMAKE_BINARY_DIR}/modules/EosioCDTMacros.cmake DESTINATION ${CDT_INSTALL_PREFIX}/lib/cmake/eosio.cdt) set(CDT_ROOT_DIR "_PREFIX_") configure_file(${CMAKE_SOURCE_DIR}/modules/EosioCDTMacros.cmake.in ${CMAKE_BINARY_DIR}/modules/EosioCDTMacrosPackage.cmake @ONLY) @@ -65,10 +68,10 @@ include(modules/LibrariesExternalProject.txt) include(modules/InstallCDT.cmake) configure_file(${CMAKE_SOURCE_DIR}/imports/eosio.imports.in ${CMAKE_BINARY_DIR}/eosio.imports COPYONLY) -install(FILES ${CMAKE_BINARY_DIR}/eosio.imports DESTINATION ${CMAKE_INSTALL_PREFIX}) +install(FILES ${CMAKE_BINARY_DIR}/eosio.imports DESTINATION ${CDT_INSTALL_PREFIX}) configure_file(${CMAKE_SOURCE_DIR}/scripts/ricardeos/ricardeos.py ${CMAKE_BINARY_DIR}/scripts/ricardeos.py COPYONLY) -install(FILES ${CMAKE_BINARY_DIR}/scripts/ricardeos.py DESTINATION ${CMAKE_INSTALL_PREFIX}/scripts) +install(FILES ${CMAKE_BINARY_DIR}/scripts/ricardeos.py DESTINATION ${CDT_INSTALL_PREFIX}/scripts) # section for package construction set(VENDOR "block.one") diff --git a/install.sh b/install.sh index dccf6a5a8d..caca639aa0 100755 --- a/install.sh +++ b/install.sh @@ -54,7 +54,7 @@ } install_symlinks() { - printf "\\n\\tInstalling EOSIO.CDT Binary Symlinks\\n\\n" + printf "\\n\\tInstalling EOSIO.CDT Binary Symlinks\\n\\n" create_symlink "llvm-ranlib eosio-ranlib" create_symlink "llvm-ar eosio-ar" create_symlink "llvm-objdump eosio-objdump" diff --git a/modules/InstallCDT.cmake b/modules/InstallCDT.cmake index 1f14b8410f..9f34853cdd 100644 --- a/modules/InstallCDT.cmake +++ b/modules/InstallCDT.cmake @@ -3,7 +3,7 @@ macro( eosio_clang_install file ) set(BINARY_DIR ${CMAKE_BINARY_DIR}/eosio_llvm/bin) add_custom_command( TARGET EosioClang POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${BINARY_DIR}/${file} ${CMAKE_BINARY_DIR}/bin/ ) install(FILES ${BINARY_DIR}/${file} - DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} + DESTINATION ${CDT_INSTALL_PREFIX}/bin PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) endmacro( eosio_clang_install ) @@ -12,15 +12,17 @@ macro( eosio_clang_install_and_symlink file symlink ) add_custom_command( TARGET EosioClang POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${BINARY_DIR}/${file} ${CMAKE_BINARY_DIR}/bin/ ) add_custom_command( TARGET EosioClang POST_BUILD COMMAND cd ${CMAKE_BINARY_DIR}/bin && ln -sf ${file} ${symlink} ) install(FILES ${BINARY_DIR}/${file} - DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} + DESTINATION ${CDT_INSTALL_PREFIX}/bin PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + install(CODE "execute_process( COMMAND ${CMAKE_COMMAND} -E create_symlink ${CDT_INSTALL_PREFIX}/bin/${file} ${CMAKE_INSTALL_PREFIX}/bin/${symlink})") + install(CODE "message(\"-- Created Symlink : ${file} ${symlink}\")") endmacro( eosio_clang_install_and_symlink ) macro( eosio_tool_install file ) set(BINARY_DIR ${CMAKE_BINARY_DIR}/tools/bin) add_custom_command( TARGET EosioTools POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${BINARY_DIR}/${file} ${CMAKE_BINARY_DIR}/bin/ ) install(FILES ${BINARY_DIR}/${file} - DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} + DESTINATION ${CDT_INSTALL_PREFIX}/bin PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) endmacro( eosio_tool_install ) @@ -29,15 +31,16 @@ macro( eosio_tool_install_and_symlink file symlink ) add_custom_command( TARGET EosioTools POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${BINARY_DIR}/${file} ${CMAKE_BINARY_DIR}/bin/ ) add_custom_command( TARGET EosioTools POST_BUILD COMMAND cd ${CMAKE_BINARY_DIR}/bin && ln -sf ${file} ${symlink} ) install(FILES ${BINARY_DIR}/${file} - DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} + DESTINATION ${CDT_INSTALL_PREFIX}/bin PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + install(CODE "execute_process( COMMAND ${CMAKE_COMMAND} -E create_symlink ${CDT_INSTALL_PREFIX}/bin/${file} ${CMAKE_INSTALL_PREFIX}/bin/${symlink})") endmacro( eosio_tool_install_and_symlink ) macro( eosio_libraries_install) execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/lib) execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/include) - install(DIRECTORY ${CMAKE_BINARY_DIR}/lib/ DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) - install(DIRECTORY ${CMAKE_BINARY_DIR}/include/ DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}) + install(DIRECTORY ${CMAKE_BINARY_DIR}/lib/ DESTINATION ${CDT_INSTALL_PREFIX}/lib) + install(DIRECTORY ${CMAKE_BINARY_DIR}/include/ DESTINATION ${CDT_INSTALL_PREFIX}/include) endmacro( eosio_libraries_install ) eosio_clang_install_and_symlink(llvm-ranlib eosio-ranlib) From 13af15de461cb8af002ba9853e86ecf0df17724c Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Thu, 27 Jun 2019 15:56:39 -0400 Subject: [PATCH 28/33] fixed symlinks --- modules/InstallCDT.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/InstallCDT.cmake b/modules/InstallCDT.cmake index 9f34853cdd..2b1fe4c4f4 100644 --- a/modules/InstallCDT.cmake +++ b/modules/InstallCDT.cmake @@ -14,8 +14,8 @@ macro( eosio_clang_install_and_symlink file symlink ) install(FILES ${BINARY_DIR}/${file} DESTINATION ${CDT_INSTALL_PREFIX}/bin PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + install(CODE "execute_process( COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_INSTALL_PREFIX}/bin)") install(CODE "execute_process( COMMAND ${CMAKE_COMMAND} -E create_symlink ${CDT_INSTALL_PREFIX}/bin/${file} ${CMAKE_INSTALL_PREFIX}/bin/${symlink})") - install(CODE "message(\"-- Created Symlink : ${file} ${symlink}\")") endmacro( eosio_clang_install_and_symlink ) macro( eosio_tool_install file ) From c8751aad25ce809c359d6c705ddaea002bea791b Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Thu, 27 Jun 2019 16:59:32 -0400 Subject: [PATCH 29/33] fixed symlinks for tools --- CMakeLists.txt | 12 +++--- install.sh | 84 ++++++++++++---------------------------- modules/InstallCDT.cmake | 20 +++++----- 3 files changed, 40 insertions(+), 76 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ac95a45e0f..e26b165a9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,12 +28,12 @@ else() endif() -if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - message(WARNING "CMAKE_INSTALL_PREFIX is set to default path of ${CMAKE_INSTALL_PREFIX}, resetting to ${CMAKE_INSTALL_PREFIX}/eosio.cdt") - set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/eosio.cdt") -elseif ("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/local") - message(WARNING "CMAKE_INSTALL_PREFIX is explicitly set to /usr/local. This is not recommended.") -endif() +##if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) +## message(WARNING "CMAKE_INSTALL_PREFIX is set to default path of ${CMAKE_INSTALL_PREFIX}, resetting to ${CMAKE_INSTALL_PREFIX}/eosio.cdt") +## set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/eosio.cdt") +##elseif ("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/local") +## message(WARNING "CMAKE_INSTALL_PREFIX is explicitly set to /usr/local. This is not recommended.") +##endif() set(CDT_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/eosio.cdt) diff --git a/install.sh b/install.sh index caca639aa0..f19a1113bf 100755 --- a/install.sh +++ b/install.sh @@ -31,72 +31,36 @@ ########################################################################## - CWD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - if [ "${CWD}" != "${PWD}" ]; then - printf "\\n\\tPlease cd into directory %s to run this script.\\n \\tExiting now.\\n\\n" "${CWD}" - exit 1 - fi + CWD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + if [ "${CWD}" != "${PWD}" ]; then + printf "\\n\\tPlease cd into directory %s to run this script.\\n \\tExiting now.\\n\\n" "${CWD}" + exit 1 + fi - BUILD_DIR="${PWD}/build" - CMAKE_BUILD_TYPE=Release - TIME_BEGIN=$( date -u +%s ) + BUILD_DIR="${PWD}/build" + CMAKE_BUILD_TYPE=Release + TIME_BEGIN=$( date -u +%s ) INSTALL_PREFIX="/usr/local/eosio.cdt" - VERSION=1.2 + VERSION=1.2 - txtbld=$(tput bold) - bldred=${txtbld}$(tput setaf 1) - txtrst=$(tput sgr0) - - create_symlink() { - pushd /usr/local/bin &> /dev/null - ln -sf ../eosio.cdt/bin/$1 $2 - popd &> /dev/null - } - - install_symlinks() { - printf "\\n\\tInstalling EOSIO.CDT Binary Symlinks\\n\\n" - create_symlink "llvm-ranlib eosio-ranlib" - create_symlink "llvm-ar eosio-ar" - create_symlink "llvm-objdump eosio-objdump" - create_symlink "llvm-readelf eosio-readelf" - create_symlink "eosio-cc eosio-cc" - create_symlink "eosio-cpp eosio-cpp" - create_symlink "eosio-ld eosio-ld" - create_symlink "eosio-pp eosio-pp" - create_symlink "eosio-init eosio-init" - create_symlink "eosio-abigen eosio-abigen" - create_symlink "eosio-abidiff eosio-abidiff" - create_symlink "eosio-wasm2wast eosio-wasm2wast" - create_symlink "eosio-wast2wasm eosio-wast2wasm" - } + txtbld=$(tput bold) + bldred=${txtbld}$(tput setaf 1) + txtrst=$(tput sgr0) - create_cmake_symlink() { - mkdir -p /usr/local/lib/cmake/eosio.cdt - pushd /usr/local/lib/cmake/eosio.cdt &> /dev/null - ln -sf ../../../eosio.cdt/lib/cmake/eosio.cdt/$1 $1 - popd &> /dev/null - } - if [ ! -d "${BUILD_DIR}" ]; then + if [ ! -d "${BUILD_DIR}" ]; then printf "\\n\\tError, build.sh has not ran. Please run ./build.sh first!\\n\\n" exit -1 - fi - - if ! pushd "${BUILD_DIR}" - then - printf "Unable to enter build directory %s.\\n Exiting now.\\n" "${BUILD_DIR}" - exit 1; - fi - - if ! make install - then - printf "\\n\\t>>>>>>>>>>>>>>>>>>>> MAKE installing EOSIO has exited with the above error.\\n\\n" - exit -1 - fi + fi + if ! pushd "${BUILD_DIR}"; then + printf "Unable to enter build directory %s.\\n Exiting now.\\n" "${BUILD_DIR}" + exit 1; + fi + if ! make install; then + printf "\\n\\t>>>>>>>>>>>>>>>>>>>> MAKE installing EOSIO has exited with the above error.\\n\\n" + exit -1 + fi popd &> /dev/null - install_symlinks - create_cmake_symlink "eosio.cdt-config.cmake" - printf "\n${bldred}\t ___ ___ ___ ___\n" printf "\t / /\\ / /\\ / /\\ ___ / /\\ \n" printf "\t / /:/_ / /::\\ / /:/_ / /\\ / /::\\ \n" @@ -109,5 +73,5 @@ printf "\t \\ \\::/ \\ \\::/ /__/:/ \\__\\/ \\ \\::/ \n" printf "\t \\__\\/ \\__\\/ \\__\\/ \\__\\/ \n${txtrst}" - printf "\\tFor more information:\\n" - printf "\\tEOSIO website: https://eos.io\\n" + printf "\\tFor more information:\\n" + printf "\\tEOSIO website: https://eos.io\\n" diff --git a/modules/InstallCDT.cmake b/modules/InstallCDT.cmake index 2b1fe4c4f4..4ba5a88502 100644 --- a/modules/InstallCDT.cmake +++ b/modules/InstallCDT.cmake @@ -29,10 +29,10 @@ endmacro( eosio_tool_install ) macro( eosio_tool_install_and_symlink file symlink ) set(BINARY_DIR ${CMAKE_BINARY_DIR}/tools/bin) add_custom_command( TARGET EosioTools POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${BINARY_DIR}/${file} ${CMAKE_BINARY_DIR}/bin/ ) - add_custom_command( TARGET EosioTools POST_BUILD COMMAND cd ${CMAKE_BINARY_DIR}/bin && ln -sf ${file} ${symlink} ) install(FILES ${BINARY_DIR}/${file} DESTINATION ${CDT_INSTALL_PREFIX}/bin PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + install(CODE "execute_process( COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_INSTALL_PREFIX}/bin)") install(CODE "execute_process( COMMAND ${CMAKE_COMMAND} -E create_symlink ${CDT_INSTALL_PREFIX}/bin/${file} ${CMAKE_INSTALL_PREFIX}/bin/${symlink})") endmacro( eosio_tool_install_and_symlink ) @@ -58,15 +58,15 @@ eosio_clang_install(ld.lld) eosio_clang_install(ld64.lld) eosio_clang_install(clang-7) eosio_clang_install(wasm-ld) -eosio_tool_install(eosio-pp) -eosio_tool_install(eosio-wast2wasm) -eosio_tool_install(eosio-wasm2wast) -eosio_tool_install(eosio-cc) -eosio_tool_install(eosio-cpp) -eosio_tool_install(eosio-ld) -eosio_tool_install(eosio-abigen) -eosio_tool_install(eosio-abidiff) -eosio_tool_install(eosio-init) +eosio_tool_install_and_symlink(eosio-pp eosio-pp) +eosio_tool_install_and_symlink(eosio-wast2wasm eosio-wast2wasm) +eosio_tool_install_and_symlink(eosio-wasm2wast eosio-wasm2wast) +eosio_tool_install_and_symlink(eosio-cc eosio-cc) +eosio_tool_install_and_symlink(eosio-cpp eosio-cpp) +eosio_tool_install_and_symlink(eosio-ld eosio-ld) +eosio_tool_install_and_symlink(eosio-abigen eosio-abigen) +eosio_tool_install_and_symlink(eosio-abidiff eosio-abidiff) +eosio_tool_install_and_symlink(eosio-init eosio-init) eosio_clang_install(../lib/LLVMEosioApply${CMAKE_SHARED_LIBRARY_SUFFIX}) eosio_clang_install(../lib/LLVMEosioSoftfloat${CMAKE_SHARED_LIBRARY_SUFFIX}) eosio_clang_install(../lib/eosio_plugin${CMAKE_SHARED_LIBRARY_SUFFIX}) From 07f4245572116e757a0cc34498647b854dfa2942 Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Mon, 8 Jul 2019 14:40:53 -0400 Subject: [PATCH 30/33] Update CMakeList.txt --- CMakeLists.txt | 8 -------- 1 file changed, 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e26b165a9f..25894f0024 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,14 +27,6 @@ else() set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") endif() - -##if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) -## message(WARNING "CMAKE_INSTALL_PREFIX is set to default path of ${CMAKE_INSTALL_PREFIX}, resetting to ${CMAKE_INSTALL_PREFIX}/eosio.cdt") -## set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/eosio.cdt") -##elseif ("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/local") -## message(WARNING "CMAKE_INSTALL_PREFIX is explicitly set to /usr/local. This is not recommended.") -##endif() - set(CDT_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/eosio.cdt) include(GNUInstallDirs) From 873b6731c8f664aa07da14d5852a1e22aab59427 Mon Sep 17 00:00:00 2001 From: Zach Butler Date: Mon, 8 Jul 2019 15:48:02 -0400 Subject: [PATCH 31/33] Revert the eosio_llvm submodules to the versions currently in release/1.6.x --- eosio_llvm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eosio_llvm b/eosio_llvm index ce49c87984..a41b8e7653 160000 --- a/eosio_llvm +++ b/eosio_llvm @@ -1 +1 @@ -Subproject commit ce49c87984047fe2ecdcfa1c6ce5c53d9ea6e7c1 +Subproject commit a41b8e7653258a4f1a5911ef28c95672efce051e From 4a8ef614a81b50d7a972737f78904c35aa6305ae Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Wed, 10 Jul 2019 12:00:29 -0400 Subject: [PATCH 32/33] bump version to 1.6.2 --- CMakeLists.txt | 2 +- README.md | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 022411db22..61f04653c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ endif() set(VERSION_MAJOR 1) set(VERSION_MINOR 6) -set(VERSION_PATCH 1) +set(VERSION_PATCH 2) #set(VERSION_SUFFIX rc2) if (VERSION_SUFFIX) diff --git a/README.md b/README.md index c0cd29d277..8e166c3190 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # EOSIO.CDT (Contract Development Toolkit) -## Version : 1.6.1 +## Version : 1.6.2 EOSIO.CDT is a toolchain for WebAssembly (WASM) and set of tools to facilitate contract writing for the EOSIO platform. In addition to being a general purpose WebAssembly toolchain, [EOSIO](https://github.com/eosio/eos) specific optimizations are available to support building EOSIO smart contracts. This new toolchain is built around [Clang 7](https://github.com/eosio/llvm), which means that EOSIO.CDT has the most currently available optimizations and analyses from LLVM, but as the WASM target is still considered experimental, some optimizations are not available or incomplete. @@ -22,8 +22,8 @@ $ brew remove eosio.cdt ``` #### Debian Package Install ```sh -$ wget https://github.com/eosio/eosio.cdt/releases/download/v1.6.1/eosio.cdt_1.6.1-1_amd64.deb -$ sudo apt install ./eosio.cdt_1.6.1-1_amd64.deb +$ wget https://github.com/eosio/eosio.cdt/releases/download/v1.6.2/eosio.cdt_1.6.2-1_amd64.deb +$ sudo apt install ./eosio.cdt_1.6.2-1_amd64.deb ``` #### Debian Package Uninstall ```sh @@ -32,8 +32,8 @@ $ sudo apt remove eosio.cdt #### Fedora RPM Package Install ```sh -$ wget https://github.com/eosio/eosio.cdt/releases/download/v1.6.1/eosio.cdt-1.6.1-1.fedora-x86_64.rpm -$ sudo yum install ./eosio.cdt-1.6.1-1.fedora-x86_64.rpm +$ wget https://github.com/eosio/eosio.cdt/releases/download/v1.6.2/eosio.cdt-1.6.2-1.fedora-x86_64.rpm +$ sudo yum install ./eosio.cdt-1.6.2-1.fedora-x86_64.rpm ``` #### Fedora RPM Package Uninstall @@ -43,8 +43,8 @@ $ sudo yum remove eosio.cdt #### Centos RPM Package Install ```sh -$ wget https://github.com/eosio/eosio.cdt/releases/download/v1.6.1/eosio.cdt-1.6.1-1.centos-x86_64.rpm -$ sudo yum install ./eosio.cdt-1.6.1-1.centos-x86_64.rpm +$ wget https://github.com/eosio/eosio.cdt/releases/download/v1.6.2/eosio.cdt-1.6.2-1.centos-x86_64.rpm +$ sudo yum install ./eosio.cdt-1.6.2-1.centos-x86_64.rpm ``` #### Centos RPM Package Uninstall From ce5d7b5c60d89513ab0fa7273d29eb2f148cf626 Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Wed, 10 Jul 2019 15:18:52 -0400 Subject: [PATCH 33/33] remove default path with build script --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index fe24568d22..00a111daa9 100755 --- a/build.sh +++ b/build.sh @@ -94,7 +94,7 @@ if [ -z "$CMAKE" ]; then CMAKE=$( command -v cmake ) fi -"$CMAKE" -DCMAKE_INSTALL_PREFIX=/usr/local/eosio.cdt ../ +"$CMAKE" ../ if [ $? -ne 0 ]; then exit -1; fi