# Bootstrap dependency tree for `test-assets`

Snapshot: 2026-06-21 after moving PHPEFC to `gentoo-pw-programs/a_phpef/phpefc`.

Purpose: document what has to exist to rebuild the `test-assets` PHPEF demo from a fresh Linux/Gentoo-like system. This page resolves **Petersweeze-owned assets/packages** down to their source asset. Packages that are normal Gentoo repository packages or upstream distfiles are treated as leaves and are not expanded here.

## Scope and rule

- Resolve Petersweeze assets from `gentoo-pw-programs` / Petersweeze ebuilds.
- Do **not** recursively resolve ordinary Gentoo packages such as `dev-lang/php`, `dev-libs/glib`, `dev-build/meson`, `virtual/pkgconfig`, `dev-util/makeheaders`, `app-text/doxygen`, `binutils`, compilers, etc.
- Upstream source tarballs such as `nikic/php-parser` are leaves from this document's perspective, but the Petersweeze wrapper around them is resolved.
- `test-assets` currently has no ebuild; it is a source project under `/home/peters/SVN/pre-devels/test-assets`.

## Direct dependencies of `test-assets`

From `test-assets/meson.build` and generated `src/meson.build`:

- `pw-build-meson` to generate `src/meson.build` from `src/meson.build.pw`.
- PHPEFC command line tools:
  - `phpefc-php2ast`
  - `phpefc-phpast2phpir`
  - `phpefc-phpir2valair`
  - `phpefc-valair-optimize-typing`
  - `phpefc-valair-optimize-fastpath-runtime`
  - `phpefc-valair-optimize-library`
  - `phpefc-valair-optimize-precompute`
  - `phpefc-valair2vala`
  - `phpefc-c-add-source-lines`
  - `phpefc-add-resource-sections`
  - `phpefc-generate-stacktrace-map`
  - `phpefc-ast2php`
  - `phpefc-compare-tokenized-files`
- Runtime libraries via pkg-config:
  - `phpef-runtime-core`
  - `phpef-runtime-embed`
  - `phpef-runtime-native-standard`
- Toolchain leaves: `valac`, C compiler, `objcopy`, `pkg-config`, Meson/Ninja.

## Petersweeze dependency tree

```text
test-assets
├── dev-php/pw-build-meson
│   └── gentoo-pw-programs/dev-php_pw-build-meson
│       ├── dev-php/pcc
│       │   └── gentoo-pw-programs/dev-php-pcc
│       │       └── dev-php/pwphpbytecode
│       │           └── gentoo-pw-programs/dev-php_pwphpbytecode
│       └── dev-php/pwphpbytecode
│           └── gentoo-pw-programs/dev-php_pwphpbytecode
│
├── dev-php/phpefc
│   └── gentoo-pw-programs/a_phpef/phpefc
│       ├── dev-php/pw-build-meson
│       ├── dev-php/pcc
│       ├── dev-php/pwphpbytecode
│       ├── dev-php/pwcomposer-nikic-php-parser
│       │   ├── upstream leaf: github.com/nikic/PHP-Parser
│       │   └── dev-php/pwcomposer
│       │       └── gentoo-pw-programs/dev-php_pwcomposer
│       │           └── dev-php/pw-build-meson
│       ├── dev-php/phpef-runtime-core
│       └── dev-php/phpef-runtime-embed
│
├── dev-php/phpef-runtime-core
│   └── gentoo-pw-programs/a_phpef/phpef-runtime-core
│       └── vala-libs/vala-stacktrace
│           └── gentoo-pw-programs/a_vala_libs/stacktrace
│
├── dev-php/phpef-runtime-embed
│   └── gentoo-pw-programs/a_phpef/phpef-runtime-embed
│       ├── dev-php/phpef-runtime-core
│       ├── dev-php/pw-build-meson
│       ├── dev-php/pcc
│       └── dev-php/pwphpbytecode
│
└── dev-php/phpef-runtime-native-standard
    └── gentoo-pw-programs/a_phpef/phpef-runtime-native-standard
        ├── dev-php/phpef-runtime-core
        └── build-time: dev-php/phpef-runtime-embed
```

## Practical bootstrap order

A practical Petersweeze-side bootstrap order for rebuilding `test-assets` from zero is:

1. `dev-php/pwphpbytecode` (`gentoo-pw-programs/dev-php_pwphpbytecode`)
2. `dev-php/pcc` (`gentoo-pw-programs/dev-php-pcc`)
3. `dev-php/pw-build-meson` (`gentoo-pw-programs/dev-php_pw-build-meson`)
4. `dev-php/pwcomposer` (`gentoo-pw-programs/dev-php_pwcomposer`)
5. `dev-php/pwcomposer-nikic-php-parser` (Petersweeze Composer wrapper around upstream `nikic/php-parser`)
6. `vala-libs/vala-stacktrace` (`gentoo-pw-programs/a_vala_libs/stacktrace`)
7. `dev-php/phpef-runtime-core` (`gentoo-pw-programs/a_phpef/phpef-runtime-core`)
8. `dev-php/phpef-runtime-embed` (`gentoo-pw-programs/a_phpef/phpef-runtime-embed`)
9. `dev-php/phpef-runtime-native-standard` (`gentoo-pw-programs/a_phpef/phpef-runtime-native-standard`)
10. `dev-php/phpefc` (`gentoo-pw-programs/a_phpef/phpefc`)
11. `test-assets`

## Bootstrap concern

The long chain is real: `test-assets` is small, but it exercises PHPEFC, and PHPEFC's build chain depends on the older PHP-bytecode toolchain:

```text
pwphpbytecode → pcc → pw-build-meson → pwcomposer/parser → phpefc → test-assets
```

For a reproducible bootstrap-from-zero, the critical cyclic-looking pressure point is that `pw-build-meson` itself is built with `pcc`/`pwphpbytecode`, while PHPEFC projects then depend on `pw-build-meson` to generate Meson files. The zero-bootstrap story therefore needs either:

- a trusted prebuilt/host `pwphpbytecode + pcc + pw-build-meson` seed, or
- a separate minimal bootstrap path for these tools before PHPEFC/test-assets can be built.

## Current verified package names

At the time of this note the relevant package names observed in the overlay/workspace were:

- `dev-php/pwphpbytecode-0.15_p15056`
- `dev-php/pcc-1.31_p15053`
- `dev-php/pw-build-meson-0.79_p16443`
- `dev-php/pwcomposer-0.13_p14896`
- `dev-php/pwcomposer-nikic-php-parser-5.7.0`
- `vala-libs/vala-stacktrace-0.06_p16090`
- `dev-php/phpef-runtime-core-0.04_p16434`
- `dev-php/phpef-runtime-embed-0.03_p16436`
- `dev-php/phpef-runtime-native-standard-0.03_p16438`
- `dev-php/phpefc-0.11_p16442`

