question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

feat: error msg to say missing compiler

See original GitHub issue

Overview

Provide a simple overview of what you wish to see added. Please include: Currently when you don’t have the right compiler installed and you try and run ape test

you get this error

__________________________________________________ ERROR at setup of test_mint ___________________________________________________

owner = <TestAccount 0x1e59ce931B4CFea3fe4B875411e280e173cB7A9C>
project = <ape.managers.project.manager.ProjectManager object at 0x7f9b4f5c1760>

    @pytest.fixture(scope="session")
    def token(owner, project):
>       return owner.deploy(project.Token)
E       AttributeError: 'ProjectManager' object has no attribute 'Token'

tests/conftest.py:14: AttributeError
======================================================== warnings summary ========================================================
../../virtualenvs/ape/lib/python3.8/site-packages/pytest_asyncio/plugin.py:191
  /home/chris/virtualenvs/ape/lib/python3.8/site-packages/pytest_asyncio/plugin.py:191: DeprecationWarning: The 'asyncio_mode' default value will change to 'strict' in future, please explicitly use 'asyncio_mode=strict' or 'asyncio_mode=auto' in pytest configuration file.
    config.issue_config_time_warning(LEGACY_MODE, stacklevel=2)

-- Docs: https://docs.pytest.org/en/stable/warnings.html
==================================================== short test summary info =====================================================
ERROR tests/test_token.py::test_initial_state - AttributeError: 'ProjectManager' object has no attribute 'Token'
ERROR tests/test_token.py::test_transfer - AttributeError: 'ProjectManager' object has no attribute 'Token'
ERROR tests/test_token.py::test_transfer_from - AttributeError: 'ProjectManager' object has no attribute 'Token'
ERROR tests/test_token.py::test_approve - AttributeError: 'ProjectManager' object has no attribute 'Token'
ERROR tests/test_token.py::test_mint - AttributeError: 'ProjectManager' object has no attribute 'Token'
============================================ 1 skipped, 1 warning, 5 errors in 0.55s =============================================
(ape) chris@DESKTOP-ID4V0R6 ~/demo/erc20Project $ 

I would like to fix the error msg and have it say you might a compiler missing?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
fubuloubucommented, Aug 11, 2022

What is a good way for us to make it easier to understand this issue?

In project manager getattr, if we cant find the contract container, check the contents of the contracts folder for a matching file name. If found, raise a different exception saying “Missing compiler plugin installation for ‘{ext}’ source types.”

Might not work for solidity files, where the file name sometimes doesn’t match the types it contains.

Perhaps just adding a simple “make sure that you have the right compiler plugins installed” or even better: search for files in the contracts/ folder and see if there are any extensions without a compiler in this situation (and suggest they install one that can handle that file type).

0reactions
sabotagebeatscommented, Sep 29, 2022

note: project.extensions_with_missing_compilers must be fed an extension, a list of extensions, or an empty list as an argument like this: project.extensions_with_missing_compilers([])

refactored this to not require an argument in #1087

Read more comments on GitHub >

github_iconTop Results From Across the Web

On Compiler Error Messages: What They Say and What ...
In this paper, we focus on compiler error messages. First, related literature is reviewed and the problem placed in the context of the...
Read more >
How to fix missing compiler member error Microsoft.CSharp ...
I get a red underline on the word "results" in the second line. I was wondering how to eliminate this error.
Read more >
Compiler Error Messages Considered Unhelpful
When an error is not caught, we say that the error is silent, leading to undefined behaviour at run time. Undefined behaviour can...
Read more >
No Erlang compile time errors for missing functions
I suspect this is the correct answer but I do have a problem. You are talking about code loading, but I am talking...
Read more >
Improve error message for when Injectable() is missing
If component A has a dependency on service B, but service B does not have the Injectable() decorator defined, a vague error message...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found