:pleading_face:I want to know if it is possible to...
# compiler
x
🥺I want to know if it is possible to compile a custom Kotlin Bootstrap on my PC and publish the artifacts locally? After I added/modified some interfaces in the Kotlin compiler source code, Bootstrap could not recognize these changes and no longer helped me build Kotlin. I learned through searching the channel that Kotlin Bootstrap artifacts are compiled and published with the latest source code every few weeks, but there is no public documentation on the build commands and compilation process, which is quite difficult for people who want to modify the Kotlin compiler source code and verify the changes locally.
d
If you want to use the compiler built from sources in some local project, you need to: 1. Publish the compiler artifacts
Copy code
# publishes to ./build/repo
./gradlew publish
or
Copy code
# publishes to ~/.m2/repo
./gradlew install
2. Add local repo in to the configuration of your project (
maven("/path/to/kotlin/build/repo")
or
mavenLocal()
respectfully) and set the kotlin version to
2.1.255-SNAPSHOT
👀 1
❤️ 1
If you want to bootstrap locally (build the Kotlin project with the compiler you published locally), you need to publish artifacts in the same way and then add the following lines to the
local.properties
file in the root of the Kotlin project
Copy code
bootstrap.local=true
# Replace `/path/to/kotlin` with a proper path
bootstrap.local.path=/path/to/kotlin/build/repo
❤️ 1
k
^ this is really helpful, especially for first time contributors, mind if I take a crack at adding it to the kotlin repo and website docs?
x
Thanks for your help, there are still some other bugs to be solved, but I think this method is feasible~
d
@kaeawc publishing to
mavenLocal
is already mentioned in the readme Local bootstrapping is described in the gradle.properties
k
The latter isn't very discoverable and it doesn't mention why someone would want to bootstrap.
d
I'm hardly imagine why someone want to bootstrap too There are quite a few scenarios when it is really needed to (like update of latest stable language version or changes in the compiler required to compile stdlib)
I'd say if you don't know why you want to bootstrap, then you actually don't want to