Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 951175 - dev-lang/swift-5.10.1-r3: doesn't symlink to "swift" and "swiftc"
Summary: dev-lang/swift-5.10.1-r3: doesn't symlink to "swift" and "swiftc"
Status: RESOLVED FIXED
Alias: None
Product: GURU
Classification: Unclassified
Component: Package issues (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Itai Ferber
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-11 20:45 UTC by benoit.dufour
Modified: 2025-03-27 11:09 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description benoit.dufour 2025-03-11 20:45:59 UTC
After the installation of dev-lang/swift-5.10.1-r3 (the first version installed), I would have expected that the swift and swiftc executables to be automatically selected by "eselect swift set #" which isn't currently the case.
Since no Swift version is selected, it can't be called as "swift" and "swiftc".
Swift 6 is still not installed.
Comment 1 Itai Ferber 2025-03-12 16:07:15 UTC
dev-lang/swift-5.10.1-r3 _should_ have called `eselect swift update` here:

> pkg_postinst() {
>     # If we're installing the latest version of Swift, then update symlinks to
>     # it. (We don't want to call `eselect swift update` unconditionally in case
>     # we're installing an older version of Swift, and the user has intentionally
>     # selected a version other than the latest.)
>     if ! has_version ">${CATEGORY}/${P}"; then
>         eselect swift update
>     fi
> }

If you unset any Swift version via eselect and run `eselect swift update` manually, does it correctly set a version?
Comment 2 benoit.dufour 2025-03-12 16:16:20 UTC
Yes. It seems like it does.
tux ~ # 
eselect swift list
Available Swift versions:
  [1]   swift-5.10.1 *
tux ~ # 
eselect swift unset
tux ~ # 
eselect swift list
Available Swift versions:
  [1]   swift-5.10.1
tux ~ # 
eselect swift update
tux ~ # 
eselect swift list
Available Swift versions:
  [1]   swift-5.10.1 *
Comment 3 Itai Ferber 2025-03-12 16:22:20 UTC
Thanks for double-checking! It seems like something may have tripped up the condition, then? Not sure how, but I'll see if I can manage to repro.

(I've extensively tested first-time installs in clean environments and haven't seen this happen, but I'll see what I can find out.)
Comment 4 benoit.dufour 2025-03-12 16:38:56 UTC
It happened on the two computers I tested it on.
First on the laptop from 2020, and then on the tower from 2010-12.
Comment 5 Itai Ferber 2025-03-12 21:40:55 UTC
I was able to reproduce this myself now in a container. Will try to track down the failure.
Comment 6 Larry the Git Cow gentoo-dev 2025-03-27 11:09:13 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=fdc4461cb862f6605de2331edad93c92084dad67

commit fdc4461cb862f6605de2331edad93c92084dad67
Author:     Itai Ferber <itai@itaiferber.net>
AuthorDate: 2025-03-26 19:43:03 +0000
Commit:     Itai Ferber <itai@itaiferber.net>
CommitDate: 2025-03-26 19:46:02 +0000

    dev-lang/swift: fix symlinking on install
    
    On `pkg_postinst`, `has_version` wasn't returning the expected value in
    order to symlink Swift on first install; instead, we can use `eselect
    swift show` itself to be able to tell whether we're eligible to update
    the symlinks.
    
    Closes: https://bugs.gentoo.org/951175
    Signed-off-by: Itai Ferber <itai@itaiferber.net>

 dev-lang/swift/swift-5.10.1-r4.ebuild | 28 ++++++++++++++++++++--------
 dev-lang/swift/swift-6.0.3-r1.ebuild  | 28 ++++++++++++++++++++--------
 2 files changed, 40 insertions(+), 16 deletions(-)