/usr/share/rustc change from directory to symlink

Bug #2130706 reported by Skia
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
rustc (Ubuntu)
Status tracked in Resolute
Plucky
In Progress
Medium
Max Gilmour
Resolute
Fix Released
Medium
Max Gilmour

Bug Description

Hello Max!

Here is your bug about the upgrade path for /usr/share/rustc change from being a directory in whatever older rust-default version to being a symlink in the newest ones.
Basically we'll need to make sure that the newest packages will remove any existing directory to be able to replace it with a symlink.

For the context, I faced that situation on my Ubuntu devel (right now resolute) laptop, that is basically rolling release, so I'm not sure how normal users are affected right now.

Happy bug fixing :-)

Related branches

Revision history for this message
Max Gilmour (maxgmr) wrote :

Hi Skia, thanks for the report!

Confirmed — the upgrade story is broken when transitioning from pre-versioned rustc (provided by the rustc source package) to versioned rustc (provided by rust-defaults).

Currently, this is only possible when upgrading from Noble to Plucky or Noble to Resolute.

==============
24.04 to 25.04
==============
root@rust-upgrade:~# lsb_release -d
No LSB modules are available.
Description: Ubuntu 24.04.3 LTS
root@rust-upgrade:~# apt update && apt upgrade -y
[...]
root@rust-upgrade:~# apt install -y rustc
[...]
root@rust-upgrade:~# ls -l /usr/share | grep rustc
drwxr-xr-x 3 root root 4096 Nov 14 16:54 rustc

root@rust-upgrade:~# sed -i 's/Prompt=lts/Prompt=normal/g' /etc/update-manager/release-upgrades
root@rust-upgrade:~# do-release-upgrade
[...]

root@rust-upgrade:~# lsb_release -d
Description: Ubuntu 25.04
root@rust-upgrade:~# ls -l /usr/share | grep rustc
drwxr-xr-x 2 root root 4096 Nov 14 16:59 rustc
drwxr-xr-x 3 root root 4096 Nov 14 16:59 rustc-1.84
root@rust-upgrade:~# ls -Ll /usr/share/rustc
total 0

==============
24.04 to devel
==============
root@rust-upgrade-lts:~# lsb_release -d
No LSB modules are available.
Description: Ubuntu 24.04.3 LTS
root@rust-upgrade-lts:~# apt update && apt upgrade -y
[...]
root@rust-upgrade-lts:~# apt install -y rustc
[...]
root@rust-upgrade-lts:~# ls -l /usr/share | grep rustc
drwxr-xr-x 3 root root 4096 Nov 14 17:07 rustc

root@rust-upgrade-lts:~# do-release-upgrade -d
[...]

root@rust-upgrade-lts:~# lsb_release -d
Description: Ubuntu Resolute Raccoon (development branch)
root@rust-upgrade-lts:~# ls -l /usr/share | grep rustc
drwxr-xr-x 2 root root 4096 Nov 14 17:14 rustc
drwxr-xr-x 3 root root 4096 Nov 14 17:14 rustc-1.88
root@rust-upgrade-lts:~# ls -Ll /usr/share/rustc
total 0

===================================================
Expected contents of /usr/share/rustc after upgrade
===================================================
root@expected:~# lsb_release -d
Description: Ubuntu Resolute Raccoon (development branch)
root@expected:~# apt update && apt upgrade -y
[...]
root@expected:~# apt install rustc -y
[...]
root@expected:~# ls -Ll /usr/share/rustc
total 8
-rw-r--r-- 1 root root 684 Aug 22 22:42 architecture.mk
drwxr-xr-x 2 root root 4096 Nov 14 17:09 bin

Changed in rustc (Ubuntu):
status: New → In Progress
Max Gilmour (maxgmr)
Changed in rustc (Ubuntu Plucky):
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Max Gilmour (maxgmr)
Revision history for this message
Petrichor Park (petrakat) wrote :

Hello, this is currently blocking me from continuing to package cargo-audit. I upgraded from Noble to Questing and can't get /usr/share/rustc/architecture.mk to work.

Do we have a workaround?

Revision history for this message
Max Gilmour (maxgmr) wrote :

> Hello, this is currently blocking me from continuing to package cargo-audit. I upgraded from > Noble to Questing and can't get /usr/share/rustc/architecture.mk to work.
>
> Do we have a workaround?

The workaround is reinstalling the package:

root@test:~# lsb_release -d
Description: Ubuntu 25.10
root@test:~# apt-cache policy rustc
rustc:
  Installed: 1.85.1ubuntu1
  Candidate: 1.85.1ubuntu1
  Version table:
 *** 1.85.1ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu questing/main amd64 Packages
        100 /var/lib/dpkg/status
root@test:~# ls -lL /usr/share/rustc
total 0
root@test:~# apt remove -y rustc && apt install rustc -y
[...]
root@test:~# ls -lL /usr/share/rustc
total 8
-rw-r--r-- 1 root root 684 Aug 19 20:50 architecture.mk
drwxr-xr-x 2 root root 4096 Dec 8 18:32 bin

Max Gilmour (maxgmr)
Changed in rustc (Ubuntu Resolute):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.