diff options
author | Erkka Kääriä <erkka.kaaria@intel.com> | 2016-04-29 09:48:19 +0300 |
---|---|---|
committer | Maxin B. John <maxin.john@intel.com> | 2016-04-29 13:17:07 +0300 |
commit | 1b975523b8d0467b2e3a44097825c30cdc9e3944 (patch) | |
tree | a8b7c140356ed765a6f1455a94fabbf35ad8ec93 /recipes-core/cacao/cacao-1.6.1 | |
parent | 000a7f770faa7312b912937a585185334dec4caf (diff) | |
download | meta-java-1b975523b8d0467b2e3a44097825c30cdc9e3944.tar.gz |
java-bootstrapping: Do not rely on hardcoded paths
Various paths to files are hardcoded in either helper scripts or the
resulting binaries (like path to Java class libraries). While this works
well when using the files on the build machine, things start breaking
down when the sstate gets shared between multiple workers in CI, as
the paths between workers can differ.
Instead of using these hardcoded paths, form the paths at runtime and pass them as parameters when required.
Signed-off-by: Erkka Kääriä <erkka.kaaria@intel.com>
Signed-off-by: Maxin B. John <maxin.john@intel.com>
Diffstat (limited to 'recipes-core/cacao/cacao-1.6.1')
-rw-r--r-- | recipes-core/cacao/cacao-1.6.1/cacao-1.6.1-do-not-rely-on-absolute-paths.patch | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/recipes-core/cacao/cacao-1.6.1/cacao-1.6.1-do-not-rely-on-absolute-paths.patch b/recipes-core/cacao/cacao-1.6.1/cacao-1.6.1-do-not-rely-on-absolute-paths.patch new file mode 100644 index 0000000..2b046cf --- /dev/null +++ b/recipes-core/cacao/cacao-1.6.1/cacao-1.6.1-do-not-rely-on-absolute-paths.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | java.in: Do not use hardcode paths | ||
2 | |||
3 | Cacao uses hardcoded paths to various files, if these paths are not | ||
4 | provided. This causes issues when sharing sstate with otherwise | ||
5 | identical workers, if build time paths are not identical. | ||
6 | |||
7 | Signed-off-by: Erkka Kääriä <erkka.kaaria@intel.com> | ||
8 | |||
9 | Upstream-Status: Inappropriate [Yocto-specific fixes] | ||
10 | |||
11 | --- | ||
12 | cacao-1.6.1/src/scripts/java.in | 16 ++++++++++++++-- | ||
13 | 1 file changed, 14 insertions(+), 2 deletions(-) | ||
14 | |||
15 | diff --git cacao-1.6.1/src/scripts/java.in cacao-1.6.1/src/scripts/java.in | ||
16 | index 0790f02..2118de7 100644 | ||
17 | --- cacao-1.6.1/src/scripts/java.in | ||
18 | +++ cacao-1.6.1/src/scripts/java.in | ||
19 | @@ -22,5 +22,17 @@ | ||
20 | ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
21 | ## 02110-1301, USA. | ||
22 | |||
23 | -IFS="" | ||
24 | -exec $(dirname ${0})/cacao ${1+"$@"} | ||
25 | +SH_DIR=`dirname "$0"` | ||
26 | +CURRENT_DIR=`cd "${SH_DIR}" && pwd` | ||
27 | + | ||
28 | +# if this shell script is invoked through symlink, we get invalid paths. As getting the real path to this file is | ||
29 | +# very painful using only /bin/sh, python is used instead. | ||
30 | +PYTHON_STR="import os; print os.path.dirname(os.path.realpath(os.readlink(\"${CURRENT_DIR}/java\"))) if os.path.islink(\"${CURRENT_DIR}/java\") else \"${CURRENT_DIR}\"" | ||
31 | +REAL_DIR=`python -c "${PYTHON_STR}"` | ||
32 | + | ||
33 | +PARENT_DIR=`dirname ${REAL_DIR}` | ||
34 | + | ||
35 | +export BOOTCLASSPATH="${PARENT_DIR}/share/cacao/vm.zip:${PARENT_DIR}/share/classpath/glibj.zip" | ||
36 | +LIBRARY_PATH="-Djava.library.path=${PARENT_DIR}/lib/classpath" | ||
37 | +exec ${REAL_DIR}/cacao ${LIBRARY_PATH} ${1+"$@"} | ||
38 | + | ||
39 | -- | ||
40 | 2.7.4 | ||
41 | |||