Skip to content

fix: build system reliability fixes and docs corrections#371

Open
Sireeshreddy01 wants to merge 1 commit intobrowseros-ai:mainfrom
Sireeshreddy01:fix/build-system-reliability-and-docs
Open

fix: build system reliability fixes and docs corrections#371
Sireeshreddy01 wants to merge 1 commit intobrowseros-ai:mainfrom
Sireeshreddy01:fix/build-system-reliability-and-docs

Conversation

@Sireeshreddy01
Copy link

  • Remove temp file leak in CompileModule._create_version_file: write VERSION directly via Path.write_text() instead of tempfile+shutil.copy2
  • Always close build log: add finally: close_log_file() in execute_pipeline() so logs are flushed on success, failure, and KeyboardInterrupt
  • Fix fragile series patch comment stripping: change ' #' to ' # ' (GNU Quilt convention) so patch filenames containing ' #' are preserved
  • Move IS_MACOS to module-level import in git.py, remove redundant inner-function re-import in SparkleSetupModule.validate()
  • Validate build_type in ConfigureModule.validate(): reject values other than 'debug' or 'release' with a clear error message
  • Fix CONTRIBUTING.md build commands: correct binary name to 'browseros build', fix non-existent config filenames (debug.macos.yaml -> debug.yaml), remove --chromium-src which conflicts with --config mode
  • Remove stale 'Coming soon' from Graph Mode card in docs/index.mdx and add href to the existing /features/workflows page

@Sireeshreddy01
Copy link
Author

have read the CLA Document and I hereby sign the CLA

@github-actions
Copy link
Contributor

github-actions bot commented Feb 19, 2026

CLA Assistant Lite bot ✅ All contributors have signed the CLA. Thank you for helping make BrowserOS better!
Posted by the CLA Assistant Lite bot.

@greptile-apps
Copy link

greptile-apps bot commented Feb 19, 2026

Greptile Summary

This PR enhances build system reliability through multiple focused fixes:

  • Resource management: Eliminated temp file leak in VERSION file creation by replacing tempfile+shutil.copy2 with direct Path.write_text(), and ensured build logs are always closed via finally block regardless of success, failure, or interrupts
  • Patch system robustness: Fixed fragile comment stripping logic from ' #' to ' # ' (GNU Quilt convention) to correctly handle patch filenames containing ' #'
  • Code organization: Moved IS_MACOS import to module-level in git.py, removing redundant inner-function import
  • Input validation: Added build_type validation in ConfigureModule to reject invalid values with clear error messages
  • Documentation accuracy: Corrected CONTRIBUTING.md build commands (binary name, config filenames, removed conflicting --chromium-src flag) and updated docs/index.mdx to remove stale "Coming soon" text from Graph Mode card

All changes are non-breaking improvements that fix edge cases and improve developer experience.

Confidence Score: 5/5

  • Safe to merge with no identified risks
  • All changes are defensive improvements that fix resource leaks, improve error handling, and correct documentation. The changes are well-scoped, follow Python best practices, and address real edge cases (temp file cleanup, log file closure, patch filename parsing). No breaking changes or logic errors detected.
  • No files require special attention

Important Files Changed

Filename Overview
packages/browseros/build/cli/build.py Added finally block to ensure log file closes on success, failure, and interrupts
packages/browseros/build/modules/compile/standard.py Replaced tempfile+shutil.copy2 with direct Path.write_text(), removing temp file leak
packages/browseros/build/modules/patches/series_patches.py Fixed comment stripping from ' #' to ' # ' to preserve patch filenames with ' #'
packages/browseros/build/modules/setup/git.py Moved IS_MACOS import to module-level, removing redundant inner-function import
packages/browseros/build/modules/setup/configure.py Added validation to reject invalid build_type values (only accepts debug or release)
CONTRIBUTING.md Fixed build commands: corrected binary name, config filenames, and removed conflicting flags
docs/index.mdx Removed 'Coming soon' text and added href to Graph Mode card

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[execute_pipeline] -->|try block| B[Execute modules sequentially]
    B -->|success| C[Log success & notify_pipeline_end]
    B -->|KeyboardInterrupt| D[Log error & notify_pipeline_error]
    B -->|ValidationError| E[Log validation failure & notify_pipeline_error]
    B -->|Exception| F[Log pipeline failure & notify_pipeline_error]
    C -->|finally| G[close_log_file]
    D -->|finally| G
    E -->|finally| G
    F -->|finally| G
    G --> H[Ensure log file flushed & closed]
    
    I[CompileModule._create_version_file] -->|old approach| J[tempfile.NamedTemporaryFile]
    J --> K[shutil.copy2]
    K --> L[Path.unlink temp file]
    
    I -->|new approach| M[Path.write_text directly]
    M --> N[No temp file leak]
Loading

Last reviewed commit: 2ce58bb

@Sireeshreddy01
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

@Sireeshreddy01
Copy link
Author

recheck

- Remove temp file leak in CompileModule._create_version_file: write
  VERSION directly via Path.write_text() instead of tempfile+shutil.copy2
- Always close build log: add finally: close_log_file() in execute_pipeline()
  so logs are flushed on success, failure, and KeyboardInterrupt
- Fix fragile series patch comment stripping: change ' #' to ' # ' (GNU
  Quilt convention) so patch filenames containing ' #' are preserved
- Move IS_MACOS to module-level import in git.py, remove redundant
  inner-function re-import in SparkleSetupModule.validate()
- Validate build_type in ConfigureModule.validate(): reject values other
  than 'debug' or 'release' with a clear error message
- Fix CONTRIBUTING.md build commands: correct binary name to 'browseros build',
  fix non-existent config filenames (debug.macos.yaml -> debug.yaml),
  remove --chromium-src which conflicts with --config mode
- Remove stale 'Coming soon' from Graph Mode card in docs/index.mdx and
  add href to the existing /features/workflows page
@Sireeshreddy01 Sireeshreddy01 force-pushed the fix/build-system-reliability-and-docs branch from 2ce58bb to 0baad8e Compare February 19, 2026 21:43
@Sireeshreddy01
Copy link
Author

recheck

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.

1 participant