Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Build issues caused by importing swift-rs #224

Closed
wants to merge 1 commit into from

Conversation

XMLHexagram
Copy link
Collaborator

@XMLHexagram XMLHexagram commented Jan 4, 2025

Summary by Sourcery

Build:

  • Remove swift-rs from general dependencies and add it as a dependency for macOS targets.

Copy link

sourcery-ai bot commented Jan 4, 2025

Reviewer's Guide by Sourcery

This pull request resolves build issues stemming from the incorrect inclusion of the swift-rs dependency. The fix involves removing swift-rs from the general dependencies and build dependencies in Cargo.toml, and instead adding it as a platform-specific dependency for macOS. This ensures that the dependency is only included when building for macOS, resolving the build conflicts on other platforms.

Entity Relationship Diagram for Cargo.toml Dependency Changes

erDiagram
    CARGO_TOML {
        string tracing_appender
        string chrono
        string windows
        string sha2
        string anyhow
        string vergen_git2
        string tokio_with_wasm
        string tracing_logcat
    }
    CARGO_TOML ||--o{ MACOS_DEPENDENCIES : "has"
    MACOS_DEPENDENCIES {
        string swift_rs
    }
    CARGO_TOML ||--o{ MACOS_BUILD_DEPENDENCIES : "has"
    MACOS_BUILD_DEPENDENCIES {
        string swift_rs
    }
Loading

File-Level Changes

Change Details Files
Removed swift-rs from general dependencies and build dependencies.
  • Removed swift-rs = \"1.0.7\" from dependencies.
  • Removed swift-rs from build dependencies.
native/hub/Cargo.toml
Added swift-rs as a macOS-specific dependency.
  • Added swift-rs = \"1.0.7\" to [target.'cfg(target_os = \"macos\")'.dependencies].
  • Added swift-rs to [target.'cfg(target_os = \"macos\")'.build-dependencies].
native/hub/Cargo.toml
Conditionally compile Swift linker code for macOS.
  • Added #[cfg(target_os = \"macos\")] to conditionally compile the Swift linker code.
native/hub/build.rs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@dosubot dosubot bot added the C - dependencies Pull requests that update a dependency file label Jan 4, 2025
Copy link

@sourcery-ai sourcery-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.

Hey @XMLHexagram - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Ensure that the removal of 'swift-rs' from general dependencies does not affect the build process on non-macOS platforms.
  • Consider adding a newline at the end of the file for consistent formatting.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Owner

@Losses Losses left a comment

Choose a reason for hiding this comment

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

Ditto.


# Uncomment below to target the web.
# tokio_with_wasm = { version = "0.6.0", features = ["sync", "rt"] }
# wasm-bindgen = "0.2.92"

# Android dependencies
[target.'cfg(target_os = "android")'.dependencies]
tracing-logcat = "0.1.0"
Copy link
Owner

Choose a reason for hiding this comment

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

EOF is removed, please recover the last empty line to ensure consistency.

@XMLHexagram
Copy link
Collaborator Author

Closed: ref #221 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C - dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants