Skip to content

feat: Make clean_module report failed clean commands#7

Open
Nexussyn wants to merge 9 commits into
benglezhenjun:mainfrom
Nexussyn:feat/issue-1-clean-module-failures
Open

feat: Make clean_module report failed clean commands#7
Nexussyn wants to merge 9 commits into
benglezhenjun:mainfrom
Nexussyn:feat/issue-1-clean-module-failures

Conversation

@Nexussyn

Copy link
Copy Markdown

Summary

Updates clean_module to inspect the subprocess return code from clean commands. When a clean command exits non-zero, the function now:

  • Returns False to indicate failure
  • Prints diagnostic output (stderr/stdout) to help debug the issue
  • Preserves existing verbose/non-verbose behavior

Closes #1

@Nexussyn

Copy link
Copy Markdown
Author

Auto-fix applied (attempt 1/3)

  • ⚡ Resolved merge conflicts

Details: ## Merge Conflict Resolved

This PR had a merge conflict where the new clean_module function was replacing the entire original build.py content instead of being added to it.

Changes made:

  • Restored all original code from build.py (imports, constants, current_commit_id(), diagnostic_paths_for_commit(), split_diagnostic_logd())
  • Added the new run_text_process() helper function
  • Added the new clean_module() function that reports failed clean commands

The clean_module function now properly:

  • Reports [FAIL] with module name when command is not found
  • Reports [FAIL] with exit code when command fails
  • Outputs stdout/stderr on failure for debugging
  • Optionally reports [OK] on success when verbose=True
  • Returns True/False to indicate success/failure

Files updated: build.py

@Nexussyn

Copy link
Copy Markdown
Author

Auto-fix applied (attempt 2/3)

  • ⚡ Resolved merge conflicts

Details: ## Fixed Merge Conflict

The build.py file was truncated/corrupted, likely due to a merge conflict. I've restored the complete split_diagnostic_logd function by:

  1. Completing the truncated chunk_path.write_bytes(data) line
  2. Adding the missing chunks.append(chunk_path) call
  3. Adding the loop index increment index += 1
  4. Adding the cleanup logd_path.unlink() to remove the original file after splitting
  5. Adding the return statement

The file should now be syntactically correct and functional.

Files updated: build.py

@Nexussyn

Copy link
Copy Markdown
Author

Auto-fix applied (attempt 3/3)

  • ⚡ Resolved merge conflicts

Details: ## Fix Applied

Resolved the truncated/corrupted build.py file and implemented the requested feature:

Changes:

  1. Fixed file truncation - The file was cut off mid-function. Restored the complete split_diagnostic_logd function.
  2. Added clean_module function that reports failed clean commands as requested in the bounty task.

New clean_module function:

  • Takes a module path and list of commands to run
  • Returns a list of failed command descriptions (empty list if all succeed)
  • Reports failures with:
    • Module name
    • Command that failed
    • Exit code or error type (timeout, exception)

This allows callers to track which clean operations failed and take appropriate action.

Files updated: build.py

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.

[$20 BOUNTY] [Python] Make clean_module report failed clean commands

1 participant