Skip to content

chore: Some Makefile fixes#18319

Merged
SyntaxColoring merged 6 commits intoedgefrom
makefile_fixes
May 12, 2025
Merged

chore: Some Makefile fixes#18319
SyntaxColoring merged 6 commits intoedgefrom
makefile_fixes

Conversation

@SyntaxColoring
Copy link
Copy Markdown
Contributor

@SyntaxColoring SyntaxColoring commented May 12, 2025

Overview

Some fixes to our build system.

Test Plan and Hands on Testing

  • Top-level make setup works
  • Top-level make teardown works

Changelog

See comments below.

Risk assessment

Low.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 25.72%. Comparing base (0b868f9) to head (b662aab).
Report is 3 commits behind head on edge.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             edge   #18319      +/-   ##
==========================================
+ Coverage   24.69%   25.72%   +1.03%     
==========================================
  Files        3220     3207      -13     
  Lines      272857   272342     -515     
  Branches    25998    26003       +5     
==========================================
+ Hits        67370    70054    +2684     
+ Misses     205462   202262    -3200     
- Partials       25       26       +1     
Flag Coverage Δ
protocol-designer 18.99% <ø> (+<0.01%) ⬆️
step-generation 4.58% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 80 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread Makefile
$(OT_PYTHON) -m pip install --upgrade pip
$(OT_PYTHON) -m pip install pipenv==2023.12.1
# this needs to be installed AFTER pipenv or pipenv will update this to the bad version
# this needs to be installed AFTER pipenv or pipenv will update this to the bad version
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is a tabs vs. spaces thing. In Makefiles, tabs (the \t character) are semantic and not equivalent to 4 spaces. This line had 4 spaces in front of it. It seems like things were working, but it made me nervous, so this "fixes" it.

This entirely removes the leading whitespaces to the comment is parsed as a Makefile comment, instead of being passed to the shell and the shell evaluating it as a comment and printing it out.

Comment thread Makefile Outdated
.PHONY: setup-js
setup-js:
setup-js: setup-py-toolchain
setup-js: setup-py-toolchain $(addsuffix -py-setup, $(USB_BRIDGE_DIR))
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

make setup-js seems to depend on make -C usb-bridge happening beforehand. Otherwise it fails with ENOENT.

The presentation of the error is a little weird and it makes me think that something else is going on here, but I didn't investigate further.

Copy link
Copy Markdown
Contributor Author

@SyntaxColoring SyntaxColoring May 12, 2025

Choose a reason for hiding this comment

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

Uh hm, this "new" dependency on Python is making CI fail. Which means CI has never needed make -C usb-bridge to come before make setup-js. Which means, yeah, something else is going on here and I need to investigate it further.

Reverting for now.

Comment thread abr-testing/Makefile
.PHONY: teardown
teardown:
$(pipenv) --rm
-$(pipenv) --rm
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Each Python project's teardown target would fail if the project didn't have a virtualenv, e.g. if the project was already torn down or if it was never set up to begin with. This tolerates those errors so they don't bubble up and cause a top-level make teardown-py to abort prematurely.

Comment thread hardware/Makefile
Comment on lines +82 to +84
# todo(mm, 2025-05-12): Evaluating $(wheel_file) here means we'll call pipenv and create
# a virtualenv whenever this Makefile is read--even if you're just doing something
# like `make teardown`.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No idea what to do about this. api handles it by not depending on $(wheel_file), which seems gross in another way.

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.

if you make wheel_file lazily evalulated with = instead of := that should fix it

Copy link
Copy Markdown
Contributor Author

@SyntaxColoring SyntaxColoring May 12, 2025

Choose a reason for hiding this comment

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

Good thought, but it turns out it already is defined with =. Apparently, make evaluates the dependency list eagerly, which undoes that.

@SyntaxColoring SyntaxColoring marked this pull request as ready for review May 12, 2025 16:47
@SyntaxColoring SyntaxColoring requested review from a team as code owners May 12, 2025 16:47
@SyntaxColoring
Copy link
Copy Markdown
Contributor Author

Failing hardware-testing checks are a preexisting problem on edge.

Copy link
Copy Markdown
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

Looks good, I think the wheel-file thing ca be fixed with lazy evaluation

Comment thread hardware/Makefile
Comment on lines +82 to +84
# todo(mm, 2025-05-12): Evaluating $(wheel_file) here means we'll call pipenv and create
# a virtualenv whenever this Makefile is read--even if you're just doing something
# like `make teardown`.
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.

if you make wheel_file lazily evalulated with = instead of := that should fix it

@SyntaxColoring SyntaxColoring merged commit 40fb85e into edge May 12, 2025
82 of 91 checks passed
@SyntaxColoring SyntaxColoring deleted the makefile_fixes branch May 12, 2025 17:18
ddcc4 pushed a commit that referenced this pull request May 16, 2025
ddcc4 pushed a commit that referenced this pull request May 16, 2025
ddcc4 pushed a commit that referenced this pull request May 16, 2025
ddcc4 pushed a commit that referenced this pull request May 16, 2025
ddcc4 pushed a commit that referenced this pull request May 16, 2025
ddcc4 pushed a commit that referenced this pull request May 16, 2025
ddcc4 pushed a commit that referenced this pull request May 17, 2025
ddcc4 pushed a commit that referenced this pull request May 17, 2025
ddcc4 pushed a commit that referenced this pull request May 17, 2025
ddcc4 pushed a commit that referenced this pull request May 17, 2025
(cherry picked from commit 40fb85e)
ddcc4 pushed a commit that referenced this pull request May 17, 2025
(cherry picked from commit 40fb85e)
ddcc4 pushed a commit that referenced this pull request May 17, 2025
(cherry picked from commit 40fb85e)
ddcc4 pushed a commit that referenced this pull request May 17, 2025
(cherry picked from commit 40fb85e)
ddcc4 pushed a commit that referenced this pull request May 17, 2025
(cherry picked from commit 40fb85e)
ddcc4 pushed a commit that referenced this pull request May 17, 2025
(cherry picked from commit 40fb85e)
ddcc4 pushed a commit that referenced this pull request May 19, 2025
(cherry picked from commit 40fb85e)
ddcc4 pushed a commit that referenced this pull request May 19, 2025
(cherry picked from commit 40fb85e)
ddcc4 pushed a commit that referenced this pull request May 19, 2025
(cherry picked from commit 40fb85e)
ddcc4 pushed a commit that referenced this pull request May 20, 2025
(cherry picked from commit 40fb85e)
ddcc4 pushed a commit that referenced this pull request May 20, 2025
(cherry picked from commit 40fb85e)
ddcc4 pushed a commit that referenced this pull request May 22, 2025
(cherry picked from commit 40fb85e)
ddcc4 pushed a commit that referenced this pull request May 23, 2025
(cherry picked from commit 40fb85e)
ddcc4 pushed a commit that referenced this pull request May 24, 2025
(cherry picked from commit 40fb85e)
ddcc4 pushed a commit that referenced this pull request May 24, 2025
(cherry picked from commit 40fb85e)
ddcc4 pushed a commit that referenced this pull request May 29, 2025
(cherry picked from commit 40fb85e)
ddcc4 pushed a commit that referenced this pull request May 29, 2025
(cherry picked from commit 40fb85e)
ddcc4 pushed a commit that referenced this pull request May 29, 2025
(cherry picked from commit 40fb85e)
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