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

Write an example Mill build for arrow-kt/arrow (1500USD Bounty) #3670

Closed
lihaoyi opened this issue Oct 5, 2024 · 6 comments
Closed

Write an example Mill build for arrow-kt/arrow (1500USD Bounty) #3670

lihaoyi opened this issue Oct 5, 2024 · 6 comments
Labels
Milestone

Comments

@lihaoyi
Copy link
Member

lihaoyi commented Oct 5, 2024


From the maintainer Li Haoyi: I'm putting a 1500USD bounty on this issue, payable by bank transfer on a merged PR implementing this.


The goal of this ticket is to write an example Mill build for https://github.com/arrow-kt/arrow, in the spirit of the other example Mill builds for:

The other three examples cover Java and Scala for Gradle/Maven/SBT, the end goal of writing an example for arrow-kt is to have a reference example for Kotlin and Gradle-Kotlin

The goal of the example build isn't to reach 100% compatibility as a drop-in replacement for the original build. Rather, it is to be able to demonstrate a "representative" build: able to do most of the core, interesting functionality, without necessarily reproducing every quirk of the original.

In particular, the example build should be able to compile, package, and run most existing tests. The only exception would be functionality not supported by Mill: e.g. using different JVM versions (at least until #3480 lands), Kotlin-JS (until #3611 lands), or android stuff (until #3550 lands).

Arrow's gradle build has 1 root build.gradle.kts and 20 sub-folder build.gradle.kts files, which should translate into 1 Mill RootModule and 20 nested modules.

Once the build is complete, and all modules compile and pass tests, the pull request should come with an ad-hoc performance comparison between the old Gradle build and the new example Mill build, in the spirit of the existing comparisons with Maven https://mill-build.org/mill/comparisons/maven.html Gradle https://mill-build.org/mill/comparisons/gradle.html and SBT https://mill-build.org/mill/comparisons/sbt.html. It should also contain a writeup of what parts of the build were not covered in the example, and why (e.g. due to features not supported in Mill)

@lihaoyi lihaoyi added the bounty label Oct 5, 2024
@chaitanyawaikar
Copy link

@lihaoyi I would like to give this a shot.

@lihaoyi
Copy link
Member Author

lihaoyi commented Oct 11, 2024

@chaitanyawaikar go for it

@rahat2134
Copy link

rahat2134 commented Oct 12, 2024

PS - @chaitanyawaikar, are you doing this? or can I?

@Ammonite-Bot
Copy link
Collaborator

Ammonite-Bot commented Oct 12, 2024 via email

@chaitanyawaikar
Copy link

PR in progress - #3726

@chaitanyawaikar
Copy link

chaitanyawaikar commented Oct 13, 2024

PS - @chaitanyawaikar, are you doing this? or can I?

@rahat2134 I would require one more week and would let you know if I am not able to proceed. Thanks

lihaoyi added a commit that referenced this issue Nov 7, 2024
This PR partially addresses #3670: it contains working example, but
doesn't contain any docs.

This example contains compilation and test execution for all the modules
of https://github.com/arrow-kt/arrow for the JVM and JS (Node) targets,
except
[arrow-optics-compose](https://github.com/arrow-kt/arrow/tree/main/arrow-libs/optics/arrow-optics-compose)
module (it requires better Android support by Mill).

Full example run takes 6 minutes on my machine, so it is extracted into
a dedicated CI job.

The following Gradle plugins are not added to the example build script,
because their respective tooling is Gradle-dependent (no raw-jar or
CLI):

* https://github.com/xvik/gradle-animalsniffer-plugin (although maybe it
is possible to use options from
https://www.mojohaus.org/animal-sniffer/)
* https://github.com/Kotlin/kotlinx-knit
* https://github.com/Kotlin/binary-compatibility-validator
* https://github.com/diffplug/spotless

There is also no publication support in this example (requires Kotlin
Multiplatform publishing support, see
#3867)

I faced the following issues while writing this example:

* There is quite a lot of duplication for JVM/JS configuration, because
there is no support of [Kotlin Multiplatform
hierarchies](https://kotlinlang.org/docs/multiplatform-hierarchy.html)
* Each Maven or Module dependency should be with JS/JVM/etc. target
qualifier, which also quite explodes amount of code to be written. This
is also a question of Kotlin Multiplatform hierarchies support and
resolution.
* Until KMP hierarchies and target resolution support is not
implemented, adding a new compilation target will bring quite a lot of
new code in the build script. And there is a lot of targets in Arrow:
https://github.com/arrow-kt/arrow-gradle-config/blob/97ba7b5eab810a336cf4070eb717f05533d208a8/arrow-gradle-config-kotlin/src/main/kotlin/io.arrow-kt.arrow-gradle-config-kotlin.gradle.kts#L34-L69
* There is no possibility to disable tests for the particular module (so
I had to use a hack with overriding `compile` / `test` tasks) - this is
because tests is dedicated module, but if comes as a part of the trait,
we cannot add / remove it dynamically. Having such control is handy when
certain multiplatform modules have a common trait for the main
compilation unit, but some of them may have no tests.

Regarding docs: I think it is too early to write any comparison with
Gradle, because clearly new functionality will be added to the Kotlin
support in Mill which will affect overall execution time and also the
comparison should be done not only for JVM targets, but for Kotlin/JS
and Kotlin/Native targets as well. And ideally it should be a defined
methodology for such testing (for example, certain Gradle plugins should
be removed from the Arrow Gradle build script, to have the same set as
Mill build script; compiler execution time should be excluded (it may be
different because of the different flags passed to it under the hood)).

So I propose to open a dedicated bounty for writing such doc.

---------

Co-authored-by: 0xnm <0xnm@users.noreply.github.com>
Co-authored-by: Li Haoyi <haoyi.sg@gmail.com>
@lihaoyi lihaoyi closed this as completed Nov 7, 2024
@lefou lefou added this to the 0.12.2 milestone Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants