Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

capture KMP publications in artifacts-check #853

Merged
merged 4 commits into from
Aug 8, 2022

Conversation

RBusarow
Copy link
Collaborator

@RBusarow RBusarow commented Jul 30, 2022

This adds all publications to the artifactsCheck task, instead of just looking at the standard jvm ones.

It also pulls this data directly from the Gradle Maven publish plugin's Publication object, instead of just looking at what's defined gradle.properties. That Publication object is what's used to create the actual pom, so it's a more robust test.

@RBusarow RBusarow requested review from a team and zach-klippenstein as code owners July 30, 2022 00:01
@RBusarow RBusarow force-pushed the rick/artifactsCheck_KMP_publications branch 2 times, most recently from 4b9d414 to 1b8ecfc Compare August 1, 2022 16:15
@RBusarow
Copy link
Collaborator Author

RBusarow commented Aug 1, 2022

The updated ./gradlew artifactsCheck task is passing locally but failing in CI (running on Ubuntu). This is because of KMP's additional environment requirements. The KMP plugin automatically skips the iOS targets, which means they aren't there for the artifacts plugin to read.

Here's the actual error:

Some Kotlin/Native targets cannot be built on this linux_x64 machine and are disabled:
    * In project ':workflow-core':
        * targets 'iosArm64', 'iosX64' (can be built with one of the hosts: macos_x64, macos_arm64)
    * In project ':workflow-runtime':
        * targets 'iosArm64', 'iosX64' (can be built with one of the hosts: macos_x64, macos_arm64)
To hide this message, add 'kotlin.native.ignoreDisabledTargets=true' to the Gradle properties.


> Task :artifactsCheck FAILED
	Artifact definitions don't match.  If this is intended, run `./gradlew artifactsDump` and commit changes.

	These artifacts are defined in `artifacts.json` but are missing from the project:

                     gradlePath  - :workflow-core
                publicationName  - iosArm64
                          group  - com.squareup.workflow1
                     artifactId  - workflow-core-iosarm64
                pom description  - Workflow Core
                      packaging  - klib

                     gradlePath  - :workflow-core
                publicationName  - iosX64
                          group  - com.squareup.workflow1
                     artifactId  - workflow-core-iosx64
                pom description  - Workflow Core
                      packaging  - klib

                     gradlePath  - :workflow-runtime
                publicationName  - iosArm64
                          group  - com.squareup.workflow1
                     artifactId  - workflow-runtime-iosarm64
                pom description  - Workflow Runtime
                      packaging  - klib

                     gradlePath  - :workflow-runtime
                publicationName  - iosX64
                          group  - com.squareup.workflow1
                     artifactId  - workflow-runtime-iosx64
                pom description  - Workflow Runtime
                      packaging  - klib

So as I see it, the options are:

  1. Write something into artifactsCheck which checks the OS and skips any "ios*64" artifacts if it's not in macOS.
    a. Which basically removes the checks from CI -- which isn't great. It should at least print a warning.
  2. Move this specific task into a macOS runner.
    a. The check task is currently being invoked on Ubuntu, in order to invoke the common tests. We need to either call other, specific tasks, or option Remove non-kotlin files and README text. #1 needs to be done as well.

I think I need to do both.

@RBusarow RBusarow force-pushed the rick/artifactsCheck_KMP_publications branch from 1b8ecfc to 1715f54 Compare August 5, 2022 16:06
This allows developers to opt-in to just a warning (instead of failure) if running `artifactsCheck` on a Linux or Windows machine which cannot check artifacts for the Apple ecosystem.
@RBusarow RBusarow force-pushed the rick/artifactsCheck_KMP_publications branch from 1715f54 to 78e1760 Compare August 5, 2022 16:55
@RBusarow RBusarow merged commit 7e9caa8 into main Aug 8, 2022
@RBusarow RBusarow deleted the rick/artifactsCheck_KMP_publications branch August 8, 2022 19:41
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.

2 participants