[go-migration] Compatibility issue with existing apps due to JRE relocation in the Go-based Java Buildpack
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Área
- build-system
Línea de trabajo
Comienza con el flujo de staging del buildpack y el punto de entrada /profile.d/0_java.sh mencionado en el issue; después, sigue dónde se establece el nuevo JAVA_HOME. Reproduce el staging con una ruta codificada de forma fija, .java-buildpack/open_jdk_jre/bin/java, y verifica que ambas rutas de JRE heredadas se resuelvan en la ubicación canónica mientras el nuevo JAVA_HOME siga estando disponible.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
With the new Go-based Java Buildpack, the location of the JRE has changed:
for example, from /home/vcap/app/.java-buildpack/open_jdk_jre to the new location /home/vcap/deps/0/jre/jre-17.0.15/.
There are applications that invoke Java via a hardcoded relative path inside the droplet: .java-buildpack/open_jdk_jre/bin/java so those hardcoded paths no longer exist, which breaks apps and CF tasks that rely on that path. For example, an app used to execute CF Task to execute e.g. the DB schema (so the java is currently being invoked via the full path .java-buildpack/open_jdk_jre/bin/java). Or usages like JAVA_HOME=$PWD/.java-buildpack/open_jdk_jre JAVA_OPTS="-Djava.io.tmpdir=$TMPDIR
The new Go-based buildpack has a way to introduce $JAVA_HOME which will do the job but only for new apps (the existing apps pointing to /home/vcap/app/.java-buildpack/open_jdk_jre will fail).
Reproduction steps
- Use an app/script that calls Java using the relative path inside the droplet, e.g.:
.java-buildpack/open_jdk_jre/bin/java -Xms123M org.springframework.boot.loader.launch.JarLauncher - Stage the app using the current or the Go-migration branch of the buildpack.
- Run the app or run a CF task that invokes the hardcoded path.
- Observe that the app fails with
No such file or directory
Expected behavior
Existing apps/CF Tasks could continue to run without modification, even if the buildpack internal JRE layout changes.
Suggested solution
Introduce compatibility shims during staging:
export JAVA_HOME=<the-new-java-location> (available in /profile.d/0_java.sh)
mkdir -p /home/vcap/app/.java-buildpack
ln -s $JAVA_HOME /home/vcap/app/.java-buildpack/open_jdk_jre
ln -s $JAVA_HOME /home/vcap/app/.java-buildpack/sap_machine_jre
- This preserves
.java-buildpack/open_jdk_jreand.java-buildpack/sap_machine_jreas a symlink to the actual JRE location. $JAVA_HOMEpoints to the canonical new location.- Apps with hard-coded paths will continue working.
- Lenguaje dominante
- Go
- Estrellas
- 452
- Forks
- 2.5k
- Merge medio
- 14 h 57 min
- PR fusionados (30 d)
- 23
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de cloudfoundry/java-buildpack
-
v5.1.0 GA release plan Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 68/100
cloudfoundry/java-buildpack#1423 ·
-
Support configurable initial/minimum heap size relative to (/as a percentage of) calculated Xmx Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
cloudfoundry/java-buildpack#1377 · 5 comentarios ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
cloudfoundry/java-buildpack#1364 ·
-
elastic-otel-java support Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
cloudfoundry/java-buildpack#1342 · 1 comentario · 2 reacciones ·
Todos los issues de cloudfoundry/java-buildpack
Issues similares
-
nix: vendorHash is outdated Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
-
Bob Shell support Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
santhosh-tekuri/jsonschema#276 ·