Skip to content

Conversation

@anna-nexthop
Copy link
Contributor

Pre-submission checklist

  • I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running pip install -r requirements-dev.txt && pre-commit install
  • pre-commit run

Summary

Document the --build-type option for the getdeps.py build script and refactor the argument definition to eliminate code duplication.

  • docs/docs/build/Building_FBOSS_on_containers.md: Added comprehensive documentation about build types (Debug, Release, RelWithDebInfo, MinSizeRel) with a table explaining each option

  • docs/docs/platform/Building_Platform_Services.md: Updated build commands to use --build-type flag

  • docs/static/code_snips/*.sh: Updated all build script examples to use --build-type instead of passing CMAKE_BUILD_TYPE in --extra-cmake-defines

  • Updated the --build-type help text in getdeps.py to include:

    • Concise descriptions of each build type
    • Indication that RelWithDebInfo is the default
    • Removed the outdated "widely supported" comment
  • Created a shared BUILD_TYPE_ARG kwargs dictionary to define the --build-type argument once

  • Replaced three duplicate argument definitions in BuildCmd, TestCmd, and GenerateGithubActionsCmd classes

  • Reduced code duplication and improved maintainability

  • Users now understand what each build type does

  • Cleaner syntax: --build-type MinSizeRel vs JSON in --extra-cmake-defines

  • Single source of truth for the argument definition

  • Easier to maintain and update in the future

Verified that help output works correctly for all three commands:

  • build --help
  • test --help
  • generate-github-actions --help

Test Plan

Visually inspected a local serve of the documentation
image

image

This PR documents the `--build-type` option for the getdeps.py build
script and refactors the argument definition to eliminate code
duplication.

- **docs/docs/build/Building_FBOSS_on_containers.md**: Added
comprehensive documentation about build types (Debug, Release,
RelWithDebInfo, MinSizeRel) with a table explaining each option
- **docs/docs/platform/Building_Platform_Services.md**: Updated build
commands to use `--build-type` flag
- **docs/static/code_snips/*.sh**: Updated all build script examples to
use `--build-type` instead of passing `CMAKE_BUILD_TYPE` in
`--extra-cmake-defines`

- Updated the `--build-type` help text in getdeps.py to include:
  - Concise descriptions of each build type
  - Indication that RelWithDebInfo is the default
  - Removed the outdated "widely supported" comment

- Created a shared `BUILD_TYPE_ARG` kwargs dictionary to define the
`--build-type` argument once
- Replaced three duplicate argument definitions in BuildCmd, TestCmd,
and GenerateGithubActionsCmd classes
- Reduced code duplication and improved maintainability

- Users now understand what each build type does
- Cleaner syntax: `--build-type MinSizeRel` vs JSON in
`--extra-cmake-defines`
- Single source of truth for the argument definition
- Easier to maintain and update in the future

Verified that help output works correctly for all three commands:
- `build --help`
- `test --help`
- `generate-github-actions --help`

Visually inspected a local serve of the documentation

for instructions)
<img width="989" height="594" alt="image"
src="https://github.com/user-attachments/assets/8ef42b88-a564-4ba1-8219-51e366a4d171"
/>

<img width="989" height="594" alt="image"
src="https://github.com/user-attachments/assets/1e9709ef-2cb8-4432-a236-96986bfc2588"
/>
@meta-cla meta-cla bot added the CLA Signed label Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant