Closed d-torrance closed 2 years ago
.. but https://github.com/Macaulay2/M2/issues/1924 ...
Don't use canned examples, just turn on the options CacheExampleOutput and AuxiliaryFiles to newPackage. Then the next time you install the package, the output files will be cached for you, and you can add them to the repository.
If you want to, you could test for network access and set OptionalComponentsPresent appropriately. That way the example code will be run if possible.
okay. what's the fastest way of detecting whether there is network access?
Actually, it occurs to me that it's impolite to access the network when software is being built, unless the builder gives permission. That's why the configure script has an enable-download option. Maybe we don't test.
Actually, it occurs to me that it's impolite to access the network when software is being built, unless the builder gives permission. That's why the configure script has an enable-download option. Maybe we don't test.
Apologies for hijacking, but related to this -- building the JavaScript file for syntax highlighting (from #2391) requires network access (for npm install
). Should this be turned off by default?
Does that imply that there's an error on a machine without network access that prevents Macaulay2 from being built?
What's npm?
Does that imply that there's an error on a machine without network access that prevents Macaulay2 from being built?
What's npm?
npm is the "Node Package Manager", for dealing with JavaScript packages. Here's the current behavior:
npm
is installed on the system, then npm install
downloads a couple JavaScript packages (highlight.js
and webpack
) to build the highlight.js
file that is shipped with the Style
package for syntax highlighting the html documentation. If npm
is installed but there's no network access, then the build would fail. (I have the Debian package patched to use local copies of these things instead since there is no network access.)npm
is not installed, then all of this is skipped and highlight.js
is just an empty file, so no syntax highlighting.Perhaps the latter should be the default, even if npm
is available, and the former only when --enable-download
is given to configure
?
I've never installed npm here, and I haven't seen any builds fail.
We want to be able to build without network access. So we could either include the needed files in our source tree, or include the installation of npm and the running of npm install
as part of the INSTALL instructions for the builder.
I've never installed npm here, and I haven't seen any builds fail.
We want to be able to build without network access. So we could either include the needed files in our source tree, or include the installation of npm and the running of
npm install
as part of the INSTALL instructions for the builder.
Sounds good -- I'll work on something here soon.
OK so I'm not going to test for network access. I'm okay with caching the example anyway, but I find the documentation of newPackage
confusing. it says:
UseCachedExampleOutput => a Boolean value, default value null, whether installPackage should copy previously cached example output, if it is present and corresponds to the current example input for a node, rather than rerunning the examples, which might be important if optional external software is not present in the system. This is relevant only when CacheExampleOutput and AuxiliaryFiles are set to true. Unless set by the user, it is set to the negation of the value of OptionalComponentsPresent.
but the default value of OptionalComponentsPresent
is null, it says right above...
For now I'll just set CacheExampleOutput
to true and not worry about UseCachedExampleOutput
...
This was fixed in #2415
Network access may not be available during build. For example, from this PPA build:
Perhaps this example should be cached?