Conversation
This wasn't intended anyway. Adding them to the global scope breaks Nixpkgs.
📝 WalkthroughWalkthroughRenames two WASM primitive registration identifiers ( Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/libexpr/primops/wasm.cc (1)
571-578:⚠️ Potential issue | 🟡 MinorAlign user-facing error text with the new builtin name.
The error string in
prim_wasmstill saysbuiltins.wasm, which will be misleading after this rename. Update it tobuiltins.__wasmfor consistency (Line 547).🛠️ Proposed fix
- std::string(state.forceStringNoCtx(*args[1], pos, "while evaluating the second argument of `builtins.wasm`")); + std::string(state.forceStringNoCtx(*args[1], pos, "while evaluating the second argument of `builtins.__wasm`"));🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/libexpr/primops/wasm.cc` around lines 571 - 578, The user-facing error message inside the prim_wasm implementation still references "builtins.wasm"; update that error text to "builtins.__wasm" to match the renamed builtin declared in the RegisterPrimOp (named "__wasm") so runtime errors report the correct builtin name; locate prim_wasm in the same file (src/libexpr/primops/wasm.cc) and change the error string literal accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/libexpr/primops/wasm.cc`:
- Around line 571-578: The user-facing error message inside the prim_wasm
implementation still references "builtins.wasm"; update that error text to
"builtins.__wasm" to match the renamed builtin declared in the RegisterPrimOp
(named "__wasm") so runtime errors report the correct builtin name; locate
prim_wasm in the same file (src/libexpr/primops/wasm.cc) and change the error
string literal accordingly.
Fixes error: 'https://cdn.skypack.dev/big.js@^5.2.2' is not a valid URL: leftover in flake-regressions.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/libfetchers/provenance.cc (1)
37-41: Consider adebug-level log in theBadURLfallback path.The silent
catch (BadURL &)is intentional, but it makes it impossible to tell at runtime whether provenance stored a sanitized URL or a verbatim fallback. Adebug(...)message (e.g.,debug("FetchurlProvenance: could not sanitize URL '%s', storing verbatim", url)) inside the catch block would improve observability with no behavioral impact.♻️ Suggested debug log in catch block
if (sanitize) { try { url = parseURL(url, true).renderSanitized(); } catch (BadURL &) { + debug("FetchurlProvenance: URL '%s' could not be sanitized, storing verbatim", url); } }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/libfetchers/provenance.cc` around lines 37 - 41, The silent catch of BadURL in provenance.cc hides whether parseURL(url, true).renderSanitized() failed; add a debug log inside the catch to record the failure and the original URL for observability. Modify the catch (BadURL &) block next to parseURL and renderSanitized to call the project logger's debug (e.g., debug("FetchurlProvenance: could not sanitize URL '%s', storing verbatim", url)) or the equivalent debug logging function used in this file; do not change behavior or rethrow, only emit the debug message.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/libfetchers/provenance.cc`:
- Around line 37-41: The silent catch of BadURL in provenance.cc hides whether
parseURL(url, true).renderSanitized() failed; add a debug log inside the catch
to record the failure and the original URL for observability. Modify the catch
(BadURL &) block next to parseURL and renderSanitized to call the project
logger's debug (e.g., debug("FetchurlProvenance: could not sanitize URL '%s',
storing verbatim", url)) or the equivalent debug logging function used in this
file; do not change behavior or rethrow, only emit the debug message.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/libfetchers/include/nix/fetchers/provenance.hhsrc/libfetchers/provenance.ccsrc/libfetchers/tarball.ccsrc/nix/prefetch.cc
Motivation
This wasn't intended anyway. Adding them to the global scope breaks Nixpkgs.
Context
Summary by CodeRabbit