Skip to content

Conversation

@anfelbar
Copy link
Collaborator

@anfelbar anfelbar commented Dec 23, 2022

About

Adding Swift support and hello world example.
Run with

cd swift
bazel run  //...

Why a new workspace?

The current version of rules_swift (1.5.0) is working with bazel 6.0.0. Upgrading to bazel 6.0.0 in the repository makes rules_kotlin fail (only support up to bazel 5.3.0) and I could not make it work with a previous version of rules_swift (1.2.0). Until rules_kotlin supports 6.0.0 we use a new workspace for the swift example. In principel, this is a valid setup for building on remote, i.e., different targets using different bazel versions, right?

Progress #36

@anfelbar anfelbar mentioned this pull request Dec 23, 2022
8 tasks
@@ -0,0 +1 @@
6.0.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Why can't it use the repo's main .bazelversion, which is pinned to 7.0.0-pre.20221207.2? It doesn't work with Bazel 7?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, we are not using versiob 7 but version 5.2.0

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Wait, this PR is for another repository, not engflow. This is example.

Copy link
Contributor

Choose a reason for hiding this comment

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

You mean, this will be used as an example, so you want it to be self-contained?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't know how to make it work with different version than the repo itself. So I added a workspace and its own .bazelversion. The repository .bazelversion is this: https://github.com/EngFlow/example/blob/main/.bazelversion

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, sorry, I all this time didn't realize that this PR is on the example repo :-)
Now I'm wondering why the example repo is pinned to an old Bazel version...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was thinking on moving to version 6. WDYT?

@anfelbar
Copy link
Collaborator Author

@ola-rozenfeld there is a conditional because the rules test environment handles things different in linux and macos: https://github.com/bazelbuild/rules_swift/blob/master/examples/xplatform/xctest/main.swift

@@ -0,0 +1 @@
6.0.0
Copy link
Contributor

Choose a reason for hiding this comment

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

You mean, this will be used as an example, so you want it to be self-contained?

@@ -0,0 +1 @@
6.0.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, sorry, I all this time didn't realize that this PR is on the example repo :-)
Now I'm wondering why the example repo is pinned to an old Bazel version...

@anfelbar anfelbar merged commit 965b146 into main Dec 27, 2022
@anfelbar anfelbar deleted the andres-swift-example branch December 27, 2022 23:58
@anfelbar anfelbar mentioned this pull request Dec 28, 2022
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