Closed PatrickAlphaC closed 2 years ago
@PatrickAlphaC Currently, we use the Github releases API to download version-specified releases, we don't clone the tag. However, I think we can try to support this, as we already support branch-based dependencies on Github.
As a temporary workaround, you can use branch: master
and see if that works for getting the master code.
I also wonder if you put the git tag like branch: <tag>
if that would work but not sure on that one.
Anyway, thanks for reporting! We will get this working for you.
Thanks! Looks like this was able to get the download going (:
dependencies:
- name: aave
github: aave/protocol-v2
branch: 1.0.1
solidity:
import_remapping:
- "@aave=aave/1.0.1"
But now I'm getting:
INFO: Cloning branch '1.0.1' from 'protocol-v2'.
99%|█████████████████████████████████████████████████████████████████████████▎| 985/994 [00:00<00:00, 31010.15it/s]Traceback (most recent call last):
File "/Users/patrick/code/aave_apeworx_py/ape-venv/bin/ape", line 8, in <module>
sys.exit(cli())
File "/Users/patrick/code/aave_apeworx_py/ape-venv/lib/python3.9/site-packages/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "/Users/patrick/code/aave_apeworx_py/ape-venv/lib/python3.9/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/Users/patrick/code/aave_apeworx_py/ape-venv/lib/python3.9/site-packages/ape/_cli.py", line 40, in invoke
return super().invoke(ctx)
File "/Users/patrick/code/aave_apeworx_py/ape-venv/lib/python3.9/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/patrick/code/aave_apeworx_py/ape-venv/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/patrick/code/aave_apeworx_py/ape-venv/lib/python3.9/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/Users/patrick/code/aave_apeworx_py/ape-venv/lib/python3.9/site-packages/click/decorators.py", line 84, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/Users/patrick/code/aave_apeworx_py/ape-venv/lib/python3.9/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/Users/patrick/code/aave_apeworx_py/ape-venv/lib/python3.9/site-packages/ape_compile/_cli.py", line 50, in cli
contract_types = cli_ctx.project.load_contracts(file_paths=file_paths, use_cache=use_cache)
File "/Users/patrick/code/aave_apeworx_py/ape-venv/lib/python3.9/site-packages/ape/managers/project.py", line 609, in load_contracts
self._load_dependencies()
File "/Users/patrick/code/aave_apeworx_py/ape-venv/lib/python3.9/site-packages/ape/managers/project.py", line 683, in _load_dependencies
return {d.name: d.extract_manifest() for d in self.config.dependencies}
File "/Users/patrick/code/aave_apeworx_py/ape-venv/lib/python3.9/site-packages/ape/managers/project.py", line 683, in <dictcomp>
return {d.name: d.extract_manifest() for d in self.config.dependencies}
File "/Users/patrick/code/aave_apeworx_py/ape-venv/lib/python3.9/site-packages/ape/managers/project.py", line 225, in extract_manifest
github_client.clone_repo(self.github, temp_project_path, branch=self.branch)
File "/Users/patrick/code/aave_apeworx_py/ape-venv/lib/python3.9/site-packages/ape/utils.py", line 456, in clone_repo
clone = pygit2.clone_repository(
File "/Users/patrick/code/aave_apeworx_py/ape-venv/lib/python3.9/site-packages/pygit2/__init__.py", line 222, in clone_repository
payload.check_error(err)
File "/Users/patrick/code/aave_apeworx_py/ape-venv/lib/python3.9/site-packages/pygit2/callbacks.py", line 93, in check_error
check_error(error_code)
File "/Users/patrick/code/aave_apeworx_py/ape-venv/lib/python3.9/site-packages/pygit2/errors.py", line 56, in check_error
raise KeyError(message)
KeyError: "reference 'refs/remotes/origin/1.0.1' not found"
99%|███████████████████████████████████████████████████████████████████████████▎| 985/994 [00:02<00:00, 350.83it/s]
So currently, we don't support compiling the Aave protocol-2 project. Reason:
That is a Hardhat project. Sometimes, however, it still works. In this case, though, some of the dependency mappings that happen in the package.json
are not mapped correctly when it tries to compile the dependency.
Good news Is that we actually have a ProjectAPI
and a DependencyAPI
that one could theoretically implement an NPM dependency resolver and a Hardhat project adapter implementation.
Other alternatives I can think of for the time being:
Gotcha, thanks! For the moment I'll wait for full github / nodejs project compatibility :)
Thank you!
I have part of this fixed via #507 which will allow you to ignore files in the protocol-2 dependency that are problematic, which currently are everything in mocks/
and deployments/
(I hope you don't need those at this time).
There is one other solidity stack exception related bug that still occurs that requires further investigation
Further fixes were done to be able to compile Aave: https://github.com/ApeWorX/ape-solidity/pull/26
I'll try this out later!
Closing optimistically! @PatrickAlphaC let us know if this needs to be re-opened?
I'll have to try this out later.. but I'll let you know!
Environment information
ape
and plugin versions: eth-ape==0.1.0b5Full virtual environment:
What went wrong?
I have a
ape-config.yaml
that looks like the following:I'm trying to pull from the aave github repo of course.
I have an interface that looks like the following:
When I run
ape compile
, I get this error:It looks like I'm passing something wrong in my
ape-config.yaml
but It seems to match the docs?However, I can see that tag here
How can it be fixed?
Not sure yet.