[go-migration] Compatibility issue with existing apps due to JRE relocation in the Go-based Java Buildpack
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 領域
- build-system
調査の方向性
Issue で言及されている buildpack の staging フローと /profile.d/0_java.sh エントリポイントから始め、次に新しい JAVA_HOME がどこで設定されるかを追跡します。.java-buildpack/open_jdk_jre/bin/java をハードコードしたパスで staging を再現し、両方のレガシー JRE パスが正規の場所に解決される一方で、新しい JAVA_HOME も引き続き利用可能であることを確認します。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Go
- スター
- 452
- フォーク
- 2.5k
- 平均マージ
- 14時間 57分
- マージ済み PR(30日)
- 23
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cloudfoundry/java-buildpack のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
cloudfoundry/java-buildpack#1423 ·
-
Support configurable initial/minimum heap size relative to (/as a percentage of) calculated Xmx オープン
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
cloudfoundry/java-buildpack#1377 · コメント 5 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
cloudfoundry/java-buildpack#1364 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
cloudfoundry/java-buildpack#1342 · コメント 1 件 · リアクション 2 件 ·
cloudfoundry/java-buildpack の issue をすべて見る
似ている issue
-
agentic-workflows
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
agentic-workflows
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
microsoft/agent-framework-go#1179 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
[Bug]: OLLAMA_KEEP_ALIVE="5m" / "24h" crashes Ollama embedding and vision models with ValueError オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
infiniflow/ragflow#20223 · リアクション 1 件 ·
-
bug needs triage pkg/translator/faro
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
open-telemetry/opentelemetry-collector-contrib#51484 · コメント 1 件 ·