Bug 11133 - xbuild doesn't invalidate outdated entries in the cache
Summary: xbuild doesn't invalidate outdated entries in the cache
Status: RESOLVED FIXED
Alias: None
Product: Tools
Classification: Mono
Component: xbuild ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-03-13 16:51 UTC by Andres G. Aragoneses
Modified: 2014-01-02 20:01 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Andres G. Aragoneses 2013-03-13 16:51:54 UTC
XBuild has a cache file that has things like these:

<PcFileCache>
  <File path="/usr/local/lib/pkgconfig/gtk-sharp-3.0.pc" lastWriteTime="2012-12-12T01:40:39+00:00" name="gtk-sharp-3.0" version="2.99.1" description="Gtk# - GNOME .NET Binding" requires="glib-sharp-3.0 gio-sharp-3.0" targetFramework=".NETFramework,Version=v2.0">
    <Assembly name="cairo-sharp" version="1.10.0.0" culture="neutral" publicKeyToken="0738eb9f132ed756" file="/usr/local/lib/mono/gtk-sharp-3.0/cairo-sharp.dll" />
    <Assembly name="gdk-sharp" version="3.0.0.0" culture="neutral" publicKeyToken="35e10195dab3c99f" file="/usr/local/lib/mono/gtk-sharp-3.0/gdk-sharp.dll" />
    <Assembly name="gtk-sharp" version="3.0.0.0" culture="neutral" publicKeyToken="35e10195dab3c99f" file="/usr/local/lib/mono/gtk-sharp-3.0/gtk-sharp.dll" />
  </File>
  ...

The problem with this is that xbuild doesn't remove entries from this cache file, so:

 - Entries get duplicated, like above.
 - Entries are not removed which should be removed, because they don't exist anymore in the system.

So if a person goes and uninstalls a package that has a .pc file referenced by xbuild, xbuild will still resolve references to the .pc file!

So there are several things we need to do here:
 - Not insert duped items (minor).
 - Remove <File> elements that map to a non-existent pc file.
 - Remove <Assembly> elements that map to a non-existent assembly.
Comment 1 Andres G. Aragoneses 2013-03-13 16:53:06 UTC
Forgot to say, I found this file here: $HOME/.config/xbuild/pkgconfig-cache-2.xml
Comment 2 Daniel Hughes 2013-06-08 06:36:18 UTC
I just ran into a problem which turned out to be caused by this bug. I removed a package and when I attempted to build with xbuild it tried to use the assembly from the package which was no longer installed.

Deleting the cache file $HOME/.config/xbuild/pkgconfig-cache-2.xml resolved the problem.
Comment 3 phoyd 2013-10-16 09:55:45 UTC
Same problem here. An existing xbuild cache broke my schroot build, because the cache refered to items that did not exist inside the schroot.

Deleting the cache fixed that for me.
Comment 4 Antonius Riha 2013-12-31 05:02:50 UTC
I made a pull request with a fix for this issue: https://github.com/mono/mono/pull/849
Comment 5 Andres G. Aragoneses 2014-01-02 20:01:57 UTC
Thanks!