Build levels & bundles빌드 레벨과 번들

From source to a deployment unit: the build command, the four levels and the five bundle types.

소스에서 배포 단위까지: 빌드 명령, 네 가지 레벨, 다섯 가지 번들 유형.

Four stages네 단계

Stage단계Meaning뜻Today지금
compileSource → an executable intermediate artifact.소스 → 실행 가능한 중간 산출물.ppp build, through MesonMeson 을 거친 ppp build
bundleThe artifact plus resources, dependencies and metadata → one deployment unit.산출물 + 리소스, 의존성, 메타데이터 → 배포 단위 하나.Library API only라이브러리 API 만
buildCoordinates dependency checks, compile and bundle.의존성 확인, 컴파일, 번들을 조율.Drives compile only컴파일만 수행
deployUploads a bundle to PyPI, FastTrack or ResourceHub.번들을 PyPI, FastTrack, ResourceHub 로 업로드.Registered; every type refuses등록됨. 모든 유형이 거부

ppp buildppp build

ppp build <package> [--type debug|release] [--level <level>] [--target <triple>] [--overwrite]

It scans src/main (then src, then the package root) for Python packages: .c/.cc/.cpp/.cxx become py.extension_module() targets, .py/.pyi/py.typed become py.install_sources(). Output lands in dist/<target>/<type>/<level>; the wheel bundlers read it from there.

src/main (다음 src, 다음 패키지 루트) 에서 Python 패키지를 찾습니다. .c/.cc/.cpp/.cxx 는 py.extension_module() 대상이, .py/.pyi/py.typed 는 py.install_sources() 가 됩니다. 결과는 dist/<target>/<type>/<level> 에 놓이고, 휠 번들러가 거기서 읽습니다.

--level and --target only name directories today: Meson builds for the host at every level. Pass the canonical triple as --target when a wheel bundler will read the output.

지금 --level 과 --target 은 디렉터리 이름만 정합니다. Meson 은 모든 레벨에서 호스트용으로 빌드합니다. 휠 번들러가 결과를 읽을 것이라면 --target 에 정식 트리플을 주세요.

Build levels빌드 레벨

Level레벨Ships담는 것Status상태
instantPython source, almost as-is.Python 소스, 거의 그대로.implemented구현 all bundle types모든 번들 유형
bytecode.pyc beside each module (compileall -b) by the project's .venv interpreter; debug keeps the .py, release drops it.프로젝트 .venv 의 인터프리터로 모듈 옆에 .pyc (compileall -b). debug 는 .py 를 남기고 release 는 뺍니다.partial부분 resource onlyresource 만
nativeSee below.아래를 보세요.planned계획
mixedSee below.아래를 보세요.planned계획

What native and mixed meannative 와 mixed 의 뜻

Decided by the maintainer (from toolchain's example build file: compileLevel = "native" is native code only, "mixed" is bytecode for the developer's code plus native code for libraries). Every bundler still rejects both; the native path is built on the compile slot.

메인테이너가 결정했습니다 (toolchain 의 예시 빌드 파일: compileLevel = "native" 는 네이티브 코드만, "mixed" 는 개발자 코드는 바이트코드 + 라이브러리는 네이티브 코드). 모든 번들러가 아직 둘 다 거부하며, native 경로는 컴파일 슬롯 위에 만들어집니다.

Part of the payload페이로드의 부분mixedmixednativenative
Developer modules개발자 모듈Bytecode. TypedPython's C is not used.바이트코드. TypedPython 의 C 는 쓰지 않습니다.Compiled from the C TypedPython produced for the module.TypedPython 이 그 모듈에 만든 C 를 컴파일.
A developer module with no CC 가 없는 개발자 모듈Bytecode.바이트코드.Allowed as an exception: shipped as bytecode, with a build warning naming the module and the reason.예외로 허용: 바이트코드로 담고, 모듈과 이유를 밝히는 빌드 경고.
C that fails to compile컴파일에 실패한 C--Fails the build. It is never silently shipped as bytecode.빌드 실패. 조용히 바이트코드로 대신하지 않습니다.
Libraries라이브러리Their prebuilt native wheels for the target.타깃용으로 미리 빌드된 네이티브 휠.Their prebuilt native wheels for the target.타깃용으로 미리 빌드된 네이티브 휠.

Bundle types번들 유형

Bundling is a library API: BundlerInterface.create(BundleType.X).bundle(BundleRequest(…)). Output goes to <package>/build/packpack/<type>/<build type>/<level>.

번들링은 라이브러리 API 입니다: BundlerInterface.create(BundleType.X).bundle(BundleRequest(…)). 결과는 <package>/build/packpack/<type>/<build type>/<level> 에 놓입니다.

Type유형Produces만드는 것Status상태
resourceA directory: python/ (for sys.path) beside resource-manifest.json (identity, target, per-file SHA-256). Reads source: src/main, then src/<family>, then metaDirs, then libDirs; later wins. This is what toolchain stages into the desktop jar and the APK.디렉터리: python/ (sys.path 용) 과 resource-manifest.json (식별 정보, 타깃, 파일별 SHA-256). 소스를 읽습니다: src/main, src/<family>, metaDirs, libDirs 순서이며 나중 것이 이깁니다. toolchain 이 데스크톱 jar 와 APK 에 넣는 것이 이것입니다.implemented구현
singleA wheel of the package alone, from dist/, native extensions kept. Android tags use minSdk.패키지만 담은 휠. dist/ 에서 읽고 네이티브 확장 포함. Android 태그는 minSdk 를 씁니다.implemented구현 instantinstant
fatA wheel with workspace dependencies and the third-party ones from build/crossenv/<triple> (run sync first).워크스페이스 의존성과 build/crossenv/<triple> 의 서드파티 의존성까지 담은 휠 (먼저 sync).implemented구현 instantinstant
patchAdded and changed files against the single baseline, removals in PATCH-MANIFEST.single 기준선 대비 추가, 변경 파일과 PATCH-MANIFEST 의 삭제 목록.implemented구현 instantinstant
binaryA target-specific binary layout.타깃별 바이너리 레이아웃.planned계획