eos icon indicating copy to clipboard operation
eos copied to clipboard

[REGRESSION] [FIX] eosiocpp library problems

Open ghost opened this issue 8 years ago • 13 comments

Problem

Commit 67393d7 introduced several regressions for users by removing several libraries.

The commit possibly slipped through during general enhancement of the installation-scripts within #4844.

Solved

With version 1.2.0, the team has reactivated eosiocpp an the related libraries, and announced their deprecation for the 1.3.0 release:

#5204 #5226 - https://github.com/EOSIO/eos/releases/tag/v1.2.0

Use 1.2.0, migrate towards using eosio.wasmsdk, ensure to read the future release-notes.

Workaround (for Users)

sudo rm -rf /usr/local/bin/eosiocpp # remove possibly existent old file
sudo rm -rf /usr/local/eosio/ # remove possibly existent old files
cd $HOME/eos
git revert -n 67393d7
./eosio_build.sh
cd build
sudo make install
  • which eosiocpp should be /usr/local/eosio/eosiocpp
  • locate eosio.hpp should contain /usr/local/eosio/include/eosiolib/eosio.hpp

To verify if paths/libs are ok again

cd $HOME
mkdir sand
cd sand
eosiocpp -n hello
cd hello
eosiocpp -o hello.wast hello.cpp
eosiocpp -g hello.abi hello.cpp

Verified on ubuntu 18.04 (VirtualBox)

Further Steps

If the above does not solve it, then you should have a tiny chance by trying

  • A fresh clone, revert, build, install

  • this:

locate eosio.hpp

Pick the path which is NOT in the directory build, remove /eosiolib/eosio.hpp, and export it like this:

`export EOSIOCPP_CFLAGS='-I/my/strange/location'

#within eos dir
export EOSIOCPP_CFLAGS='-I/usr/local/eosio/include'
rm -rf build/tools/eosiocpp
./eosio_build.sh
cd build
sudo make install

Solution (by Team)

Revert 67393d7 (which broke existent behavior) within 1.1.x (next bug-fix release) and make a coordinated and announced switch to an alternate eosio.wasmsdk based implementation (see #5040)

Alternatively

Document clearly this regression, thus user know what to do (both categories, using build or using docker)

Done

#5204 #5226 - https://github.com/EOSIO/eos/releases/tag/v1.2.0

ghost avatar Aug 09 '18 16:08 ghost

using macOS. still library error occurs

newbieh4cker avatar Aug 10 '18 02:08 newbieh4cker

/usr/local/eosio/include/eosiolib/symbol.hpp:2:10: fatal error: 'eosiolib/core_symbol.hpp' file not
      found

helperShang avatar Aug 10 '18 02:08 helperShang

code

#include <eosiolib/eosio.hpp>
#include <eosiolib/currency.hpp>
using namespace eosio;
class hello : public eosio::contract {
  public:
      using contract::contract;

      /// @abi action 
      void hi( account_name user ) {
         print( "Hello, ", name{user} );
      }
};

extern "C" {
   void apply( uint64_t receiver, uint64_t code, uint64_t action ) {
        if (N(transfer) == action) {
            auto trans = unpack_action_data<currency::transfer>();
            print(trans.quantity.amount);
        }
   }
}

error

cleos set contract shangzebeiok /work/hello -p shangzebeiok@active
Reading WAST/WASM from /work/hello/hello.wasm...
Using already assembled WASM...
Publishing contract...
Error 3070000: WASM Exception

console

{"module":"env","export":"free"}
    thread-0  wasm_interface.hpp:42 resolve

    {"mod_name":"env","export_name":"free"}
    thread-0  wasm_interface.hpp:44 resolve
pending console output: 
    {"console":""}

wrong #4941

helperShang avatar Aug 10 '18 03:08 helperShang

Thanks brother , After several days of rigorous searching for fix for errors , at last it is working now.

dev1644 avatar Aug 10 '18 05:08 dev1644

@newbieh4cker , please try with a fresh clone, revert, build, install, test

@helperShang , please file a new issue and link back here, if you think its related. Note that you can delete the comments that you've posted here, just copy them over to the new issue).

@dev1644 good to know. Thanks for reporting the success.

ghost avatar Aug 10 '18 06:08 ghost

@lazaridiscom not working T.T

newbieh4cker avatar Aug 10 '18 07:08 newbieh4cker

@newbieh4cker answered within https://github.com/EOSIO/eos/issues/5129#issuecomment-412002267

ghost avatar Aug 10 '18 07:08 ghost

These files have been removed purposefully.

Please use the point releases. Since the latest version is not always stable as it is a work in progress.

ChristianDunst avatar Aug 10 '18 08:08 ChristianDunst

These files have been removed purposefully.

You cannot remove files from a released software, without documenting clearly.

Please use the point releases. Since the latest version is not always stable as it is a work in progress.

We're talking about "master", which is the latest stable release.

ghost avatar Aug 11 '18 20:08 ghost

I can confirm that this fix works on Ubuntu 16.04. Before you start a fresh clone delete the following folder: /usr/local/eosio/ You will need a fresh clone, revert, build, install.

ovi-rosu avatar Aug 12 '18 16:08 ovi-rosu

thanks for the confirmation, I've updated the instructions with delete and fresh clone option

ghost avatar Aug 12 '18 20:08 ghost

Version 1.2.0 fixes this regression, see https://github.com/EOSIO/eos/releases/tag/v1.2.0

Update to 1.2.0.

ghost avatar Aug 15 '18 08:08 ghost

it's work~ ! thinks

jayden-sudo avatar Sep 06 '18 08:09 jayden-sudo