Skip to content

Conversation

iMostfa
Copy link

@iMostfa iMostfa commented Aug 28, 2025

This PR Adds initial support for Bazel 8
tests appears to be passing, but i need some expertise as most of my changes were just fixing errors, and trusting LLMs 😂

This commit adds full support for Bazel 8 while maintaining backward
compatibility with Bazel 7.

Changes:
- Fix ObjcInfo provider compatibility: Add hasattr checks for fields
removed in Bazel 8 (force_load_library, imported_library, library,
static_framework_file, etc.)
- Handle AppleDynamicFramework provider removal: Add conditional checks
and fallbacks for the removed provider
- Update MODULE.bazel dependencies to Bazel 8-compatible versions:
  - apple_support: 1.15.1 → 1.21.1
  - rules_cc: 0.0.10 → 0.0.16
  - bazel_skylib: 1.4.2 → 1.7.1
  - rules_pkg: 0.9.1 → 1.0.1
  - stardoc: 0.6.2 → 0.7.2
- Add bazel_version.bzl utility for runtime version detection
- Update CI to test with both Bazel 7.1.0 and 8.0.0
- Add Bazel 8 migration guide to README
- Add compatibility test script

Fixes compatibility issues when using rules_ios with Bazel 8.0.0

Cleanup
@iMostfa iMostfa force-pushed the feature/bazel8 branch 3 times, most recently from 23bec13 to 5aca660 Compare August 28, 2025 23:38
This commit addresses linking problems that arose with Bazel 8 where
transitive Swift and ObjC dependencies were not being properly linked.

Changes:
- objc_provider_utils.bzl: Return struct instead of None for dynamic
  frameworks in Bazel 8 to maintain framework information
- framework_middleman.bzl:
  - Add SwiftInfo collection and propagation
  - Collect libraries from ObjcInfo and add to CcInfo linking context
  - Handle .lo files (from alwayslink libraries) properly
  - Remove unsupported dynamic_framework_file from ObjcInfo in Bazel 8
  - Add toolchains to dep_middleman rule
- framework.bzl: Re-add .lo file collection (critical for alwayslink)

These changes ensure all transitive dependencies are properly included
in the linking phase, fixing "undefined symbols" errors.
@iMostfa iMostfa marked this pull request as ready for review August 28, 2025 23:50
@iMostfa
Copy link
Author

iMostfa commented Aug 28, 2025

@jschear Would appreciate your support here.

Copy link

@AndreParenteNeon AndreParenteNeon left a comment

Choose a reason for hiding this comment

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

seems nice!

@jschear
Copy link
Collaborator

jschear commented Sep 18, 2025

Hi @iMostfa, thanks for contributing -- I'll take a look tomorrow or early next week!

@iMostfa
Copy link
Author

iMostfa commented Sep 22, 2025

i discovered that tests discovery isn't working, trying to get what caused it

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.

3 participants