Commit 974df53
fix(sea): silence benign LIEF warnings during postject injection (#265)
* fix(sea): silence benign LIEF warnings during postject injection
LIEF (inside postject) prints "signature seems corrupted" and
"Can't find string offset for section name '.note.100'" to stderr
after postject expands the ELF section table to make room for
NODE_SEA_BLOB. The messages are cosmetic — the injection succeeds
and macOS binaries are re-signed afterwards — but users reasonably
assume something is wrong.
Wrap the postject.inject() call in a tiny stderr filter that drops
only those specific lines. Everything else passes through
unchanged, and the original process.stderr.write is restored in a
finally block.
* refactor(sea): tighten typing of postject stderr filter
Replace `unknown` + `...rest: unknown[]` (which forced two `as` casts
and a runtime `rest.find` to locate the callback) with the actual
write() overload parameters: `chunk: string | Uint8Array`,
`encodingOrCb?: BufferEncoding | WriteCallback`, `cb?: WriteCallback`.
Disambiguate the pass-through call so the right write() overload is
dispatched, and handle plain Uint8Array chunks explicitly.
Whitelist `BufferEncoding` as a global in the TS ESLint block,
mirroring how `NodeJS` is already handled — both are type-only
identifiers that `no-undef` can't resolve on its own.
* fix(sea): restore original stderr.write reference, not a bound wrapper
Keep the unbound write function for restoration so process.stderr.write
regains its exact prior identity after the call. Use a separate bound
copy internally for calling from the filter.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>1 parent a8e91df commit 974df53
2 files changed
Lines changed: 69 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
65 | 126 | | |
66 | 127 | | |
67 | 128 | | |
| |||
398 | 459 | | |
399 | 460 | | |
400 | 461 | | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
406 | 469 | | |
407 | 470 | | |
408 | 471 | | |
| |||
0 commit comments