Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 751805 - dev-java/openjdk-bin-8.272_p10 ignores EPREFIX when makes symlinks
Summary: dev-java/openjdk-bin-8.272_p10 ignores EPREFIX when makes symlinks
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Georgy Yakovlev
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2020-10-29 21:40 UTC by Anton
Modified: 2021-04-02 12:22 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Proposed patch for eclass/java-vm-2.eclass (java-vm-2.eclass.diff,508 bytes, patch)
2020-11-12 02:14 UTC, Anton
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anton 2020-10-29 21:40:20 UTC
When emerging dev-java/openjdk-bin-8.272_p10, I see:

>>> Installing (32 of 36) dev-java/openjdk-bin-8.272_p10::gentoo                                                                                                             * QA Notice: Symbolic link /home/anton/projects/gentoo/prefix/usr/lib/jvm/openjdk-bin-8 points to /opt/openjdk-bin-8.272_p10 which does not exist.                         !!! Error: Target "openjdk-bin-8" doesn't appear to be valid!                                                                                                               exiting                                                                                                                                                                      * openjdk-bin-8.272_p10 set as the default system-vm.                                                                                                                       * Updating .desktop files database ...

And indeed, the symlink points incorrectly, and openjdk-bin is not actually set as the default system-vm.

Reproducible: Always

Steps to Reproduce:
1. ${PREFIX}/startprefix
2. emerge dev-java/openjdk-bin
3. ls -l ${PREFIX}/usr/lib/jvm/openjdk-bin-8
Actual Results:  
${PREFIX}/usr/lib/jvm/openjdk-bin-8 -> /opt/openjdk-bin-8.272_p10

Expected Results:  
${PREFIX}/usr/lib/jvm/openjdk-bin-8 -> ${PREFIX}/opt/openjdk-bin-8.272_p10

Workaround:
 1. manually update the symlink
 2. eselect java-vm set system openjdk-bin-8
Comment 1 Anton 2020-11-12 02:14:47 UTC
Created attachment 670972 [details, diff]
Proposed patch for eclass/java-vm-2.eclass

I think the problem is in java-vm-2.eclass. When calling dosym, the eclass explicitly strips ${EPREFIX} from the target path. However, "Function Reference" [1] says about dosym: "Note that the target is interpreted verbatim; it needs to either specify a relative path or an absolute path including ${EPREFIX}."

The patch works on my Prefix setup, but I did not have a chance to test it otherwise.

[1] https://devmanual.gentoo.org/function-reference/install-functions/index.html
Comment 2 Georgy Yakovlev archtester gentoo-dev 2020-11-21 19:17:16 UTC
taking, moving prefix to CC.
will take a look soon.
Comment 3 Steven Trogdon 2021-01-16 02:07:20 UTC
This issue also exists with dev-java/openjdk-8.272_p10, i.e.

>>> Installing (4 of 4) dev-java/openjdk-8.272_p10::gentoo
 * QA Notice: Symbolic link /storage/strogdon/gentoo-rap/usr/lib/jvm/openjdk-8 points to /usr/lib64/openjdk-8 which does not exist.

which indicates the problem is with eclass/java-vm-2.eclass.
Comment 4 Benda Xu gentoo-dev 2021-01-20 01:59:31 UTC
(In reply to Georgy Yakovlev from comment #2)
> taking, moving prefix to CC.
> will take a look soon.

Thanks Georgy.
Comment 5 Martin Mokrejš 2021-03-31 14:23:26 UTC
I just run into this too with dev-java/openjdk-8.282_p08::gentoo.
Comment 6 Larry the Git Cow gentoo-dev 2021-04-02 09:45:18 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cbf8f42ed31ea1379f44918327fa534da96c0d5c

commit cbf8f42ed31ea1379f44918327fa534da96c0d5c
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2021-04-02 09:43:29 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2021-04-02 09:44:58 +0000

    eclass/java-vm-2.eclass: fix symlinks on prefix.
    
    Closes: https://bugs.gentoo.org/751805
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 eclass/java-vm-2.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 7 Georgy Yakovlev archtester gentoo-dev 2021-04-02 09:45:36 UTC
sorry for taking long, should be fine now.
Comment 8 Martin Mokrejš 2021-04-02 12:22:51 UTC
Thank you, will check at next occasion.

Do you think one could also simplify the symlinks, e.g. using 'symlinks -c' from app-misc/symlinks?