Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: bazel-xcode/xchammer
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: bazel-ios/xchammer
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: rules-ios-xchammer
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.

Commits on Apr 22, 2022

  1. Copy the full SHA
    7acf277 View commit details

Commits on Apr 28, 2022

  1. Changes necessary to update tulsi (#2)

    * Changes necessary to update tulsi
    
    - outputbase
    - watchos param
    - fix local execution requirement ( rules_ios CI )
    jerrymarino authored Apr 28, 2022
    Copy the full SHA
    6a6cec6 View commit details

Commits on May 3, 2022

  1. Misc rules_ios generator fixes (#8)

    * Misc rules_ios generator fixes
    
    - pop std selection
    - improvements for filtering fused deps
    - disable XCHammerIncludes for few places
    
    * Don't add dependency on fused
    jerrymarino authored May 3, 2022
    Copy the full SHA
    12583c4 View commit details
  2. Patch framework headers into DerivedData (#7)

    Ensures that the frameworks match Bazel
    jerrymarino authored May 3, 2022
    Copy the full SHA
    935b9cf View commit details
  3. Copy the full SHA
    fc1cbc1 View commit details
  4. Remove tulsi aspect sub repository (#5)

    This caused issues back in the day but is now unneeded
    jerrymarino authored May 3, 2022
    Copy the full SHA
    4af612c View commit details
  5. Misc M1 fixes (#4)

    python3 in swiftc stub, bazel 5, fix bazelrc
    jerrymarino authored May 3, 2022
    Copy the full SHA
    4c20b48 View commit details

Commits on May 4, 2022

  1. Copy the full SHA
    92434b4 View commit details
  2. Copy the full SHA
    6cb4749 View commit details
  3. Copy the full SHA
    8bc41c2 View commit details

Commits on May 6, 2022

  1. Pure Xcode: Supplement vfs with -F (#12)

    Pure Xcode: Supplement vfs with -F
    
    Logically `-F$(BUILT_PRODUCTS_DIR)` include provides the identical
    functionality as the VFS does in Bazel mode. In other words, the include
    and VFS yield the same behavior in clang and swift. WIP state is because
    we need make this Pure Xcode only ( actually want it in Bazel mode )
    
    Finally, this allows us to:
    - remove bazel-ios/rules_ios#470 altogether
    - always compile with `apple.virtualize_frameworks` for CLI builds and
      Xcode builds in Pure Xcode mode
    jerrymarino authored May 6, 2022
    Copy the full SHA
    b3fab88 View commit details
  2. Bump Xcode gen to latest (#14)

    Take the latest build of Xcode gen
    jerrymarino authored May 6, 2022
    Copy the full SHA
    5995777 View commit details
  3. Copy the full SHA
    a4263c0 View commit details
  4. Add top level resources to a bundle (#16)

    Fixes when using resources to directly on a top level bundle. This was
    added in rules_apple a few years back
    jerrymarino authored May 6, 2022
    Copy the full SHA
    496508a View commit details

Commits on May 11, 2022

  1. Set apple.experimental.tree_artifact_outputs as part of the genearte …

    …cmd (#19)
    
    * Set apple.experimental.tree_artifact_outputs as part of the genearte cmd
    * Better formatting
    
    Co-authored-by: Jonathan Dierksen <1507580+dierksen@users.noreply.github.com>
    thiagohmcruz and dierksen authored May 11, 2022
    Copy the full SHA
    00d339b View commit details

Commits on May 12, 2022

  1. Copy the full SHA
    2a6af9f View commit details

Commits on May 16, 2022

  1. Bump Tulsi and Quick (#21)

    * Bump Tulsi to pickup is_dynamic fix
    
    * Bump Quick to sync with rules_ios
    thiagohmcruz authored May 16, 2022
    Copy the full SHA
    8dce2aa View commit details

Commits on May 17, 2022

  1. Copy the full SHA
    aa3ae8b View commit details

Commits on May 26, 2022

  1. [rules_ios] Collect .a and sdk_frameworks (#24)

    * Fix missing .a deps
    * Fix missing sdk_fmwks
    thiagohmcruz authored May 26, 2022
    Copy the full SHA
    c4df8af View commit details

Commits on May 27, 2022

  1. Collect .datamodels now collected in Tulsi (#25)

    * Collect datamodels in myResources
    * Bump Tulsi
    thiagohmcruz authored May 27, 2022
    Copy the full SHA
    ec34d21 View commit details

Commits on Jun 16, 2022

  1. Copy the full SHA
    937f5af View commit details

Commits on Jun 17, 2022

  1. Merge pull request #26 from dierksen/bazel5

    Update WORKSPACE to work with Bazel 5.0.0
    dierksen authored Jun 17, 2022
    Copy the full SHA
    f4031c2 View commit details

Commits on Jun 28, 2022

  1. Copy the full SHA
    642838d View commit details
  2. Copy the full SHA
    34667ee View commit details

Commits on Jun 29, 2022

  1. Copy the full SHA
    4caec7b View commit details

Commits on Oct 5, 2022

  1. Install for all supported Xcodes (#31)

    * Install for all supported Xcodes
    thiagohmcruz authored Oct 5, 2022
    Copy the full SHA
    147aef0 View commit details

Commits on Oct 7, 2022

  1. Add uninstall build system cmd (#32)

    * Add uninstall build system cmd
    * Bump xcbuildkit
    * Safety checks
    thiagohmcruz authored Oct 7, 2022
    Copy the full SHA
    be5593e View commit details

Commits on Nov 4, 2022

  1. Add source_output_file_map_aspect and DataStore symlink logic (#33)

    * Add source_output_file_map_aspect and DataStore symlink logic
    * Configure xcbuildkit via xcconfigs
    * Minor fix to handle existing DataStore backup
    * Bump xcbuildkit, handle DataStore setup there instead
    * Support more file extensions
    * Better transitive deps
    * Bump xcbuildkit to main branch
    thiagohmcruz authored Nov 4, 2022
    Copy the full SHA
    7ef4e81 View commit details

Commits on Nov 14, 2022

  1. Remove xcconfigs and create config file at proj gen time (#34)

    * Remove xcconfigs and create config file at proj gen time
    * Bump xcbuildkit
    * Adds sensible defaults
    thiagohmcruz authored Nov 14, 2022
    Copy the full SHA
    359ef19 View commit details

Commits on Dec 6, 2022

  1. Collect objc compiler flags from Bazel (#36)

    * Collect objc compiler flags from Bazel
    * Bump xcbuildkit to main branch
    * Collect non_arc_srcs once per target
    thiagohmcruz authored Dec 6, 2022
    Copy the full SHA
    8981300 View commit details
  2. Copy the full SHA
    265dfdc View commit details

Commits on Dec 9, 2022

  1. Collect swiftc compiler flags for indexing (#37)

    * Collect swiftc compiler flags for indexing
    * Bump xcbuildkit to main branch
    * conditionally fail
    thiagohmcruz authored Dec 9, 2022
    Copy the full SHA
    fffd803 View commit details

Commits on Jan 31, 2023

  1. Copy the full SHA
    68eb798 View commit details
  2. Copy the full SHA
    392fa8d View commit details
5 changes: 2 additions & 3 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -9,6 +9,5 @@ build \
--spawn_strategy=standalone \
--strategy=SwiftCompile=worker \
--swiftcopt=-Xwrapped-swift=-debug-prefix-pwd-is-dot \
--experimental_strict_action_env=true \
--cpu darwin_x86_64 \
--experimental_show_artifacts
--incompatible_strict_action_env=true \
--experimental_show_artifacts
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.4.1
5.0.0
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -26,3 +26,9 @@ external
*.swp

xchammer-includes

# SPM outputs
.build/

# VSCode configuration
.vscode/
139 changes: 78 additions & 61 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
package(default_visibility = ["//visibility:public"])

licenses(["notice"])

load(
"@build_bazel_rules_apple//apple:macos.bzl",
"macos_application",
)
load(
"@build_bazel_rules_apple//apple:resources.bzl",
"apple_resource_group",
"apple_resource_bundle",
"apple_resource_group",
)
load(
"@build_bazel_rules_swift//swift:swift.bzl",
@@ -20,9 +16,15 @@ load(
"apple_bundle_version",
)
load(
"@com_github_bazelbuild_buildtools//buildifier:def.bzl",
"buildifier",
"//:BazelExtensions/features.bzl",
"feature_names",
)

# FIX-ME: Bring this back after resolving issues with loading from rules_ios
# load(
# "@com_github_bazelbuild_buildtools//buildifier:def.bzl",
# "buildifier",
# )
load(
"//third_party:repositories.bzl",
"namespaced_name",
@@ -36,6 +38,20 @@ load(
"target_config",
"xchammer_config",
)
load(
"//:BazelExtensions/xcode_configuration_provider.bzl",
"declare_target_config",
)

# Xcode project for Bazel built project
load(
"//:BazelExtensions/xcodeproject.bzl",
"xcode_project",
)

package(default_visibility = ["//visibility:public"])

licenses(["notice"])

apple_resource_group(
name = "XCHammerAssets",
@@ -44,7 +60,6 @@ apple_resource_group(
]),
)


# Build system support. Currently, we use the example xcbuildkit
# to simply show the progress bar.
# Stick this into a bundle to group files together
@@ -54,51 +69,45 @@ apple_resource_bundle(
"@xcbuildkit//:BazelBuildServiceInstaller",
"@xcbuildkit//:BuildInfo",
# We use this to check if it's installed into each Xcode
"@bazel_tools//tools/osx:xcode-locator-genrule"
]
)

load(
"//:BazelExtensions/xcode_configuration_provider.bzl",
"declare_target_config",
)

load(
"@build_bazel_rules_apple//apple:resources.bzl",
"apple_resource_group",
"@bazel_tools//tools/osx:xcode-locator-genrule",
],
)

# Note:
# - $(SPAWN_OPTS) is determined at build time by tools/XCHammerXcodeRunscript.sh
# XCHammer's `bazel`, tools/bazelwrapper subs out make variable
xchammer_xcode_target_config = target_config(
build_bazel_template="tools/XCHammerXcodeRunscript.sh",
build_bazel_options="$(SPAWN_OPTS)"
build_bazel_options = "$(SPAWN_OPTS)",
build_bazel_template = "tools/XCHammerXcodeRunscript.sh",
)

# This is an example of declaring a target config.
declare_target_config(name="XCHammerSourcesXcodeConfig",
config=xchammer_xcode_target_config)
declare_target_config(
name = "XCHammerSourcesXcodeConfig",
config = xchammer_xcode_target_config,
)

# This BUILD file is not actually imported into XCHammer
# There is already a BUILD file placed in there by another dep.
apple_resource_group(
name = "BazelExtensions",
structured_resources=glob([
structured_resources = glob([
"BazelExtensions/*.bzl",
]),
)


swift_library(
name = "XCHammerSources",
srcs = glob(["Sources/**/*.swift"]),
copts = [
"-swift-version",
"4.2",
],
data = [
":XCHammerAssets",
":BazelExtensions",
] + [
":XCBuildKit",

],
deps = ["@" + namespaced_name(x) for x in [
"AEXML//:AEXML",
@@ -114,11 +123,7 @@ swift_library(
"XcodeGen//:ProjectSpec",
"XcodeProj//:XcodeProj",
"Yams//:Yams",
]] + [":XCHammerSourcesXcodeConfig" ],
copts = [
"-swift-version",
"4.2"
],
]] + [":XCHammerSourcesXcodeConfig"],
)

apple_bundle_version(
@@ -132,12 +137,16 @@ macos_application(
infoplists = ["Info.plist"],
minimum_os_version = "10.14",
version = ":XCHammerVersion",
deps = [":XCHammerSources", ":XCHammerSourcesXcodeConfig"],
deps = [
":XCHammerSources",
":XCHammerSourcesXcodeConfig",
],
)

buildifier(
name = "buildifier",
)
# FIX-ME: Bring this back after resolving issues with loading from rules_ios
# buildifier(
# name = "buildifier",
# )

script_base = "$SRCROOT/tools/instrumentation_helpers"

@@ -169,41 +178,41 @@ gen_xchammer_config(
},
target_config = {
"//:xchammer": xchammer_xcode_target_config,
"//tools/XCConfigExporter:xcconfig-exporter": xchammer_xcode_target_config
"//tools/XCConfigExporter:xcconfig-exporter": xchammer_xcode_target_config,
},
targets = ["//:xchammer", "//tools/XCConfigExporter:xcconfig-exporter"],
targets = [
"//:xchammer",
"//tools/XCConfigExporter:xcconfig-exporter",
],
),
)

# Xcode project for Bazel built project
load(
"//:BazelExtensions/xcodeproject.bzl",
"xcode_project"
)

# The xcode_project for Bazel built Xcode project
# Note: the target_config is declared in :XCHammerSourcesXcodeConfig
xcode_project(
name="workspace_v2",
bazel="tools/bazelwrapper",
targets=["//:xchammer", "//tools/XCConfigExporter:xcconfig-exporter"],
project_config=project_config(
name = "workspace_v2",
bazel = "tools/bazelwrapper",
project_config = project_config(
generate_xcode_schemes = False,
paths = ["**"],
generate_xcode_schemes=False,
xcconfig_overrides = {
"Release": "tools/BazelToolchain.xcconfig",
"Debug": "tools/BazelToolchain.xcconfig",
"Profile": "tools/BazelToolchain.xcconfig",
}
)
},
),
targets = [
"//:xchammer",
"//tools/XCConfigExporter:xcconfig-exporter",
],
)

# Development / Distribution
genrule(
name = "xchammer_unzip",
srcs = [ ":xchammer" ],
name = "gen_xchammer_unzip",
srcs = [":xchammer"],
outs = ["xchammer_unzip"],
cmd = "unzip -q $(SRCS) -d $(OUTS)",
outs = [ "xchammer_unzip" ]
)

# This produces the same interface as the XCHammer repository, so a person
@@ -232,23 +241,24 @@ gen_workspace_cmd = """
touch WORKSPACE
echo 'sh_binary(name="xchammer", srcs=["xchammer.app/Contents/MacOS/xchammer"], visibility=["//visibility:public"])' > BUILD
"""

genrule(
name = "xchammer_dist",
srcs = [ ":xchammer_unzip" ],
srcs = [":xchammer_unzip"],
outs = ["xchammer_dist_repo.zip"],
cmd = """
mkdir zipdir/
cp -r $(SRCS)/xchammer.app zipdir/xchammer.app
cd zipdir
{gen_workspace_cmd}
zip -q ../$(OUTS) -r .
""".format(gen_workspace_cmd=gen_workspace_cmd),
outs = [ "xchammer_dist_repo.zip" ]
""".format(gen_workspace_cmd = gen_workspace_cmd),
)

# Builds an xchammer WORKSPACE use for local development. By creating a symlink
# to the build artifact to ensure the upstream repository is using the latest
# artifacts.
#
#
# If we were to just use `xchammer_dist` Bazel will not check a `.zip` of an
# http_archive, so this symlinks the files instead.
#
@@ -262,12 +272,19 @@ genrule(
# --override_repository=xchammer=/path/to/xchammer/bazel-bin/xchammer_dev_repo/
genrule(
name = "xchammer_dev",
srcs = [ ":xchammer" ],
srcs = [":xchammer"],
outs = ["xchammer_dev_repo"],
cmd = """
mkdir $(OUTS)
ln -s $$(dirname $$PWD/$(SRCS))/xchammer_archive-root/xchammer.app $(OUTS)/xchammer.app
cd $(OUTS)
{gen_workspace_cmd}
""".format(gen_workspace_cmd=gen_workspace_cmd),
outs = [ "xchammer_dev_repo" ],
""".format(gen_workspace_cmd = gen_workspace_cmd),
)

config_setting(
name = "collect_indexing_info",
values = {
"features": feature_names.collect_indexing_info,
},
)
5 changes: 5 additions & 0 deletions BazelExtensions/features.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
feature_names = struct(
# Collect outputs (.o files) and compiler flags per target to be
# used during indexing in Bazel by `xcbuildkit`
collect_indexing_info = "xcode.collect_indexing_info",
)
4 changes: 2 additions & 2 deletions BazelExtensions/tulsi.bzl
Original file line number Diff line number Diff line change
@@ -2,12 +2,12 @@
# In the distribution artifact we need to:
# Include a binary build of XCHammer
load(
"@xchammer_tulsi_aspects//:tulsi/tulsi_aspects_paths.bzl",
"@xchammer-Tulsi//src/TulsiGenerator/Bazel:tulsi/tulsi_aspects_paths.bzl",
_SwiftInfo = "SwiftInfo",
)

load(
"@xchammer_tulsi_aspects//:tulsi/tulsi_aspects.bzl",
"@xchammer-Tulsi//src/TulsiGenerator/Bazel:tulsi/tulsi_aspects.bzl",
_tulsi_sources_aspect = "tulsi_sources_aspect",
_TulsiSourcesAspectInfo = "TulsiSourcesAspectInfo",
)
8 changes: 8 additions & 0 deletions BazelExtensions/xchammerconfig.bzl
Original file line number Diff line number Diff line change
@@ -66,3 +66,11 @@ def xchammer_config(
projects, # [String: XCHammerProjectConfig]
target_config = None): # [String: XCHammerTargetConfig]?
return struct(targets = targets, targetConfig = target_config, projects = projects)

def bazel_build_service_config(
bep_path = None, # String?
indexing_enabled = False, # Bool
index_store_path = None, # String?
indexing_data_dir = None, # String?
progress_bar_enabled = False): # Bool
return struct(bepPath = bep_path, indexingEnabled = indexing_enabled, indexStorePath = index_store_path, indexingDataDir = indexing_data_dir, progressBarEnabled = progress_bar_enabled)
Loading