Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Introduce universal compilation host to execution framework #15960

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

erak
Copy link
Collaborator

@erak erak commented Mar 20, 2025

Description

This PR implements a universal compiler host for running tests with various compilers (etc. the internal compiler aka. CompilerStack or standard JSON compiler).

Details

It introduces some common types for the compiler inputs and its output. A compilation module that wraps the linked / internal compiler was added. It can be used in a newly added universal compiler host. This host is then used inside the test execution framework.

Outlook

The input / output types introduced by this PR were inspired by the SolidityCompilationFramework. In a future PR the universal compiler host could be used there as well.

Ultimately, this PR makes it possible to implement a compilation module for the standard JSON compiler as well and use that in the pipeline.

Copy link

Thank you for your contribution to the Solidity compiler! A team member will follow up shortly.

If you haven't read our contributing guidelines and our review checklist before, please do it now, this makes the reviewing process and accepting your contribution smoother.

If you have any questions or need our help, feel free to post them in the PR or talk to us directly on the #solidity-dev channel on Matrix.

@erak erak force-pushed the test-compiler-host branch from 08ce0db to 9387714 Compare March 20, 2025 10:02
@erak erak force-pushed the test-compiler-host branch 2 times, most recently from 0067fdd to 6a47a21 Compare March 25, 2025 10:36
@erak erak force-pushed the test-compiler-host branch from 6a47a21 to 9e50f8c Compare March 25, 2025 11:10
@stackenbotten
Copy link

There was an error when running chk_coding_style for commit f79fbaed6453a28a25f6d1cd338074525c4359cf:

Error: Trailing whitespace found:
test/libsolidity/util/compiler/InternalCompiler.cpp:93:        
test/libsolidity/util/compiler/InternalCompiler.cpp:94:    
test/libsolidity/util/compiler/InternalCompiler.cpp:95:    
test/libsolidity/util/compiler/InternalCompiler.cpp:98:    //     std::cout << "sourceName: " << sourceName << std::endl; 
test/libsolidity/util/compiler/InternalCompiler.cpp:104:            

Please check that your changes are working as intended.

mappedContracts.insert(std::make_pair(name.source(), contracts));
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding style error

}
}


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding style error

}



Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding style error


// for (auto sourceName: m_stack.sourceNames())
// {
// std::cout << "sourceName: " << sourceName << std::endl;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding style error

// auto const& sourceUnit = m_stack.ast(sourceName);
// for (auto const* contract: ASTNode::filteredNodes<ContractDefinition>(sourceUnit.nodes()))
// {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding style error

@erak erak force-pushed the test-compiler-host branch from f79fbae to 3b47946 Compare March 26, 2025 09:30
ContractName{_mainSourceName.value_or(""), contractName.contract()} :
contractName;

std::cout << "Looking up contract \"" << contractName.source() << ":" << contractName.contract() << "\"..." << std::endl;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding style error

mappedContracts.insert(std::make_pair(name.source(), contracts));
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding style error

}
}


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding style error

}



Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding style error


// for (auto sourceName: m_stack.sourceNames())
// {
// std::cout << "sourceName: " << sourceName << std::endl;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding style error

// auto const& sourceUnit = m_stack.ast(sourceName);
// for (auto const* contract: ASTNode::filteredNodes<ContractDefinition>(sourceUnit.nodes()))
// {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding style error

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

Successfully merging this pull request may close these issues.

2 participants