Skip to content

[Nexthop] fix "asic_config_v2" output generation#1149

Open
marif-nexthop wants to merge 5 commits into
facebook:mainfrom
nexthop-ai:marif.fboss-asic-config-build-2
Open

[Nexthop] fix "asic_config_v2" output generation#1149
marif-nexthop wants to merge 5 commits into
facebook:mainfrom
nexthop-ai:marif.fboss-asic-config-build-2

Conversation

@marif-nexthop
Copy link
Copy Markdown
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

The asic_config_v2 can generate output files in fboss/lib/asic_config_v2/generated_asic_configs by running fboss/lib/asic_config_v2/run-helper.sh but this is broken in OSS FBOSS currently because of some recent changes related to thrift etc.

In this PR, asic_config_v2 output generation is fixed. The following are the main changes:

  • Fixed existing ruff linter issues
  • Updated fboss/lib/oss/run-helper.py
    • to handle python thrift generated directory type output along with C++ generated single binary output
    • to accept --extra-cmake-defines and merge with the existing hardcoded values
  • Updated fboss/lib/asic_config_v2/run-helper.sh to
    • pass the target as expected by the latest thrift changes
    • pass --extra-cmake-defines to disable range-v3 tests

Note: Please check individual commits for reviewing each small change separately.


Test Plan

Generated asic_config_v2 output files in fboss/lib/asic_config_v2/generated_asic_configs by running fboss/lib/asic_config_v2/run-helper.sh.

add_fb_thrift_python_executable (and any add_fb_python_executable call
with TYPE dir) produces a directory whose cmake target name is suffixed
with .GEN_PY_EXE. Strip that suffix when computing the on-disk output
path, and invoke directory outputs via python3 so __main__.py runs.
Non-python targets (e.g. fboss-bspmapping-gen) continue to exec directly.
cmake/AsicConfigV2ConfigCli.cmake uses add_fb_thrift_python_executable,
which registers the cmake target with a .GEN_PY_EXE suffix. Pass the
suffixed name so build can find it; run-helper.py strips the suffix
when locating the on-disk output.
Callers can now pass a JSON object of additional cmake defines which is
merged over the hardcoded {CMAKE_BUILD_TYPE, CMAKE_CXX_STANDARD} defaults.
Caller keys win on conflict. Existing callers that do not pass the flag
are unaffected.
range-v3's test suite fails to compile under clang's -Werror,-Wnrvo.
Disable it at the cmake level via --extra-cmake-defines.
@marif-nexthop marif-nexthop force-pushed the marif.fboss-asic-config-build-2 branch from b3fca39 to fa615d9 Compare May 21, 2026 04:33
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