Skip to content

Comments

Cross compile macos#1012

Merged
hulto merged 13 commits intomainfrom
cross-compile-macos
Nov 17, 2025
Merged

Cross compile macos#1012
hulto merged 13 commits intomainfrom
cross-compile-macos

Conversation

@hulto
Copy link
Collaborator

@hulto hulto commented Nov 16, 2025

What type of PR is this?

/kind feature

What this PR does / why we need it:

  • Adds support to cross compile Imix to MacOS from the devcontainer
  • Updates get_ip dependency to something more stable

Which issue(s) this PR fixes:

}
{
"name": "lo0",
"ip": "127.0.0.1"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the lack of cidr/mac a regression?

@hulto hulto force-pushed the cross-compile-macos branch from 134cd26 to 90d6dd4 Compare November 16, 2025 21:09
@hulto
Copy link
Collaborator Author

hulto commented Nov 17, 2025

@claude How's this?

@claude
Copy link

claude bot commented Nov 17, 2025

Claude finished @hulto's task —— View job


PR Review

  • Read repository guidelines (CLAUDE.md)
  • Examine PR changes and diff
  • Review code changes
  • Address review comment about cidr/mac regression
  • Provide comprehensive feedback

Summary

This PR successfully adds cross-compilation support for MacOS from the devcontainer and simplifies the network interface handling. However, there are critical issues that need to be addressed before merging.

Critical Issues

1. build.rs has compilation errors 🔴

implants/build.rs:15 references undefined variables:

println!("cargo:rustc-cfg=host_os=\"{}\"", HOST_FAMILY);

Should be HOST_OS (defined on lines 2-11), not HOST_FAMILY. Also missing the anyhow::Result import:

use anyhow::Result;

fn main() -> Result<()> {
    println!("cargo:rustc-cfg=host_os=\"{}\"", HOST_OS);  // Fix: HOST_OS not HOST_FAMILY
    Ok(())
}

2. Answering @Cictrone's review question about cidr/mac regression ⚠️

Yes, this is a regression - the PR removes important functionality:

Before (network-interface crate):

  • ✅ CIDR notation (e.g., 172.17.0.2/24)
  • ✅ MAC addresses (e.g., 02:42:ac:11:00:02)
  • ✅ Multiple IPs per interface in single entry
  • Return format: { name, ips: [], mac }

After (local-ip-address crate):

  • ❌ No CIDR notation (just 10.0.124.42)
  • ❌ No MAC addresses
  • ❌ Separate entries per IP address on same interface
  • Return format: { name, ip }

Impact:

  • The arp_scan tome was deleted (tavern/tomes/arp_scan/) - possibly because MAC addresses are no longer available
  • Breaking API change for any code/scripts relying on sys.get_ip() structure
  • Loss of network mask information useful for subnet calculations

Documentation & DevContainer

Positives ✅

  1. Excellent documentation in docs/_docs/user-guide/imix.md with clear MacOS cross-compilation setup instructions
  2. Well-structured devcontainer setup with Zig for cross-compilation
  3. Proper SDK mounting instructions for Rancher desktop limitations
  4. Updated return format examples in docs/_docs/user-guide/eldritch.md:908

Code Quality

get_ip_impl.rs changes

Positives:

  • ✅ Significantly simpler (83 fewer lines)
  • ✅ Removed complex netmask-to-CIDR conversion logic
  • ✅ Test updated appropriately

Concerns:

  • ⚠️ Error handling degraded: .unwrap() on line 22 will panic instead of returning Result
  • ⚠️ Loss of functionality may impact operational use cases

Dependency change

  • network-interfacelocal-ip-address: Simpler but more limited functionality
  • May be "more stable" as mentioned in PR description, but trades features for stability

Recommendations

  1. Fix build.rs immediately - won't compile as-is
  2. Consider the breaking change implications:
    • Is the loss of CIDR/MAC info acceptable for your use cases?
    • Should this be a major version bump?
    • Are there other tomes/scripts using the old format?
  3. Improve error handling: Replace .unwrap() in get_ip_impl.rs:22 with proper error handling
  4. Consider: If MAC addresses and CIDR are needed, might need to keep network-interface or find alternative

Questions for PR Author

  1. Was the removal of CIDR/MAC intentional to support MacOS cross-compilation, or a side effect of the library change?
  2. Are there known use cases that depend on MAC addresses or CIDR notation?
  3. Has this been tested with actual MacOS cross-compilation in the devcontainer?

Copy link
Collaborator

@Cictrone Cictrone left a comment

Choose a reason for hiding this comment

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

sus as hell

@hulto hulto merged commit 697c308 into main Nov 17, 2025
8 of 9 checks passed
@hulto hulto deleted the cross-compile-macos branch November 17, 2025 03:37
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