Skip to content

Conversation

rhuze-emryk
Copy link

Changes
Update iOS build instructions for Xcode 15 compatibility
Add comprehensive Linux development guide (bindings/ergo-lib-ios/LINUX_DEVELOPMENT.md)
Standardize toolchain requirements to nightly-2024-01-26
Improve cross-platform build instructions clarity
CI Requirements Checked
✅ Warnings as errors: No Rust code modified, but ensured all documentation commands follow project standards.
✅ cargo test:

Verified C bindings generation (cargo test -p ergo-lib-c).
Confirmed Swift build steps do not break existing tests.
✅ rustfmt:
No Rust code changes, but ensured code snippets in docs follow rustfmt conventions.
✅ clippy:
Checked existing codebase with cargo clippy post-doc updates (no new warnings).
Local Testing Done
C bindings generation on Linux (Fedora 40).
Header file generation process.
Linux build process (Swift bindings).
Needs Verification
⚠️ iOS/macOS build steps (requires Xcode 15 verification by collaborators).

Related Issues
Closes #759

verify where ergo_lib.h is generated

rhuze-removed note to kick off new build

ergo-lib.h check correction in the build.yml

Update workflow to trigger ios_tests & added GitHub CLI installation step

Fix: Use correct package name for GitHub CLI (gh)

Fix: Use correct workflow filename (ci.yml)

Fix: Trigger workflow using GitHub API-ugh

Trigger ios_tests workflow using GitHub API with correct ID

Fix: Pass GITHUB_TOKEN directly using command substitution

Fix: Use correct workflow ID (141976691)

Fix: Use Bearer token scheme for GITHUB_TOKEN

Trigger ci.yml with workflow_dispatch on rhuze-dev & Add workflow_dispatch trigger to ci.yml

Fix: Added correct damned workspace ID

Moved workflow_dispatch in ci.yml to test

Fix: Use environment variable for GITHUB_TOKEN

Fix: Target forked repo for workflow dispatch

Fix: Use correct cursed workflow ID for forked repo (141976691)

Added a comment to force a refresh

Attempt gh command

Simplify ci.yml to test workflow_dispatch

Attempt gh command

Set default repo for gh CLI and use workflow name

Set GH_TOKEN for GitHub CLI

Try triggering workflow using filename with gh CLI

Use full relative path to workflow file with gh CLI

Restore ci.yml to match upstream develop branch

Integrate ios_tests steps into build.yml

Link against SystemConfiguration.framework

Use -Xswiftc to link against SystemConfiguration.framework

Specify library path and architecture

Build standard library for aarch64-apple-ios

Add rust-src component to nightly toolchain

Fix: Build for aarch64-apple-darwin

Fix: Build for aarch64-apple-ios

Simplify build.yml and verify library path

Use stable Rust and verify build command

Fix: Correct target architecture and library path and contemplate buying cigarettes

Remove -Z build-std flag

Switch to nightly and set RUST_BACKTRACE

Check Rust Version

Add flag to build standard library

Try building with only stable

Add ~/.cargo/bin to PATH

Use Environment Files to add ~/.cargo/bin to PATH

Removed the target from the cargo build command

Add llvm-tools-preview to the Install Rust Toolchain step

docs: enhance Linux development documentation

- Add detailed toolbox setup instructions
- Include toolbox creation and entry steps
- Add repository cloning instructions
- Update troubleshooting with toolbox-specific information

feat: regenerate C bindings with updated toolchain

- Regenerate C bindings using cbindgen 0.28.0
- Use nightly-2024-01-26 toolchain
- Successfully verify binding generation
- Verify library builds correctly

Build verification:
- Generated header: h/ergo_lib.h size: 87503 bytes
- Static library builds successfully
- All required functions and types present in header

docs: comprehensive update to iOS bindings documentation

- Update iOS README with Xcode 15 build instructions
- Add detailed Linux development guide
- Document verified Linux build process
- Update toolchain requirements (nightly-2024-01-26)
- Add cross-references between documents
- Include troubleshooting section
- Note platform-specific limitations

Verified:
- Linux build process
- C bindings generation
- Header file generation

Needs verification:
- iOS-specific build steps
- Xcode 15 configuration
- macOS-specific paths

chore: remove leftover build.yml workflow

docs: update iOS bindings and add Linux development documentation

- Update iOS build instructions for Xcode 15 compatibility
- Add comprehensive Linux development guide (bindings/ergo-lib-ios/LINUX_DEVELOPMENT.md)
- Standardize toolchain requirements to nightly-2024-01-26
- Improve cross-platform build instructions clarity
- Verify C bindings generation on Linux (Fedora 40)

Closes ergoplatform#759
@coveralls
Copy link

Pull Request Test Coverage Report for Build 13536308501

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.08%) to 78.501%

Files with Coverage Reduction New Missed Lines %
ergotree-ir/src/mir/constant.rs 1 63.99%
ergotree-ir/src/mir/expr.rs 1 68.77%
Totals Coverage Status
Change from base Build 12991338470: 0.08%
Covered Lines: 11144
Relevant Lines: 14196

💛 - Coveralls

@sethdusek sethdusek self-requested a review March 26, 2025 00:30
@kushti kushti requested a review from Alesfatalis March 26, 2025 13:17
Copy link
Collaborator

@sethdusek sethdusek left a comment

Choose a reason for hiding this comment

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

Hi, thanks for the PR! Unfortunately, there are some problems:

  • This PR doesn't seem to be tested on MacOS which is unfortunate since the majority of Swift users are developing on Macs.
  • It's also not clear whether the instructions provided would actually work on newer versions of XCode. For example swift package generate-xcodeproj no longer works (deprecated), so xcodebuild steps after that wouldn't work either
  • The MacOS part lacks steps like setting up rust/cbindgen

Also please take a look at other review comments

@@ -1,84 +1,96 @@
```markdown
Copy link
Collaborator

Choose a reason for hiding this comment

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

This breaks formatting


## Limitations

- iOS/Swift components cannot be directly tested on Linux
Copy link
Collaborator

Choose a reason for hiding this comment

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

Swift tests can be run on Linux the same way as MacOS

cd bindings/ergo-lib-c
rustup override set nightly-2024-01-26
cbindgen --config cbindgen.toml --crate ergo-lib-c --output h/ergo_lib.h
rustup override set stable
Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably better to do rustup override unset

cargo build --release --all-features

# Generate C headers
rustup override set nightly
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should be nightly-2024-01-26 here


## Development Workflow

1. Make changes to Rust components
Copy link
Collaborator

Choose a reason for hiding this comment

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

This part seems redundant considering we have a CONTRIBUTING.md guide

```shell
cd bindings/ergo-lib-ios
swift package generate-xcodeproj
xcodebuild -project ./ErgoLib.xcodeproj -xcconfig ./Config/iPhoneOS.xcconfig -sdk iphoneos
```

Next navigate in Xcode to `Build Settings` as indicated by 1 and 2 in the picture below. Set the fields `Base SDK`, `Excluded Architecture` and `Supported Platforms` **exactly** as pictured by 3 and 4.
![image](xcode_ios_settings.png)
Copy link
Collaborator

Choose a reason for hiding this comment

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

The images were useful but (probably) needed updating to XCode 15

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.

Improve README
3 participants