34

Edit From the author of this question

This question is obsolete
Since 2016 there is a lot of new stuff concerning Paclets.
They are now documented.
End of the Edit

It turns out that some silent updating may be done in our computers with paclets. See for example here. How are we aware that something has been changed ? Can we track updating/versions of paclets ?

One can inspect the dates of the files in the Paclets directory, but in the case of the example above, the date of the file was anterior to the release of the paclet (a few days). I couldn't say if something new had been downloaded, but in fact it was the case because the mentioned bug had disappeared.

Also, do paclets from non-official paclet sites also auto-update? Is it possible to adjust the updating frequency, or disable updating? Is it possible to do it separately for each site?

andre314
  • 18,474
  • 1
  • 36
  • 69

1 Answers1

20

This posting is not a complete answer. Rather, it is a spelunking report concerning the kernel initialization sequence in version 11.0.1 as it relates to automatic paclet updating.

In summary, every three days the system initialization sequence will automatically update paclets that are loaded from $PacletSite. $PacletSite is normally http://pacletserver.wolfram.com, although malicious software could change that.

The automatic updating will not occur if the kernel is started with either the -nopaclet or -layoutpaclets command line arguments, but these arguments have other consequences as well. We can also $AllowInternet = False, but this has wider consequences too.

Other paclet sites are not updated by this mechanism. However, there is nothing stopping a loaded paclet from installing its own mechanism. Furthermore, the system sometimes updates other paclets on-demand during normal operation -- usually, but not always, data paclets. This latter behaviour will need to be the subject of a future spelunking report.

System Initialization Details

For those who wish to follow along, define the following function:

opensys[args__] :=
  {$InstallationDirectory, "SystemFiles", args} // FileNameJoin // NotebookOpen

System initialization begins in the file:

opensys["Kernel", "SystemResources", $SystemID, "sysinit.m"];

As part of the start-up, PacletManager`Package`preparePacletManager[] is invoked. The definition for this function is in:

opensys["Autoload", "PacletManager", "Kernel", "Manager.m"];

It calls PacletManager`Package`initializePacletManager from the same file. If the kernel is started up with an option -nopaclet or -layoutpaclets on the command line, then it sets the variable PacletManager`Package`$pmMode to be "ReadOnly", or "Normal" otherwise. Later, it calls PacletManager`Package`initializeSites which can be found in this file:

opensys["Autoload", "PacletManager", "Kernel", "Services.m"];

If the mode is not read-only, then it calls PacletManager`Services`Private`doWeeklyUpdate from the same file. This will check the paclet information accessible from PacletManager`Services`Private`getPacletSiteData[]. It extracts the paclet information for the site contained in $PacletSite, whose value is normally:

$PacletSite
(* "http://pacletserver.wolfram.com" *)

If the last successful update of that site is older than three days, then PacletSiteUpdate is called upon that site.

Nowhere along this tour do we find evidence of any fine-grained control mechanisms for this update activity. We can use of aforementioned command line arguments, or set $AllowInternet to be False, but these have wider consequences.

WReach
  • 68,832
  • 4
  • 164
  • 269
  • @Szabolcs Thanks for the bounty despite my response being skeletal (apologies). Such are the perils of acclamation... :) – WReach Dec 08 '16 at 15:50