Steps to reproduce:
- Go to start.spring
- Project: Gradle-Kotlin
- Language: Kotlin
- Spring Boot: 3.0.1
- Packaging: Jar
- Java: 17
- Dependencies: GraalVM Native Support, Spring Boot Actuator
- Generate the project(attached generated project for convenience) and run
./gradlew nativeRun
. I got the following error,
> Task :compileAotJava FAILED
/home/test/Downloads/actuator-bug/build/generated/aotSources/org/springframework/boot/actuate/autoconfigure/observation/ObservationAutoConfiguration__BeanDefinitions.java:115: error: error while writing OnlyMetricsMeterObservationHandlerConfiguration__BeanDefinitions: /home/test/Downloads/actuator-bug/build/classes/java/aot/org/springframework/boot/actuate/autoconfigure/observation/ObservationAutoConfiguration__BeanDefinitions$MeterObservationHandlerConfiguration__BeanDefinitions$OnlyMetricsMeterObservationHandlerConfiguration__BeanDefinitions.class: File name too long
public static class OnlyMetricsMeterObservationHandlerConfiguration__BeanDefinitions {
Environment:
- Ubuntu 22.04.1 LTS
- openjdk 17.0.5 2022-10-18
- OpenJDK Runtime Environment GraalVM CE 22.3.0 (build 17.0.5+8-jvmci-22.3-b08)
- OpenJDK 64-Bit Server VM GraalVM CE 22.3.0 (build 17.0.5+8-jvmci-22.3-b08, mixed mode, sharing)
Comment From: mhalbritter
Hm, I can't reproduce this. What's the filesystem of /home/test/Downloads
?
Comment From: mhalbritter
/home/test/Downloads/actuator-bug/build/classes/java/aot/org/springframework/boot/actuate/autoconfigure/observation/ObservationAutoConfiguration__BeanDefinitions$MeterObservationHandlerConfiguration__BeanDefinitions$OnlyMetricsMeterObservationHandlerConfiguration__BeanDefinitions.class
is 286 chars long. The filename ObservationAutoConfiguration__BeanDefinitions$MeterObservationHandlerConfiguration__BeanDefinitions$OnlyMetricsMeterObservationHandlerConfiguration__BeanDefinitions.class
is 170 chars long.
On my system (Fedora with BTRFS file system) the limits are:
$ getconf PATH_MAX ~
4096
$ getconf NAME_MAX ~
255
Comment From: adisesha
The file system is ecryptfs
Results of getconf
commands,
$ getconf PATH_MAX ~
4096
$ getconf NAME_MAX ~
143
Comment From: mhalbritter
Well, that explains it. Not sure if we can do something here. I'll flag it as team attention to see what the team thinks.
Comment From: philwebb
Suggestion from @wilkinsona would be to remove __BeanDefinitions
for nested classes. E.g
ObservationAutoConfiguration__BeanDefinitions$MeterObservationHandlerConfiguration__BeanDefinitions$OnlyMetricsMeterObservationHandlerConfiguration__BeanDefinitions.class
Becomes
ObservationAutoConfiguration__BeanDefinitions$MeterObservationHandlerConfiguration$OnlyMetricsMeterObservationHandlerConfiguration.class
Comment From: snicoll
Thanks for the suggestion. It turned out to be quite straightforward to change and a good thing regardless of this issue.
@adisesha the generated class names will be shorter, I hope it'll be enough for your env. Please give it a try and let us know if more optimizations are required. Thanks!
Comment From: adisesha
@snicoll Thank you. It works.