Stray /usr/.crates2.json file

Bug #1868517 reported by Chris Halse Rogers
332
This bug affects 58 people
Affects Status Importance Assigned to Milestone
cargo (Debian)
Fix Released
Unknown
cargo (Ubuntu)
High
Unassigned
rust-bat (Ubuntu)
High
Unassigned
rust-cbindgen (Ubuntu)
Undecided
Unassigned
rust-difference (Ubuntu)
Undecided
Unassigned
rust-dotenv (Ubuntu)
Undecided
Unassigned
rust-fd-find (Ubuntu)
Undecided
Unassigned
rust-hexyl (Ubuntu)
High
Unassigned
rust-lalrpop (Ubuntu)
Undecided
Unassigned
rust-lscolors (Ubuntu)
Undecided
Unassigned
rust-nitrocli (Ubuntu)
Undecided
Unassigned
rust-pulldown-cmark (Ubuntu)
Undecided
Unassigned
rust-ripgrep (Ubuntu)
High
Unassigned
rust-rustdoc-stripper (Ubuntu)
Undecided
Unassigned
rust-rusty-tags (Ubuntu)
Undecided
Unassigned
rust-sniffglue (Ubuntu)
Undecided
Unassigned
rust-ucd-generate (Ubuntu)
Undecided
Unassigned
rust-xml-rs (Ubuntu)
Undecided
Unassigned

Bug Description

The "bat" binary package contains a "/usr/.crates2.json" file. That's unlikely to be intentional!

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: bat 0.12.1-1build1
ProcVersionSignature: Ubuntu 5.3.0+bcachefs.git20200311.7e07e19c-1-generic 5.3.18
Uname: Linux 5.3.0+bcachefs.git20200311.7e07e19c-1-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.11-0ubuntu21
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Mon Mar 23 16:03:18 2020
InstallationDate: Installed on 2019-08-29 (207 days ago)
InstallationMedia: Ubuntu 19.10 bcachefs (20190828)
SourcePackage: rust-bat
UpgradeStatus: Upgraded to focal on 2020-01-20 (62 days ago)

Revision history for this message
Chris Halse Rogers (raof) wrote :
Revision history for this message
Paride Legovini (paride) wrote :

This seems to be an issue with the Rust build tools, as the file is present in both the 'bat' and 'ripgrep' packages. The two are of course uninstallable together because of this.

The file appeared when the packages have been rebuilt with this changelog entry:

 * No-change rebuild for libgcc-s1 package name change.

I rebuilt the package on an up-to-date Debian/sid system and the stray file is not present in the resulting binary package, so the problem seems to be specific to Ubuntu.

(I maintain the Debian bat package.)

Changed in rust-bat (Ubuntu):
importance: Undecided → High
Changed in rust-ripgrep (Ubuntu):
importance: Undecided → High
Revision history for this message
Paride Legovini (paride) wrote :

I rebuilt bat 0.12.1-1build1 on Focal with focal-proposed enabled and the stray file *is* there.

Paride Legovini (paride)
tags: added: rls-ff-incoming
Revision history for this message
Paride Legovini (paride) wrote :

This is an issue with the cargo package, which is ahead of Debian at the moment.

Changed in cargo (Ubuntu):
importance: Undecided → High
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in cargo (Ubuntu):
status: New → Confirmed
Changed in rust-bat (Ubuntu):
status: New → Confirmed
Changed in rust-ripgrep (Ubuntu):
status: New → Confirmed
Paride Legovini (paride)
Changed in rust-hexyl (Ubuntu):
status: New → Confirmed
importance: Undecided → High
Revision history for this message
David Peter (davidpeter) wrote :

This has also been reported on the 'bat' issue tracker: https://github.com/sharkdp/bat/issues/938

I found this section on the Arch Linux wiki on "Rust package guidelines" (https://wiki.archlinux.org/index.php/Rust_package_guidelines#Notes_about_using_cargo_install):

"The --no-track argument should always be used, because cargo install may create unwanted files such as /usr/.crates.toml or /usr/.crates2.json unless it is specified."

Paride Legovini (paride)
tags: removed: rls-ff-incoming
David Peter (davidpeter)
information type: Public → Public Security
Revision history for this message
David Peter (davidpeter) wrote :

I'm sorry about these state changes. They were done by accident. That was not my intention.

information type: Public Security → Private Security
information type: Private Security → Public
Revision history for this message
Paride Legovini (paride) wrote :

This bug has been reported in Debian [1] against the dh-cargo package, but fixed in version 0.43.1-3 of the cargo package.

Syncing with Debian will prevent new package builds from having the stray .crates2.json file, but binary packages built with the buggy version of cargo need to be rebuilt to get rid of the file.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=958301

Changed in cargo (Debian):
status: Unknown → Fix Released
Changed in cargo (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Julian Andres Klode (juliank) wrote :

Rebuilds are being prepared.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cargo - 0.42.0-0ubuntu2

---------------
cargo (0.42.0-0ubuntu2) groovy; urgency=medium

  * Cherry-pick commit from Debian to remove /usr/.crates2.json (LP: #1868517)

 -- Julian Andres Klode <email address hidden> Wed, 29 Apr 2020 13:28:25 +0200

Changed in cargo (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package rust-xml-rs - 0.8.0-1build2

---------------
rust-xml-rs (0.8.0-1build2) groovy; urgency=high

  * No change rebuild to remove /usr/.crates2.json (LP: #1868517).

 -- Julian Andres Klode <email address hidden> Wed, 29 Apr 2020 13:40:28 +0200

Changed in rust-xml-rs (Ubuntu):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package rust-ripgrep - 12.0.1-1build1

---------------
rust-ripgrep (12.0.1-1build1) groovy; urgency=high

  * No change rebuild to remove /usr/.crates2.json (LP: #1868517).

 -- Julian Andres Klode <email address hidden> Wed, 29 Apr 2020 13:38:03 +0200

Changed in rust-ripgrep (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package rust-rusty-tags - 3.5.1-2build2

---------------
rust-rusty-tags (3.5.1-2build2) groovy; urgency=high

  * No change rebuild to remove /usr/.crates2.json (LP: #1868517).

 -- Julian Andres Klode <email address hidden> Wed, 29 Apr 2020 13:38:51 +0200

Changed in rust-rusty-tags (Ubuntu):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package rust-ucd-generate - 0.2.3-1build2

---------------
rust-ucd-generate (0.2.3-1build2) groovy; urgency=high

  * No change rebuild to remove /usr/.crates2.json (LP: #1868517).

 -- Julian Andres Klode <email address hidden> Wed, 29 Apr 2020 13:40:05 +0200

Changed in rust-ucd-generate (Ubuntu):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package rust-nitrocli - 0.2.4-1build2

---------------
rust-nitrocli (0.2.4-1build2) groovy; urgency=high

  * No change rebuild to remove /usr/.crates2.json (LP: #1868517).

 -- Julian Andres Klode <email address hidden> Wed, 29 Apr 2020 13:36:42 +0200

Changed in rust-nitrocli (Ubuntu):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package rust-pulldown-cmark - 0.2.0-1build2

---------------
rust-pulldown-cmark (0.2.0-1build2) groovy; urgency=high

  * No change rebuild to remove /usr/.crates2.json (LP: #1868517).

 -- Julian Andres Klode <email address hidden> Wed, 29 Apr 2020 13:37:42 +0200

Changed in rust-pulldown-cmark (Ubuntu):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package rust-difference - 2.0.0-1build2

---------------
rust-difference (2.0.0-1build2) groovy; urgency=high

  * No change rebuild to remove /usr/.crates2.json (LP: #1868517).

 -- Julian Andres Klode <email address hidden> Wed, 29 Apr 2020 13:34:46 +0200

Changed in rust-difference (Ubuntu):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package rust-hexyl - 0.7.0-1build1

---------------
rust-hexyl (0.7.0-1build1) groovy; urgency=high

  * No change rebuild to remove /usr/.crates2.json (LP: #1868517).

 -- Julian Andres Klode <email address hidden> Wed, 29 Apr 2020 13:35:37 +0200

Changed in rust-hexyl (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package rust-lscolors - 0.7.0-1build1

---------------
rust-lscolors (0.7.0-1build1) groovy; urgency=high

  * No change rebuild to remove /usr/.crates2.json (LP: #1868517).

 -- Julian Andres Klode <email address hidden> Wed, 29 Apr 2020 13:36:18 +0200

Changed in rust-lscolors (Ubuntu):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package rust-cbindgen - 0.14.1-1build1

---------------
rust-cbindgen (0.14.1-1build1) groovy; urgency=high

  * No change rebuild to remove /usr/.crates2.json (LP: #1868517).

 -- Julian Andres Klode <email address hidden> Wed, 29 Apr 2020 13:34:25 +0200

Changed in rust-cbindgen (Ubuntu):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package rust-lalrpop - 0.17.2-4build2

---------------
rust-lalrpop (0.17.2-4build2) groovy; urgency=high

  * No change rebuild to remove /usr/.crates2.json (LP: #1868517).

 -- Julian Andres Klode <email address hidden> Wed, 29 Apr 2020 13:35:57 +0200

Changed in rust-lalrpop (Ubuntu):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package rust-rustdoc-stripper - 0.1.9-2build2

---------------
rust-rustdoc-stripper (0.1.9-2build2) groovy; urgency=high

  * No change rebuild to remove /usr/.crates2.json (LP: #1868517).

 -- Julian Andres Klode <email address hidden> Wed, 29 Apr 2020 13:38:24 +0200

Changed in rust-rustdoc-stripper (Ubuntu):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in rust-fd-find (Ubuntu):
status: New → Confirmed
Revision history for this message
Julian Andres Klode (juliank) wrote :

So updates:

* Found out that sniffglue from rust-sniffglue also includes file -> new
* rust-bat is sitting in proposed still -> fix committed
* rust-fd-find does not actually seem to include the file, at least on amd64 -> incomplete

Changed in rust-bat (Ubuntu):
status: Confirmed → Fix Committed
Changed in rust-fd-find (Ubuntu):
status: Confirmed → Incomplete
Changed in rust-sniffglue (Ubuntu):
status: New → Triaged
status: Triaged → Fix Committed
Revision history for this message
Paride Legovini (paride) wrote :

@Julian: fd-find 7.4.0-2build1 and 8.0.0-1 (in Focal and Groovy respectively) do include the file:

$ dpkg -l fd-find
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-==================================================
ii fd-find 8.0.0-1 amd64 Simple, fast and user-friendly alternative to find

$ dpkg -L fd-find | grep -F crates2
/usr/lib/cargo/.crates2.json

Changed in rust-fd-find (Ubuntu):
status: Incomplete → Triaged
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package rust-fd-find - 8.0.0-1build1

---------------
rust-fd-find (8.0.0-1build1) groovy; urgency=high

  * No change rebuild to remove /usr/.crates2.json (LP: #1868517).

 -- Julian Andres Klode <email address hidden> Wed, 06 May 2020 13:22:34 +0200

Changed in rust-fd-find (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package rust-dotenv - 0.15.0-2build1

---------------
rust-dotenv (0.15.0-2build1) groovy; urgency=high

  * No change rebuild to remove /usr/.crates2.json (LP: #1868517).

 -- Julian Andres Klode <email address hidden> Wed, 06 May 2020 13:21:24 +0200

Changed in rust-dotenv (Ubuntu):
status: New → Fix Released
Revision history for this message
yepas60830 (yepas60830) wrote :

Two months later and I still can't install ripgrep and bat. This is fixed in the source, but can we have a new release for focal please?

Revision history for this message
Dirk Eddelbuettel (edd) wrote :

Seconded. I just edited the two *.list file and hand-removed /usr/.crates.json to have bat and ripgrep coexist. I really shouldn't have to.

Revision history for this message
arkban (arkban) wrote :

I stumbled on this and thought I'd post my workaround in case someone else needed it:

```shell
$ apt-get download ripgrep

$ sudo dpkg --force-overwrite -i ripgrep*.deb
```

Revision history for this message
John L. Villalovos (happycamp) wrote :

It is now July and using Ubuntu 20.04 and get this:

# apt install ripgrep
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  ripgrep
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/1228 kB of archives.
After this operation, 4502 kB of additional disk space will be used.
(Reading database ... 107634 files and directories currently installed.)
Preparing to unpack .../ripgrep_11.0.2-1build1_amd64.deb ...
Unpacking ripgrep (11.0.2-1build1) ...
dpkg: error processing archive /var/cache/apt/archives/ripgrep_11.0.2-1build1_amd64.deb (--unpack):
 trying to overwrite '/usr/.crates2.json', which is also in package bat 0.12.1-1build1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/ripgrep_11.0.2-1build1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

tags: added: package-conflict
Revision history for this message
Zachariah Hayes (zhayes) wrote :

$ date
Sun 11 Oct 2020 01:38:28 PM PDT

$ sudo apt update
...
Fetched 1,404 kB in 1s (1,056 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.

$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

$ sudo apt-get install ripgrep
[sudo] password for zachariah:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  ripgrep
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/1,228 kB of archives.
After this operation, 4,502 kB of additional disk space will be used.
(Reading database ... 445348 files and directories currently installed.)
Preparing to unpack .../ripgrep_11.0.2-1build1_amd64.deb ...
Unpacking ripgrep (11.0.2-1build1) ...
dpkg: error processing archive /var/cache/apt/archives/ripgrep_11.0.2-1build1_amd64.deb (--unpack):
 trying to overwrite '/usr/.crates2.json', which is also in package bat 0.12.1-1build1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/ripgrep_11.0.2-1build1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal

$ apt --version
apt 2.0.2ubuntu0.1 (amd64)

Revision history for this message
Al Caps (alubu0066) wrote :

So I guess we're... waiting for a backport?

In the meanwhile, edit /var/lib/dpkg/info/ripgrep.list and remove the usr/.* junk that rust helpfully leaves around.

Revision history for this message
Seth Arnold (seth-arnold) wrote :

This still appears to be an issue on focal:

± apt-file search '/usr/.crates2.json'
bat: /usr/.crates2.json
cbindgen: /usr/.crates2.json
difference: /usr/.crates2.json
hexyl: /usr/.crates2.json
lalrpop: /usr/.crates2.json
lscolors: /usr/.crates2.json
nitrocli: /usr/.crates2.json
pulldown-cmark: /usr/.crates2.json
ripgrep: /usr/.crates2.json
rustdoc-stripper: /usr/.crates2.json
rusty-tags: /usr/.crates2.json
ucd-generate: /usr/.crates2.json
xml-rs: /usr/.crates2.json

Does apt-file work with updates or just what's in a release pocket?

Thanks

Revision history for this message
Tatsunori Uchino (tats-u) wrote :

No back port for 20.04 **LTS** planned?
How long will it take?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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