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

Changes to enable download of snapshot in validator. #2843

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dom96
Copy link
Collaborator

@dom96 dom96 commented Oct 3, 2024

Just some minor changes/clean up for the EW PR.

@dom96 dom96 marked this pull request as ready for review October 4, 2024 15:45
@dom96 dom96 requested review from a team as code owners October 4, 2024 15:45
danlapid
danlapid previously approved these changes Oct 4, 2024
@danlapid danlapid dismissed their stale review October 4, 2024 17:25

see comments on internal PR


kj::HashSet<kj::String> filteredImports;
for (auto& import: imports) {
if (filteredImports.contains(import)) {
Copy link
Member

Choose a reason for hiding this comment

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

Nit:

Suggested change
if (filteredImports.contains(import)) {
if (filteredImports.contains(import)) [[unlikely]] {

kj::Array<kj::String> ArtifactBundler::filterPythonScriptImports(
kj::HashSet<kj::String> locals, kj::Array<kj::String> imports) {
kj::HashSet<kj::StringPtr> snapshotImportsSet;
for (auto import: ArtifactBundler::getSnapshotImports()) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
for (auto import: ArtifactBundler::getSnapshotImports()) {
for (auto& import: ArtifactBundler::getSnapshotImports()) {

}

kj::Array<kj::StringPtr> ArtifactBundler::getSnapshotImports() {
kj::StringPtr imports[] = {"_pyodide.docstring"_kj, "_pyodide._core_docs"_kj, "traceback"_kj,
Copy link
Member

Choose a reason for hiding this comment

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

Afaik, this can be constexpr. I added this to KJ, but I wonder if we are using the latest version right now.

Copy link
Contributor

@danlapid danlapid left a comment

Choose a reason for hiding this comment

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

Internal comments

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

Successfully merging this pull request may close these issues.

3 participants