Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-84461: Fix pydebug Emscripten browser builds#93982

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tiran merged 1 commit intopython:mainfromtiran:gh-84461-debugbuild
Jun 18, 2022
Merged
Show file tree
Hide file tree
Changes fromall 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
gh-84461: Fix pydebug Emscripten browser builds
wasm_assets script did not take the ABIFLAG flag of sysconfigdata intoaccount.
  • Loading branch information
@tiran
tiran committedJun 18, 2022
commit11ae30d2711d744c18f7fe316cc11ee40fa809d1
8 changes: 4 additions & 4 deletionsMakefile.pre.in
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -247,8 +247,8 @@ SRCDIRS= @SRCDIRS@
SUBDIRSTOO=Include Lib Misc

# assets for Emscripten browser builds
WASM_ASSETS_DIR=".$(prefix)"
WASM_STDLIB="$(WASM_ASSETS_DIR)/local/lib/python$(VERSION)/os.py"
WASM_ASSETS_DIR=.$(prefix)
WASM_STDLIB=$(WASM_ASSETS_DIR)/lib/python$(VERSION)/os.py

# Files and directories to be distributed
CONFIGFILES=configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in
Expand DownExpand Up@@ -821,7 +821,7 @@ $(WASM_STDLIB): $(srcdir)/Lib/*.py $(srcdir)/Lib/*/*.py \
Makefile pybuilddir.txt Modules/Setup.local \
python.html python.worker.js
$(PYTHON_FOR_BUILD) $(srcdir)/Tools/wasm/wasm_assets.py \
--builddir . --prefix $(prefix)
--buildroot . --prefix $(prefix)

python.html: $(srcdir)/Tools/wasm/python.html python.worker.js
@cp $(srcdir)/Tools/wasm/python.html $@
Expand DownExpand Up@@ -2391,7 +2391,7 @@ clean-retain-profile: pycremoval
-rm -f Lib/lib2to3/*Grammar*.pickle
-rm -f _bootstrap_python
-rm -f python.html python*.js python.data python*.symbols python*.map
-rm -rf $(WASM_STDLIB)
-rm -f $(WASM_STDLIB)
-rm -f Programs/_testembed Programs/_freeze_module
-rm -f Python/deepfreeze/*.[co]
-rm -f Python/frozen_modules/*.h
Expand Down
36 changes: 24 additions & 12 deletionsTools/wasm/wasm_assets.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,18 +13,13 @@
import pathlib
import shutil
import sys
import sysconfig
import zipfile

# source directory
SRCDIR = pathlib.Path(__file__).parent.parent.parent.absolute()
SRCDIR_LIB = SRCDIR / "Lib"

# sysconfig data relative to build dir.
SYSCONFIGDATA = pathlib.PurePath(
"build",
f"lib.emscripten-wasm32-{sys.version_info.major}.{sys.version_info.minor}",
"_sysconfigdata__emscripten_wasm32-emscripten.py",
)

# Library directory relative to $(prefix).
WASM_LIB = pathlib.PurePath("lib")
Expand DownExpand Up@@ -121,6 +116,22 @@
"unittest/test/",
)

def get_builddir(args: argparse.Namespace) -> pathlib.Path:
"""Get builddir path from pybuilddir.txt
"""
with open("pybuilddir.txt", encoding="utf-8") as f:
builddir = f.read()
return pathlib.Path(builddir)


def get_sysconfigdata(args: argparse.Namespace) -> pathlib.Path:
"""Get path to sysconfigdata relative to build root
"""
data_name = sysconfig._get_sysconfigdata_name()
assert "emscripten_wasm32" in data_name
filename = data_name + ".py"
return args.builddir / filename


def create_stdlib_zip(
args: argparse.Namespace,
Expand DownExpand Up@@ -150,7 +161,7 @@ def detect_extension_modules(args: argparse.Namespace):
modules = {}

# disabled by Modules/Setup.local ?
with open(args.builddir / "Makefile") as f:
with open(args.buildroot / "Makefile") as f:
for line in f:
if line.startswith("MODDISABLED_NAMES="):
disabled = line.split("=", 1)[1].strip().split()
Expand DownExpand Up@@ -183,8 +194,8 @@ def path(val: str) -> pathlib.Path:

parser = argparse.ArgumentParser()
parser.add_argument(
"--builddir",
help="absolute builddirectory",
"--buildroot",
help="absolutepath tobuildroot",
default=pathlib.Path(".").absolute(),
type=path,
)
Expand All@@ -202,7 +213,7 @@ def main():
relative_prefix = args.prefix.relative_to(pathlib.Path("/"))
args.srcdir = SRCDIR
args.srcdir_lib = SRCDIR_LIB
args.wasm_root = args.builddir / relative_prefix
args.wasm_root = args.buildroot / relative_prefix
args.wasm_stdlib_zip = args.wasm_root / WASM_STDLIB_ZIP
args.wasm_stdlib = args.wasm_root / WASM_STDLIB
args.wasm_dynload = args.wasm_root / WASM_DYNLOAD
Expand All@@ -212,9 +223,10 @@ def main():
args.compression = zipfile.ZIP_DEFLATED
args.compresslevel = 9

args.sysconfig_data = args.builddir / SYSCONFIGDATA
args.builddir = get_builddir(args)
args.sysconfig_data = get_sysconfigdata(args)
if not args.sysconfig_data.is_file():
raise ValueError(f"sysconfigdata file {SYSCONFIGDATA} missing.")
raise ValueError(f"sysconfigdata file {args.sysconfig_data} missing.")

extmods = detect_extension_modules(args)
omit_files = list(OMIT_FILES)
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp