Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

ast and legacyAST missing from sol-compiler output #1579

Closed
BlinkyStitt opened this issue Feb 3, 2019 · 4 comments · Fixed by #1596
Closed

ast and legacyAST missing from sol-compiler output #1579

BlinkyStitt opened this issue Feb 3, 2019 · 4 comments · Fixed by #1596
Assignees

Comments

@BlinkyStitt
Copy link
Contributor

BlinkyStitt commented Feb 3, 2019

Expected Behavior

sol-compiler's docs point to https://solidity.readthedocs.io/en/develop/using-the-compiler.html#input-description which made me think this should work:

        "outputSelection": {
            "*": {
                "": [
                    "legacyAST",
                    "ast"
                ],
                "*": [
                    "abi",
                    "evm.bytecode.object",
                    "evm.bytecode.sourceMap",
                    "evm.deployedBytecode.object",
                    "evm.deployedBytecode.sourceMap",
                    "userdoc",
                    "devdoc"
                ]
            }
        }

Current Behavior

I don't see any keys for ast or legacyAST in the output.

Context

I am trying to generate truffle artifacts for a bunch of contracts written by other people with older varying versions of solidity. If they were all solidity 0.5, I could just let truffle do the compiling, but they don't support compiling different versions of contracts in the same project. My hope is to use sol-compiler to compile everything and then write a small script that translates sol-compiler's output to truffle-contract. More details at trufflesuite/truffle#1607 (comment)

@BlinkyStitt
Copy link
Contributor Author

BlinkyStitt commented Feb 7, 2019

So my contracts that are compiled with solidity 0.4 now have ast and legacyAST as part of their output, but the contracts with solidity 0.5.2 don't. Should I share my code, or is that enough information?

@BlinkyStitt
Copy link
Contributor Author

Actually I'm not sure about that. I ran the build again and now they all have AST. Investigating more now.

@BlinkyStitt
Copy link
Contributor Author

Must have been something about caches. I cleared everything and built again and the ast generated as expected. Thanks!

@LogvinovLeon
Copy link
Contributor

Yes. That's because sol-compiler consideres artifacts generated by the previous version of sol-compiler up to date if they have the same source hash and compiler settings. We should probably have another invalidation key there. Smth like sol-compiler-version. But it's kinda low-pri.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants