Skip to content

Commit

Permalink
Rebase to 4.8.2 without patches (#17)
Browse files Browse the repository at this point in the history
Just rebasing this to 4.8.2 so that #16 has a cleaner looking merge.
This undoes all of the changes we had, but since we rebased, it has
different commit hashes. See tags/upstream-4.8.2 for the upstream
commit.

---------

Signed-off-by: Matt Robinson <[email protected]>
Co-authored-by: Matt Robinson <[email protected]>
Co-authored-by: Cong Shi <[email protected]>
Co-authored-by: Jerry Marino <[email protected]>
Co-authored-by: Derek Ostrander (derko) <[email protected]>
Co-authored-by: Luis Padron <[email protected]>
Co-authored-by: Justin Martin <[email protected]>
Co-authored-by: mccorkill1 <[email protected]>
Co-authored-by: Thiago Cruz <[email protected]>
Co-authored-by: Matt Robinson <[email protected]>
Co-authored-by: Qing Yang <[email protected]>
Co-authored-by: Qing Yang <[email protected]>
Co-authored-by: Steven Hepting <[email protected]>
Co-authored-by: John Szumski <[email protected]>
Co-authored-by: Su Xiaofeng <[email protected]>
Co-authored-by: Angela Guardia <[email protected]>
Co-authored-by: John Szumski <[email protected]>
Co-authored-by: Karim Alweheshy <[email protected]>
Co-authored-by: Karim Alweheshy <[email protected]>
Co-authored-by: Cody Vandermyn <[email protected]>
Co-authored-by: Cody Vandermyn <[email protected]>
Co-authored-by: tymurmustafaiev <[email protected]>
Co-authored-by: Timur Mustafaev <[email protected]>
  • Loading branch information
23 people authored Aug 13, 2024
1 parent 2e4ed21 commit 4e09120
Show file tree
Hide file tree
Showing 465 changed files with 14,226 additions and 8,330 deletions.
82 changes: 65 additions & 17 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# We can't create a bzl_library for rules-swift because of its visibility,
# so circumvent by not using the sandbox
build --strategy=Stardoc=standalone
# Enable Bzlmod
common --enable_bzlmod

# Debugging does not work in sandbox mode. Uncomment these lines to turn off sandboxing.
# build --genrule_strategy=standalone
# build --spawn_strategy=standalone
# Spawn strategy required for some tests
build --spawn_strategy=standalone

# Setup Xcode configuration for xcodeproj tests
build --xcode_version_config=//:host_xcodes

build --experimental_strict_conflict_checks

build --verbose_failures # Print the full command line for commands that failed
build --test_output=errors # Prints log file output to the console on failure

# By default do not build the tests for sources-with-prebuilt-binaries,
# because it takes quite some time. They will only run on CI
build --deleted_packages tests/ios/frameworks/sources-with-prebuilt-binaries

# Enable dbg compilation mode in this repo, so we can test xcodeproj-built
# binaries contain debug symbol tables.
build --compilation_mode=dbg
Expand All @@ -28,18 +27,67 @@ build --features swift.index_while_building
# Prevents leaking unexpected binaries via PATH to tests
build --test_env=PATH=/usr/bin:/bin:/usr/sbin:/sbin

# Enable device deps when the build matches the arm64 simulator
# Bazel 5 - matches ios_sim_arm64 CPU, Bazel 4 - needs "override" flags
build --features apple.arm64_simulator_use_device_deps

# Note - tree artifacts needs to be on
build:lldb_ios_test --spawn_strategy=standalone --apple_platform_type=ios --define=apple.experimental.tree_artifact_outputs=1

# Delete the VM test suite for github
build --deleted_packages tests/ios/vmd

# Allow for server to start (GitHub actions can timeout)
startup --local_startup_timeout_secs=240

# - iOS Configuration
# Required for tests/ios/... targets
build:ios --apple_platform_type=ios

# - VFS configuration
# Required for some tests in tests/ios/... targets
build:vfs --features=apple.virtualize_frameworks

# - iOS lldb test configuration
build:ios_lldb_test --config=ios
build:ios_lldb_test --define=apple.experimental.tree_artifact_outputs=1

# - iOS multi arch test configuration
build:ios_multi_arch_test --config=ios
build:ios_multi_arch_test --ios_minimum_os=10.2
# i386 was removed on rules_apple 3.x.x - this test case needs reworking
# to exemplify fat binaries on the latest version
build:ios_multi_arch_test --ios_multi_cpus=x86_64

build:remote_cache --bes_backend=grpcs://remote.buildbuddy.io
build:remote_cache --bes_results_url=https://app.buildbuddy.io/invocation/
build:remote_cache --experimental_build_event_upload_strategy=local
build:remote_cache --experimental_remote_cache_compression
build:remote_cache --experimental_remote_merkle_tree_cache
build:remote_cache --modify_execution_info=^(BitcodeSymbolsCopy|BundleApp|BundleTreeApp|DsymDwarf|DsymLipo|GenerateAppleSymbolsFile|ObjcBinarySymbolStrip|CppLink|ObjcLink|ProcessAndSign|SignBinary|SwiftArchive|SwiftStdlibCopy)$=+no-remote,^(BundleResources|ImportedDynamicFrameworkProcessor)$=+no-remote-exec
build:remote_cache --nolegacy_important_outputs
build:remote_cache --noslim_profile
build:remote_cache --remote_cache=grpcs://remote.buildbuddy.io
build:remote_cache --remote_timeout=3600

# By default don't upload local results to remote cache, only CI does this.
build --noremote_upload_local_results
build:ci --remote_upload_local_results

# - CI Configuration
# announce config values
common:ci --announce_rc
# enable remote cache
build:ci --config=remote_cache
# disable curses control since CI logs are not interactive
common:ci --curses=no
# turn off loading message updates
common:ci --noshow_loading_progress
# throttle progress updates in CI as they can clutter the logs
common:ci --show_progress_rate_limit=15.0
build:ci --progress_report_interval=60
# enable more verbose logging
build:ci --verbose_failures
# ci setup for tests, tend to be more flaky on github actions
build:ci --jobs=4
# allow extra time for simulators to boot
test:ci --test_env=STARTUP_TIMEOUT_SEC=350
test:ci --test_timeout=1000
test:ci --local_test_jobs=1
test:ci --flaky_test_attempts=3

# Load a user.bazelrc
try-import %workspace%/user.bazelrc
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.0.0
7.1.0
19 changes: 19 additions & 0 deletions .bcr/metadata.template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"homepage": "https://github.com/bazel-ios/rules_ios",
"maintainers": [
{
"email": "[email protected]",
"name": "rules_ios Maintainers"
},
{
"email": "[email protected]",
"github": "luispadron",
"name": "Luis Padron"
}
],
"repository": [
"github:bazel-ios/rules_ios"
],
"versions": [],
"yanked_versions": {}
}
17 changes: 17 additions & 0 deletions .bcr/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
matrix:
bazel: ["6.x", "7.x"]
tasks:
verify_build_targets_bazel_6:
name: Verify Build targets on macOS with Bazel 6
platform: macos_arm64
bazel: 6.x
build_targets:
- "@rules_ios//rules/..."
verify_build_targets_bazel_7:
name: Verify Build targets on macOS with Bazel 7
platform: macos_arm64
bazel: 7.x
build_targets:
- "@rules_ios//rules/..."
build_flags:
- "--repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1"
5 changes: 5 additions & 0 deletions .bcr/source.template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"integrity": "",
"strip_prefix": "",
"url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/{REPO}.{TAG}.tar.gz"
}
49 changes: 49 additions & 0 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Create Release

on:
workflow_dispatch:
inputs:
tag:
description: 'The new version to tag, ex: x.x.x'
required: true
type: string

jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create Release
run: |
set -euo pipefail
git config user.name "Release Workflow"
git config user.email "[email protected]"
# Archive the repository
# Considerations:
# - Dont package development files (vscode config, etc)
# - Dont package the bazel-* symlink directories
# - Dont package most of the tests directory
COPYFILE_DISABLE=1 tar czvf "rules_ios.$TAG.tar.gz" \
--exclude="./.vscode" \
--exclude="./bazel-*" \
--exclude="./tests/framework" \
--exclude="./tests/ios" \
--exclude="./tests/macos" \
./*
# Create the release notes
./.github/workflows/generate_release_notes.sh "$TAG" | tee notes.md
# Create the release
gh release create "$TAG" \
--title "$TAG" \
--target "$GITHUB_REF_NAME" \
--generate-notes \
--notes-file notes.md \
"rules_ios.$TAG.tar.gz"
env:
TAG: ${{ inputs.tag }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69 changes: 69 additions & 0 deletions .github/workflows/generate_release_notes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/bin/bash

set -exuo pipefail

# This script generates release notes for a release.
# It uses the new tag and archive to generate a workspace snippet.
# It is primarily used by the `create_release.yml` workflow.
# Args:
# - The first argument is the new version number.

readonly new_version=$1
readonly release_archive="rules_ios.$new_version.tar.gz"

sha=$(shasum -a 256 "$release_archive" | cut -d " " -f1)

cat <<EOF
### Bzlmod Snippet
\`\`\`bzl
bazel_dep(name = "rules_ios", version = "$new_version", repo_name = "build_bazel_rules_ios")
\`\`\`
### Workspace Snippet
\`\`\`bzl
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "build_bazel_rules_ios",
sha256 = "$sha",
url = "https://github.com/bazel-ios/rules_ios/releases/download/$new_version/rules_ios.$new_version.tar.gz",
)
load(
"@build_bazel_rules_ios//rules:repositories.bzl",
"rules_ios_dependencies"
)
rules_ios_dependencies()
load(
"@build_bazel_rules_apple//apple:repositories.bzl",
"apple_rules_dependencies",
)
apple_rules_dependencies()
load(
"@build_bazel_rules_swift//swift:repositories.bzl",
"swift_rules_dependencies",
)
swift_rules_dependencies()
load(
"@build_bazel_apple_support//lib:repositories.bzl",
"apple_support_dependencies",
)
apple_support_dependencies()
load(
"@com_google_protobuf//:protobuf_deps.bzl",
"protobuf_deps",
)
protobuf_deps()
\`\`\`
EOF
27 changes: 27 additions & 0 deletions .github/workflows/preflight_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

set -e

# Sets up the CI environment.
#
# Required environment variables:
# - XCODE_VERSION: The version of Xcode to use.

# GitHub runners are hitting 'module not found pkg_resources' required by prepare_sim.py
pip3 install setuptools==69.5.1 --break-system-packages

# If flag --no-bzlmod is passed, writes a user.bazelrc file to disable Bzlmod.
if [[ "$*" == *--no-bzlmod* ]]; then
echo "build --noenable_bzlmod" >> user.bazelrc
fi

# Add the ci config override.
echo "common --config=ci" >> user.bazelrc

echo "Selecting Xcode for environment"
echo "Xcode before: $(xcode-select -p)"
sudo xcode-select -s "/Applications/Xcode_$XCODE_VERSION.app"
echo "Xcode after: $(xcode-select -p)"

echo "Running with environment:"
printenv
Loading

0 comments on commit 4e09120

Please sign in to comment.