Import from github not compiling correctly
See original GitHub issueEnvironment information
- OS: macOS
- Python Version: 3.9.5
$ ape --version
0.2.7
$ ape plugins list
Installed Plugins:
solidity 0.2.3
- Contents of your
ape-config.yaml
(NOTE: do not post anything private like RPC urls or secrets!):
$ cat ape-config.yaml
name: apeworx-starter-kit
dependencies:
- name: chainlink
github: smartcontractkit/chainlink-brownie-contracts
branch: main
contracts_folder: contracts
version: 0.4.0
solidity:
import_remapping:
- "@chainlink=chainlink/0.4.0"
What went wrong?
I have a minimal contract that imports from the chainlink github repo:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
contract PriceFeedConsumer {
AggregatorV3Interface internal priceFeed;
constructor(address AggregatorAddress) {
priceFeed = AggregatorV3Interface(AggregatorAddress);
}
}
When I run ape compile
I get the following error:
Traceback (most recent call last):
File "/<DIR>/.local/bin/ape", line 8, in <module>
sys.exit(cli())
File "/<DIR>/.local/pipx/venvs/eth-ape/lib/python3.8/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/<DIR>/.local/pipx/venvs/eth-ape/lib/python3.8/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/<DIR>/.local/pipx/venvs/eth-ape/lib/python3.8/site-packages/ape/_cli.py", line 40, in invoke
return super().invoke(ctx)
File "/<DIR>/.local/pipx/venvs/eth-ape/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/<DIR>/.local/pipx/venvs/eth-ape/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/<DIR>/.local/pipx/venvs/eth-ape/lib/python3.8/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/<DIR>/.local/pipx/venvs/eth-ape/lib/python3.8/site-packages/click/decorators.py", line 84, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/<DIR>/.local/pipx/venvs/eth-ape/lib/python3.8/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/<DIR>/.local/pipx/venvs/eth-ape/lib/python3.8/site-packages/ape_compile/_cli.py", line 53, in cli
contract_types = cli_ctx.project_manager.load_contracts(
File "/<DIR>/.local/pipx/venvs/eth-ape/lib/python3.8/site-packages/ape/managers/project/manager.py", line 412, in load_contracts
self._load_dependencies()
File "/<DIR>/.local/pipx/venvs/eth-ape/lib/python3.8/site-packages/ape/managers/project/manager.py", line 429, in _load_dependencies
dependency_config.extract_manifest()
File "/<DIR>/.local/pipx/venvs/eth-ape/lib/python3.8/site-packages/ape/managers/project/dependency.py", line 97, in extract_manifest
return self._extract_local_manifest(temp_project_path)
File "/<DIR>/.local/pipx/venvs/eth-ape/lib/python3.8/site-packages/ape/api/projects.py", line 244, in _extract_local_manifest
project_manifest = project.create_manifest(file_paths=sources)
File "/<DIR>/.local/pipx/venvs/eth-ape/lib/python3.8/site-packages/ape/managers/project/types.py", line 153, in create_manifest
compiled_contract_types = self.compiler_manager.compile(list(needs_compiling))
File "/<DIR>/.local/pipx/venvs/eth-ape/lib/python3.8/site-packages/ape/managers/compilers.py", line 104, in compile
compiled_contracts = self.registered_compilers[extension].compile(
File "/<DIR>/.local/pipx/venvs/eth-ape/lib/python3.8/site-packages/ape_solidity/compiler.py", line 233, in compile
output = solcx.compile_files(files, **kwargs)
File "/<DIR>/.local/pipx/venvs/eth-ape/lib/python3.8/site-packages/solcx/main.py", line 216, in compile_files
return _compile_combined_json(
File "/<DIR>/.local/pipx/venvs/eth-ape/lib/python3.8/site-packages/solcx/main.py", line 291, in _compile_combined_json
stdoutdata, stderrdata, command, proc = wrapper.solc_wrapper(
File "/<DIR>/.local/pipx/venvs/eth-ape/lib/python3.8/site-packages/solcx/wrapper.py", line 158, in solc_wrapper
raise SolcError(
solcx.exceptions.SolcError: An error occurred during execution
> command: `/<DIR>/.solcx/solc-v0.6.12
# Some private folder stuff here...
> return code: `1`
> stdout:
> stderr:
Error: Source "/private-folder-dir/chainlink/contracts/src/v0.6/vendor/CBORChainlink.sol" not found: File not found.
--> /private-folder-dir/chainlink/contracts/src/v0.6/Chainlink.sol:4:1:
|
4 | import { CBORChainlink } from "./vendor/CBORChainlink.sol";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Source "/private-folder-dir/chainlink/contracts/src/v0.6/SimpleWriteAccessController.sol" not found: File not found.
--> private-folder-dir/chainlink/contracts/src/v0.6/SimpleReadAccessController.sol:4:1:
|
4 | import "./SimpleWriteAccessController.sol";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Source "/private-folder-dir/chainlink/contracts/src/v0.6/vendor/CBORChainlink.sol" not found: File not found.
--> /private-folder-dir/chainlink/contracts/src/v0.6/tests/ChainlinkTestHelper.sol:5:1:
|
5 | import "../vendor/CBORChainlink.sol";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Source "/private-folder-dir/chainlink/contracts/src/v0.6/Flags.sol" not found: File not found.
--> /private-folder-dir/chainlink/contracts/src/v0.6/tests/FlagsTestHelper.sol:4:1:
|
4 | import "../Flags.sol";
| ^^^^^^^^^^^^^^^^^^^^^^
Error: Source "/private-folder-dir/chainlink/contracts/src/v0.6/FluxAggregator.sol" not found: File not found.
--> /private-folder-dir/chainlink/contracts/src/v0.6/tests/FluxAggregatorTestHelper.sol:4:1:
|
4 | import "../FluxAggregator.sol";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Source "/private-folder-dir/chainlink/contracts/src/v0.6/Owned.sol" not found: File not found.
--> /private-folder-dir/chainlink/contracts/src/v0.6/tests/OwnedTestHelper.sol:4:1:
|
4 | import "../Owned.sol";
How can it be fixed?
No idea. This compiles fine in brownie. I’m trying to replicate the chainlink-mix in apeworx.
Issue Analytics
- State:
- Created a year ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
tsc -w does not correctly compile file imports #21612 - GitHub
First pass is compiled correctly. Second pass is missing some imports. This is the source file: https://github.com/unional/komondor/blob/ts-2.7 ...
Read more >d.ts type imports are not resolved correctly in dependencies
As a workaround, changing all the imports into relative paths makes it work.
Read more >babel not compiling imported modules · Issue #2085 - GitHub
Hello wonderful babel team! I've run into an issue where babel doesn't seem to work with modules, and I'm hoping you can help...
Read more >go/build: Import does not find source directory for code in ...
go/build's Import and Context.Import can't find import paths in modules. We've been assuming this was unfixable and that people should move ...
Read more >Local imports not resolving correctly · Issue #68 - GitHub
When trying to import another python file from the same directory as the current file (e.g. main.py and emailRelay.py are in the same...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Good news! We accomplished being able to compile this repo and
ape-solidity
is stronger than ever because of it.Keep your same contract
Use the following Ape PR: https://github.com/ApeWorX/ape/pull/755
Use the following
ape-solidity
PR: https://github.com/ApeWorX/ape-solidity/pull/42Things should work!
We are looking into this! There are few things I notice right off the bat, but I will give you the complete run-down when all of the mysteries are solved. Thank you Patrick!