Skip to content

Upgrade Core to 120af1f2c2992fca1d193aada8441a6717c62193#680

Merged
jviotti merged 1 commit intomainfrom
one-new
Feb 26, 2026
Merged

Upgrade Core to 120af1f2c2992fca1d193aada8441a6717c62193#680
jviotti merged 1 commit intomainfrom
one-new

Conversation

@jviotti
Copy link
Member

@jviotti jviotti commented Feb 26, 2026

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 11 files

@augmentcode
Copy link

augmentcode bot commented Feb 26, 2026

🤖 Augment PR Summary

Summary: Updates the vendored sourcemeta/core dependency to commit 120af1f2…, bringing in new I/O utilities and improved process-spawn error reporting.

Changes:

  • Bumped the core entry in DEPENDENCIES to the new upstream SHA
  • Added TemporaryDirectory (RAII temp dir creation/cleanup) and wired it into the I/O library build
  • Introduced directory helpers: hardlink_directory (mirror via hard links) and atomic_directory_replace (swap/replace directories)
  • Improved spawn() error classification to distinguish “program not found” from other spawn failures
  • Renamed ProcessProgramNotNotFoundError to ProcessProgramNotFoundError
  • Minor documentation/example fixes in jsonpointer/jsonschema/uri headers

Technical Notes: atomic_directory_replace uses platform-specific atomic swap syscalls on Linux/macOS and a temporary-directory rollback strategy elsewhere; the new APIs are exported via sourcemeta/core/io.h.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.


// Atomic swap via renameat2 with RENAME_EXCHANGE
#if defined(__linux__)
if (renameat2(AT_FDCWD, replacement.c_str(), AT_FDCWD, original.c_str(),
Copy link

Choose a reason for hiding this comment

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

On Linux/macOS, a failure of renameat2(..., RENAME_EXCHANGE) / renameatx_np(..., RENAME_SWAP) throws immediately, even for ENOSYS/EINVAL cases where an atomic swap isn’t available but a non-atomic replace could still work. This seems to conflict with the “atomic swap when possible” contract.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

try {
std::filesystem::rename(replacement, original);
} catch (...) {
std::filesystem::rename(backup.path(), original);
Copy link

Choose a reason for hiding this comment

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

If std::filesystem::rename(backup.path(), original) throws during rollback, backup’s destructor will still remove_all the backup directory, potentially deleting the last remaining copy of original. Consider guarding cleanup so rollback failures don’t turn into data loss.

Severity: high

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@jviotti jviotti merged commit ac34434 into main Feb 26, 2026
6 checks passed
@jviotti jviotti deleted the one-new branch February 26, 2026 19:13
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.

1 participant