codecin 5.4.2__tar.gz → 5.4.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {codecin-5.4.2 → codecin-5.4.3}/PKG-INFO +1 -1
- {codecin-5.4.2 → codecin-5.4.3}/codecin/__init__.py +1 -1
- {codecin-5.4.2 → codecin-5.4.3}/codecin/native/engine/version_gen.go +1 -1
- {codecin-5.4.2 → codecin-5.4.3}/codecin.egg-info/PKG-INFO +1 -1
- {codecin-5.4.2 → codecin-5.4.3}/codecin.egg-info/SOURCES.txt +1 -1
- codecin-5.4.3/setup.py +76 -0
- codecin-5.4.2/codecin/libcodecin_native.so +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/LICENSE +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/README.md +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/aot.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/assembler.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/cache.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/cin.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/cli.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/config.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/console.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/cpu.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/crom.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/debugger.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/disasm.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/errors.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/isa.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/jit.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/logger.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/memory.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/native/aot/aot.go +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/native/aot/build.go +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/native/aot/stub_main.go.txt +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/native/build.ps1 +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/native/build.sh +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/native/cmd/codecin/main.go +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/native/compiler/codegen.go +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/native/compiler/compile_test.go +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/native/compiler/parser.go +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/native/compiler/syscalls.go +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/native/compiler/tokenizer.go +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/native/compiler/types.go +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/native/engine/audio.go +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/native/engine/audio_other.go +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/native/engine/audio_windows.go +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/native/engine/canvas.go +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/native/engine/crom.go +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/native/engine/encode.go +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/native/engine/engine_test.go +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/native/engine/isa_gen.go +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/native/engine/system.go +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/native/engine/termux.go +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/native/engine/vm.go +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/native/go.mod +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/native/ir/ir.go +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/native/main.go +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/native.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/registers.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin/stats.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin.egg-info/dependency_links.txt +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin.egg-info/entry_points.txt +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin.egg-info/requires.txt +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/codecin.egg-info/top_level.txt +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/pyproject.toml +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/setup.cfg +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_aot.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_assembler_ext.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_cache.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_cin_host.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_cin_new_features.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_cin_syntax.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_cin_system.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_cli.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_compiler_errors.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_cpu_interpreted.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_debugger.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_examples.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_features_ab.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_features_crom_mmu.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_features_import.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_features_importloc.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_features_mmu.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_features_remote.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_go_compiler.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_isa_dispatch.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_isa_single_source.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_libs.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_libs_ext.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_literals_and_bom.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_memory_protection.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_native_hardening.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_switch_semantics.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_three_paths.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_version.py +0 -0
- {codecin-5.4.2 → codecin-5.4.3}/tests/test_workflows.py +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
LICENSE
|
|
2
2
|
README.md
|
|
3
3
|
pyproject.toml
|
|
4
|
+
setup.py
|
|
4
5
|
codecin/__init__.py
|
|
5
6
|
codecin/aot.py
|
|
6
7
|
codecin/assembler.py
|
|
@@ -16,7 +17,6 @@ codecin/disasm.py
|
|
|
16
17
|
codecin/errors.py
|
|
17
18
|
codecin/isa.py
|
|
18
19
|
codecin/jit.py
|
|
19
|
-
codecin/libcodecin_native.so
|
|
20
20
|
codecin/logger.py
|
|
21
21
|
codecin/memory.py
|
|
22
22
|
codecin/native.py
|
codecin-5.4.3/setup.py
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import platform
|
|
3
|
+
import shutil
|
|
4
|
+
import subprocess
|
|
5
|
+
import sys
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
from setuptools import setup
|
|
9
|
+
from setuptools.command.build_py import build_py
|
|
10
|
+
|
|
11
|
+
ROOT = Path(__file__).resolve().parent
|
|
12
|
+
NATIVE = ROOT / "codecin" / "native"
|
|
13
|
+
PKG = ROOT / "codecin"
|
|
14
|
+
|
|
15
|
+
EXT = {"Windows": ".dll", "Darwin": ".dylib"}.get(platform.system(), ".so")
|
|
16
|
+
|
|
17
|
+
LIB_NAMES = ["libcodecin_native" + EXT, "codecin_native" + EXT]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _should_skip() -> bool:
|
|
21
|
+
|
|
22
|
+
if os.environ.get("CODECIN_SKIP_NATIVE", "0") == "1":
|
|
23
|
+
return True
|
|
24
|
+
if os.environ.get("CODECIN_NO_GO", "0") == "1":
|
|
25
|
+
return True
|
|
26
|
+
return False
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _go_available() -> bool:
|
|
30
|
+
if shutil.which("go") is None:
|
|
31
|
+
print("[codecin] 'go' not found in PATH — 跳过原生库构建", file=sys.stderr)
|
|
32
|
+
return False
|
|
33
|
+
return True
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def build_native_lib() -> None:
|
|
37
|
+
if _should_skip():
|
|
38
|
+
print("[codecin] 环境变量要求跳过原生构建")
|
|
39
|
+
return
|
|
40
|
+
|
|
41
|
+
if os.environ.get("CODECIN_FORCE_REBUILD", "1") != "1":
|
|
42
|
+
if any((PKG / n).exists() for n in LIB_NAMES):
|
|
43
|
+
print("[codecin] 原生库已存在,跳过重建")
|
|
44
|
+
return
|
|
45
|
+
|
|
46
|
+
if not _go_available():
|
|
47
|
+
return
|
|
48
|
+
|
|
49
|
+
system = platform.system()
|
|
50
|
+
if system == "Windows":
|
|
51
|
+
script = NATIVE / "build.ps1"
|
|
52
|
+
cmd = [
|
|
53
|
+
"powershell", "-NoProfile",
|
|
54
|
+
"-ExecutionPolicy", "Bypass",
|
|
55
|
+
"-File", str(script),
|
|
56
|
+
]
|
|
57
|
+
else:
|
|
58
|
+
script = NATIVE / "build.sh"
|
|
59
|
+
cmd = ["bash", str(script)]
|
|
60
|
+
|
|
61
|
+
if not script.exists():
|
|
62
|
+
print(f"[codecin] 未找到 {script},跳过", file=sys.stderr)
|
|
63
|
+
return
|
|
64
|
+
|
|
65
|
+
print(f"[codecin] 编译原生库: {' '.join(cmd)} (cwd={NATIVE})")
|
|
66
|
+
subprocess.check_call(cmd, cwd=str(NATIVE))
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class BuildPyWithNative(build_py):
|
|
70
|
+
|
|
71
|
+
def run(self):
|
|
72
|
+
build_native_lib()
|
|
73
|
+
super().run()
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
setup(cmdclass={"build_py": BuildPyWithNative})
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|