Skip to content

Fix profiling preparing - #95

Open
ebzych wants to merge 5 commits into
mainfrom
fix-profiling-preparing-in-main-pipeline
Open

Fix profiling preparing#95
ebzych wants to merge 5 commits into
mainfrom
fix-profiling-preparing-in-main-pipeline

Conversation

@ebzych

@ebzych ebzych commented Apr 22, 2026

Copy link
Copy Markdown
Collaborator

fix(cli.commands.profile.setup_profiling_environment): check if build has been built
refactor: improve logging in Builder and build systems: add formatting level with build name

ebzych added 4 commits April 27, 2026 03:20
refactor(configurator): use build systems API
refactor(validator): use build systems amphimixis
feat(core): update API related with build systems
feat(amphimixis): update API related with build systems
refactor(general): improve build systems
@ebzych
ebzych force-pushed the fix-profiling-preparing-in-main-pipeline branch from 1d76865 to 12b0526 Compare April 27, 2026 12:17
Comment thread amphimixis/core/build_systems/make.py Outdated
ret_flags.append(f"{"".join(self._attrs_map(flag))}='{value}'")
return " ".join(ret_flags)
def build(self, build: Build) -> tuple[int, str, str]:
"""Build via Make

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

add extended function description to reflect difference between build and run building

docs(CMake): update build systems docstrings
docs(Make): update build systems docstrings
docs(Ninja): update build systems docstrings
@ebzych
ebzych requested a review from dabordukov April 27, 2026 13:51
runner_name: str = str(input_config.get("runner", None)).lower()

if not get_build_system(str(build_system_name)):
if not (build_system_name := str(_get_analyzed_build_system())):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
if not (build_system_name := str(_get_analyzed_build_system())):
if not (build_system_name := _get_analyzed_build_system()):

str(None) is evaluated to 'None' which is evaluated to True

if build_system not in build_systems_dict:
if not (build_system := _get_analyzed_build_system()):
build_system_name: str = str(input_config.get("build_system")).lower()
runner_name: str = str(input_config.get("runner", None)).lower()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

r u sure that "none" value is OK here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

runner_name = str(None).lower() i mean

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

runner with name 'none' will not be found and we will get None from build_systems api functions

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

trying to get runner, which you know doesn't exist, is strange

maybe check if not None then get()?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

and check the previous line: it perfoms the same actions for build_system_name but it is written a bit differently

check for consistency

Comment on lines +90 to 93
project.build_system = build_system(
project, runner(project=project, ui=ui), ui # type: ignore[arg-type]
) # type: ignore[assignment]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
project.build_system = build_system(
project, runner(project=project, ui=ui), ui # type: ignore[arg-type]
) # type: ignore[assignment]
project.build_system = build_system(
project, runner(project=project, ui=ui), ui # type: ignore[arg-type]
)

i think types are fucked up

maybe Project.build_system should be superclass, so it can have values of subclasses? (idea from Liskov substitution principle)
maybe make IHighLevelBuildSystem and ILowLevelBuildSystem to be subclasses of BuildSystem?

build_system: IHighLevelBuildSystem = get_build_system(build_system_name)
Project.build_system: BuildSystem = build_system   # so there should not be type error

@ebzych

ebzych commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator Author

/oc review

@ebzych

ebzych commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator Author

/oc summary

@opencode-agent

Copy link
Copy Markdown

PR Review: Fix profiling preparing & logging refactor

Summary

This PR fixes setup_profiling_environment to check if builds were successfully built before copying, and refactors logging in Builder/build systems to include build names for better traceability.

Key Changes

  • Profile command: Added build.successfully_built check in setup_profiling_environment (profile.py:42)
  • Configurator: Improved build system/runner fallback logic
  • Build systems: Added build-name formatted logging (e.g., Make/Ninja/CMake now prefix logs with build names)

Review Feedback to Address

  1. amphimixis/core/build_systems/make.py (dabordukov):

    • Extend docstrings for build and run_building to clarify differences:
      • build: Configures (applies flags/toolchains) + builds + installs/cleans
      • run_building: Skips configuration, runs pre-configured build only
  2. amphimixis/core/configurator.py:70 (dabordukov/ebzych):

    • Fix runner_name handling to avoid str(None) = "none":
      runner_input = input_config.get("runner")
      runner_name: str | None = str(runner_input).lower() if runner_input is not None else None
    • Apply same fix to build_system_name (line 69) for consistency
    • Update checks to use if runner_name is not None: instead of if runner_name:
  3. amphimixis/core/configurator.py:93 (dabordukov):

    • Type ignore stems from Project.build_system type being too generic. Consider refining to IHighLevelBuildSystem for better type safety (larger refactor, optional for this PR)

Verdict

Core changes are correct. Fix the docstring and configurator None-handling issues, and the PR is ready to merge.

New%20session%20-%202026-04-30T20%3A39%3A46.555Z
opencode session  |  github run

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.

2 participants