fix: repair master — four merges landed code that does not compile - #82
fix: repair master — four merges landed code that does not compile#82srpatcha wants to merge 4 commits into
Conversation
`master` does not configure, and once it does it does not build, and once it builds one suite fails. Each break is the same failure: a PR verified green on its own branch, squash-merged onto a base that had moved, and nothing re-verified the result. 1. tests/CMakeLists.txt registered test_crypto_aes and test_crypto_sha512 twice (#59 landing beside the block that already had them), so CMake refused to configure at all: add_test given test NAME "test_crypto_aes" which already exists 2. eos_task_set_current_internal was defined twice in task.c and declared twice in kernel_internal.h, with two different behaviours — one clears g_current and marks the task RUNNING, the other silently returns. Kept the first, which is what the header documents ("Handles >= EOS_MAX_TASKS clear it") and what the mutex tests rely on; folded the second declaration's comment into the surviving one, since it records why the function exists. 3. sync.c would not compile: g_blocked_on, pi_propagate and task_valid were used and defined nowhere, alongside a reference to a struct member original_prio that mtx_t does not have. #67 and #55 implement incompatible designs for the same feature. #67 recomputes effective priority from effective = min(base_priority, priority of every waiter on every mutex the task holds) on every change; #55 saves and restores a value around each lock. Merging #55 after #67 deleted #67's implementation while leaving its call sites, so neither design was left intact. Restored #67's. It is the stronger of the two — save/restore is wrong when a task holds two mutexes and releases one, and wrong again when a task is boosted while already holding a mutex — and it subsumes what #55 fixes: recomputing on timeout is one of the cases it recomputes on, and it already rejects a full waiter table rather than blocking a task that was never enqueued. 4. #74's tests were merged without its parser change. Six assertions in test_config failed because a "- name:" item arriving while section was SEC_PKG_DEPS fell into the dependency branch, so the package after a deps list was swallowed as a dependency of the previous one. Restored the SEC_PKG_DEPS arm of the outer condition, nested the dependency handling as the else of the name check, and added the deps transition under SEC_PKG_BUILD. before cmake: configure fails after build clean, ctest 28/28 Also re-checked the package-overflow guard that arrived via #61/#65, since it landed in a different shape than #78 proposed: AddressSanitizer is clean on a 129-package config that previously overflowed, and the 129th entry is refused with a message rather than silently dropped. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
|
||
| memset(&g_tasks[slot], 0, sizeof(eos_task_t)); | ||
| g_tasks[slot].id = (uint8_t)slot; | ||
| g_tasks[slot].name = name; |
eos does not build for the target it exists to build for. From a clean
checkout of master, with the toolchain the CI job installs:
$ cmake -B barm -DCMAKE_TOOLCHAIN_FILE=toolchains/arm-cortex-m4.cmake
$ cmake --build barm
core/src/log.c:113:9: error: implicit declaration of function 'clock_gettime'
core/src/log.c:113:23: error: 'CLOCK_MONOTONIC' undeclared
get_timestamp_ms() had two branches, _WIN32 and "else, assume POSIX". Bare-
metal newlib is neither: arm-none-eabi declares neither clock_gettime nor
CLOCK_MONOTONIC, so the POSIX branch cannot compile for any Cortex-M target.
The macro is the precise test — where it is absent, so is the function.
There is a timebase on a target, eos_get_tick_ms() in the HAL, but core/ sits
below hal/ and must not depend upward, so log entries carry a zero timestamp
on a freestanding build until a port supplies one. Ordering within the ring
buffer is unaffected; only absolute time is missing.
Also fixed the format specifier one line down. uint32_t is `unsigned int` on
x86-64 and `unsigned long` on 32-bit ARM, so the literal %u was wrong on
exactly the target this build is for. It is PRIu32 now, which is right on
both.
Why CI did not catch it. The ARM job points CMAKE_TOOLCHAIN_FILE at
cmake/arm-cortex-m4.cmake; the file is at toolchains/. That fails loudly --
"Could not find toolchain file" -- so the job has been red rather than
silently passing, but it dies at configure and never reaches the compile step
where this bug lives.
The path is not new breakage: #75 fixed it, #79 and #51 carried the fix, and
#59 reverted it. That is the same stale-base merge pattern as the other three
repairs on this branch.
before ARM: configure fails on a missing toolchain file; with the real
path, 2 compile errors in core/src/log.c
after ARM: 70/70 targets built, artifacts report `architecture:
armv7e-m`; host: 28/28 ctest, unchanged
Kernel and services together measure 15.8 KB flash and 26 KB RAM on
Cortex-M4, which is the first real footprint number this repo has produced.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Verified merge order for all nine open eos PRsNothing has merged and
Final state of the full stack: 0 build errors, The two conflicts, and their resolutionsBoth are in #83 (GPS) — the branch predates #84 (stub-crypto signing) — its new Keep the Why the order matters#88, #89 and #90 were branched from a tree with #82 and #86 already applied, so they carry those changes. Merging them before #82 would work but makes the diffs harder to read. #83 and #84 go last only because putting the two conflicts at the end keeps the first seven merges mechanical. Anything merged out of this order still lands — the sequence is what I verified, not the only one that exists. |
|
Filed #92 to track the underlying defect. Re-verified the breakage today from a Still red, so this PR is still the gate. Every other open PR here is stacked One thing #92 records that this PR deliberately does not fix, so it does not get
Repairing the four breakages here does not stop the next overlapping pair from This is |
Deduplicating test_crypto_aes and test_crypto_sha512 left the grouped
comment that had been sitting above the block:
# --- test_crypto_aes / _ecc / _rsa / _sha512: were sitting in tests/ unused ---
That records how the files got here, which stops being interesting the
moment they are wired up. #93 fixes the same two duplicates and keeps the
per-test descriptions instead:
# --- test_crypto_aes: AES-128/192/256 ECB + CBC, NIST FIPS-197 / SP 800-38A ---
# --- test_crypto_ecc: ECC point arithmetic and ECDSA ---
# --- test_crypto_rsa: RSA modular exponentiation and verify ---
# --- test_crypto_sha512: SHA-512 against NIST vectors ---
Naming the standard each vector set comes from is worth more to the next
reader than a note about the file's history. Adopting that here so the
better wording survives the conflict between the two PRs.
Comment-only; no target, source or link line changes.
28/28 tests passed, 0 build errors
Co-authored-by: prakhar7017 <prakhar7017@users.noreply.github.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
#94 repairs the same spliced priority-inheritance code as this PR, and converged on the same design independently — g_blocked_on, task_valid, pi_recompute, pi_propagate, recomputing from the invariant rather than saving and restoring a value around each lock. The two implementations of sync.c differ by nothing except these two comments, which explain the consequence rather than only the action: "...it would sleep forever." -> "...it would sleep forever. Refusing also avoids boosting the owner on behalf of a caller that never waits." "Timeout — leave the queue and drop the boost we were causing." -> "...so a waiter that gave up no longer keeps the owner running elevated." Both name the priority-inheritance effect of the branch, which is the part a reader is likely to get wrong when editing it later. Comment-only; sync.c is otherwise byte-identical to #94's. 28/28 tests passed, 0 build errors Co-authored-by: prakhar7017 <prakhar7017@users.noreply.github.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
P0.
masterdoes not configure; once it does it does not build; once it builds one suite fails.Every break has the same cause: a PR verified green on its own branch, squash-merged onto a base that had moved, and nothing re-verified the result. eBoot#58 diagnosed the identical pattern there.
1. CMake will not configure
#59 added registrations for
test_crypto_aesandtest_crypto_sha512beside a block that already had them. Git merged it cleanly — this is not a textual conflict, which is why it was not caught. I flagged this exact hunk on #59 before it merged.2.
eos_task_set_current_internaldefined twiceTwo implementations with different behaviour — one clears
g_currentand marks the task RUNNING, the other silently returns. Kept the first: it is what the header documents ("Handles >= EOS_MAX_TASKS clear it") and what the mutex tests rely on. The second declaration's comment is folded into the survivor, since it records why the function exists at all.3.
sync.cdoes not compile — two PI designs spliced togetherg_blocked_on,pi_propagateandtask_validare used and defined nowhere;original_priois not a member ofmtx_t.#67 and #55 implement incompatible designs for the same feature. #67 recomputes effective priority from
on every change; #55 saves and restores a value around each lock. Merging #55 after #67 deleted #67's implementation while leaving its call sites, so neither design survived intact.
Restored #67's. Save/restore is wrong when a task holds two mutexes and releases one, and wrong again when a task is boosted while already holding a mutex. It also subsumes #55: recomputing on timeout is one of the cases it recomputes on, and it already rejects a full waiter table rather than blocking a task that was never enqueued.
4. #74's tests merged without #74's parser change
Six assertions failed because a
- name:item arriving whilesection == SEC_PKG_DEPSfell into the dependency branch, so the package after adeps:list was swallowed as a dependency of the previous one.Verification
cmakectestAlso re-checked the package-overflow guard that arrived via #61/#65, since it landed in a different shape than #78 proposed: AddressSanitizer is clean on the 129-package config that previously overflowed, and the 129th entry is refused with a message rather than silently dropped.
🤖 Generated with Claude Code
Update — eos does not cross-compile for Cortex-M4
Pushed a second commit. With the ARM toolchain now available on my machine I built for the target this project exists to build for, and it fails:
get_timestamp_ms()had two branches —_WIN32, and "else, assume POSIX". Bare-metal newlib is neither.arm-none-eabideclares neitherclock_gettimenorCLOCK_MONOTONIC, so the POSIX branch cannot compile for any Cortex-M target.Also fixed one line down:
uint32_tisunsigned inton x86-64 andunsigned longon 32-bit ARM, so the literal%uwas wrong on exactly the target this build is for.PRIu32is right on both.Why CI did not catch it
The ARM job points
CMAKE_TOOLCHAIN_FILEatcmake/arm-cortex-m4.cmake; the file is attoolchains/. That fails loudly — "Could not find toolchain file" — so the job has been red, not silently passing. But it dies at configure and never reaches the compile step where this bug lives.The path is not new breakage: #75 fixed it, #79 and #51 carried the fix, and #59 reverted it — the same stale-base pattern as the other three repairs here.
Result
core/src/log.carmv7e-mctestKernel and services together measure 15.8 KB flash, 26 KB RAM on Cortex-M4 — the first real footprint number this repo has produced.