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

Python perf: Don't report undefined symbols #1868

Merged
merged 1 commit into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ http_archive(
http_archive(
name = "pyodide_packages",
build_file = "//:build/BUILD.pyodide_packages",
sha256 = "f9aa1e044567f1f3e36c3516d066481093dbc116032c45294eee400628d8b4a2",
sha256 = "c4a4e0c1cb658a39abc0435cc07df902e5a2ecffc091e0528b96b0c295e309ea",
type = "zip",
urls = ["https://github.com/dom96/pyodide_packages/releases/download/just-micropip/pyodide_packages.tar.zip"],
urls = ["https://github.com/dom96/pyodide_packages/releases/download/just-stdlib/pyodide_packages.tar.zip"],
)

load("//:build/pyodide_bucket.bzl", "PYODIDE_LOCK_SHA256", "PYODIDE_GITHUB_RELEASE_URL")
Expand Down
6 changes: 6 additions & 0 deletions src/pyodide/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ import { newWasmModule, monotonicDateNow, wasmInstantiate, getRandomValues } fro
const location = undefined;

function addEventListener(){}

function reportUndefinedSymbolsNoOp() {}
"""

REPLACEMENTS = [
Expand Down Expand Up @@ -119,6 +121,10 @@ REPLACEMENTS = [
"crypto.getRandomValues",
"getRandomValues"
],
[
"reportUndefinedSymbols()",
"reportUndefinedSymbolsNoOp()"
]
]

load("//:build/pyodide_bucket.bzl", "PYODIDE_PACKAGE_BUCKET_URL")
Expand Down
6 changes: 4 additions & 2 deletions src/pyodide/internal/setupPackages.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const STDLIB_PACKAGES = Object.values(LOCKFILE.packages)
.filter(({ install_dir }) => install_dir === "stdlib")
.map(({ name }) => canonicalizePackageName(name));


/**
* This stitches together the view of the site packages directory. Each
* requirement corresponds to a folder in the original tar file. For each
Expand All @@ -38,9 +39,10 @@ export function buildSitePackages(requirements) {
// larger, but there are a lot of differences...
const USE_LOAD_PACKAGE = origTarInfo.children.size < 10;
if (USE_LOAD_PACKAGE) {
return [origTarInfo, [], USE_LOAD_PACKAGE];
requirements = new Set([...STDLIB_PACKAGES]);
} else {
requirements = new Set([...STDLIB_PACKAGES, ...requirements]);
}
requirements = new Set([...STDLIB_PACKAGES, ...requirements]);
const soFiles = [];
for (const soFile of origSoFiles) {
// If folder is in list of requirements include .so file in list to preload.
Expand Down
Loading