Skip to content

Fix #1180 Add the ability to build filters completely locally#1181

Open
Alex-302 wants to merge 10 commits intomasterfrom
fix/1180_local_build_from_cache
Open

Fix #1180 Add the ability to build filters completely locally#1181
Alex-302 wants to merge 10 commits intomasterfrom
fix/1180_local_build_from_cache

Conversation

@Alex-302
Copy link
Copy Markdown
Member

@Alex-302 Alex-302 requested review from a team and slvvko March 28, 2026 18:40
Alex-302 and others added 4 commits March 29, 2026 00:03
Strip volatile metadata lines (Checksum, Diff-Path, TimeUpdated, Version)
from compiled filter files after build. Reduces noise when comparing
outputs between compiler versions.
Comment thread scripts/build/strip-generated-meta.ts
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use kebab-case for the new filename here?
We are gradually standardizing on this naming style across projects, so for new files it would be better to move in that direction instead of extending the underscore-based pattern.

Copy link
Copy Markdown
Member Author

@Alex-302 Alex-302 Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and custom_platforms.js, find_files.js?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread scripts/build/strip_generated_meta.js Outdated
Comment thread scripts/build/strip_generated_meta.js Outdated
Comment thread scripts/build/strip-generated-meta.ts
Comment thread scripts/build/strip_generated_meta.js Outdated
Comment thread scripts/build/strip_generated_meta.js Outdated
Comment thread scripts/build/strip-generated-meta.js Outdated
Comment thread scripts/build/build.js
Comment thread scripts/build/build.js Outdated
Comment thread package.json
"build": "tsx scripts/build/build.js",
"build:local": "tsx scripts/build/build.js --use-cache",
"build:patches": "node scripts/build/patches.js",
"strip-generated-meta": "tsx scripts/build/strip-generated-meta.ts",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yarn strip-generated-meta points to scripts/build/strip-generated-meta.ts, but this file only exports stripGeneratedMetaFromDir() and never invokes it.

I verified locally that the command exits successfully without touching the generated files. Please add a CLI entrypoint here, or point the npm script to a small wrapper that actually calls the function.

Comment thread scripts/build/build.js

// Strip generated metadata (Checksum, Diff-Path, TimeUpdated, Version)
// from compiled filter files so they don't pollute diff comparisons.
if (stripGeneratedMeta) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This strips metadata only from the new platforms/ tree, but the old baseline may already have been copied to temp/platforms/ above.

That means a later yarn build:patches can diff stripped output against an unstripped baseline and generate patch noise from volatile headers instead of real content changes. Please either make --strip-generated-meta imply --no-patches-prepare, reject the unsafe combination, or strip both trees consistently.

* @param rootDir - Root directory to search (e.g. `platforms/`).
* @returns Number of files actually modified.
*/
export const stripGeneratedMetaFromDir = async (rootDir: string): Promise<number> => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: this first walks the tree to find every filters/ directory and then does another recursive walk inside each one to collect .txt files. Since we already have a shared recursive file finder, could we avoid the extra traversal and gather the relevant files in one pass?

Comment thread scripts/build/build.js
/**
* Compiler entry point.
*/
const buildFilters = async () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This introduces several new execution paths and flag interactions (--use-cache, --generate-cache, --no-patches-prepare, --strip-generated-meta), but the PR does not add any focused coverage for them.

Could we extract the mode selection and argument handling into smaller helpers and add tests for the new combinations? The two blocker scenarios here are exactly the kind of regressions that are easy to miss without targeted coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants