AdguardTeam / AdguardTeam/FiltersRegistry
`yarn build:local` (`--use-cache`) silently omits `filters.json` / `filters.js` / `filters_i18n.*` platform metadata
- Linguagem predominante
- Adblock Filter List
- Estrelas
- 358
- Forks
- 75
- Merge médio
- 23h 37min
- PRs com merge (30d)
- 9
Descrição
> Continue from https://github.com/AdguardTeam/FiltersRegistry/pull/1212#pullrequestreview-5085406312 comment
A cached build, `yarn build:local` (i.e. `scripts/build/build.js --use-cache`) never regenerates the per-platform metadata files: `filters.json`, `filters.js`, `filters_i18n.json`, `filters_i18n.js`. The compiler logs a single Error reading groups metadata line and the build still exits 0, so the omission is silent.
`prepareCachedFiltersDir` only copies `filters/`, missing the `groups/`, `tags/`, and `locales/` siblings needed for metadata. Therefore, the `yarn build:cache` doesn't output `filters.json/filters.js` metadata.
However, the committed `platforms/*/filters.json` files remained unchanged and appeared to be preserved, though they were actually stale and hadn't been regenerated. so, a plain `yarn build` is unaffected.
## Reproduction steps
1. `rm -rf platforms`
2. `yarn generate-cache && yarn build:local --no-patches-prepare --strip-generated-meta -i=1`
3. `find platforms -name 'filters.json' | wc -l # 0`
It will show as:
```
Writing filters metadata
Error reading groups metadata
```
## Summary
- Any workflow relying on `--use-cache` for a complete platform build produces output with no `filter/group/tag/i18n` metadata.
- Not a regression from a specific PR: present since `--use-cache` landed #1180, independent to FiltersCompiler.
- We just never noticed because the files were already on disk. It's not new; the wipe exposed a long-standing bug.
## Suggestion to Fix
Make the cache self-contained. two options:
- `prepareCachedFiltersDir` also copies `groups/`, `tags/`, `locales/` alongside `filters_cached/`.
- `Nest the cache as `temp/filters_cached/filters/` and copy the three siblings alongside it, so the compiler's `../groups` path resolves correctly.
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Avaliação
Esta issue ainda não foi avaliada.