Code Monkey home page Code Monkey logo

Comments (4)

stefanzarembinski avatar stefanzarembinski commented on August 20, 2024

You say that you execute the same command line that EOSFactory uses and you get the different warning message.
I cannot reproduce this effect.

from eosfactory.

stefanzarembinski avatar stefanzarembinski commented on August 20, 2024

OK, now I see the point. I will elaborate it.

from eosfactory.

stefanzarembinski avatar stefanzarembinski commented on August 20, 2024

Thank you for pointing at the bad mistake. I have corrected it. If you do not want to wait for the next edition of EOSFactory, and if you use a GitHub cloned repository, you can correct the file eosfactory/core/utils.py:

@@ -139,7 +139,7 @@ error message:
139 139      if cwd:
140 140          shutil.rmtree(cwd)
141 141
142     -    if returncode:
    142 +    if returncode or stderr:
143 143        raise errors.Error('''
144 144   command line:
145 145   =============

Now, EOSFactory throws an exception:

ERROR:
command line:
=============
eosio-cpp -o /mnt/c/Workspaces/EOS/contracts/token/build/token.wasm -I=/mnt/c/Users/cartman/AppData/Local/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/opt/eosio.cdt/1.6.1/include -I=/mnt/c/Users/cartman/AppData/Local/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/opt/eosio.cdt/1.6.1/include/libcxx -I=/mnt/c/Users/cartman/AppData/Local/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/opt/eosio.cdt/1.6.1/include/eosiolib/core -I=/mnt/c/Users/cartman/AppData/Local/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/opt/eosio.cdt/1.6.1/include/eosiolib/contracts -I=/mnt/c/Workspaces/EOS/contracts/token -I=/mnt/c/Workspaces/EOS/contracts/token/include -abigen -R=/mnt/c/Workspaces/EOS/contracts/token/ricardian /mnt/c/Workspaces/EOS/contracts/token/src/token.cpp

error message:
==============
In file included from /tmp/token.cpp:6:
/mnt/c/Workspaces/EOS/contracts/token/include/token.hpp:23:72: warning: shift count >= width of type [-Wshift-count-overflow]
         uint128_t get_composite(name user) const { return (user.value << 64 || user.value);};
                                                                       ^  ~~
1 warning generated.

from eosfactory.

stefanzarembinski avatar stefanzarembinski commented on August 20, 2024

I see that the correction is too restrictive as it crushes the process in case of any compiler warning. I refine the correction. In the file eosfactory/core/utils, the function long_process, starting at the line 88:

def long_process(command_line, build_dir=None, is_verbose=True, prompt=None, 
                                shell=False):
    stop = False
    PERIOD = 2

    def thread_function():
        if prompt:
            print("{}: ".format(prompt), end="", flush=True)
        while True:
            print(".", end="", flush=True)
            time.sleep(PERIOD)
            if stop:
                break

    cwd = None
    if build_dir:
        cwd = os.path.join(build_dir, "cwd")
        if os.path.exists(cwd):
            try:
                shutil.rmtree(cwd)
            except Exception as e:
                raise errors.Error("""
Cannot remove the directory {}.
error message:
==============
{}
                """.format(cwd, str(e)))
        os.mkdir(cwd)

    threading.Thread(target=thread_function).start()
    try:
        p = subprocess.run(
            command_line,
            cwd=cwd,
            shell=shell,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE)
    except Exception as e:
        stop = True
        time.sleep(PERIOD)
        print(str(e))
        exit()

    stop = True
    time.sleep(PERIOD)
    print()
    stdout = p.stdout.decode("ISO-8859-1")
    stderr = p.stderr.decode("ISO-8859-1")
    returncode = p.returncode

    if cwd:
        shutil.rmtree(cwd)

    if returncode:
        raise errors.Error("""
command line:
=============
{}

error message:
==============
{}
        """.format(" ".join(command_line), stderr))

    if is_verbose:
        print(stdout)
        print(stderr)

    return p

from eosfactory.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.