Macaulay2 / M2

The primary source code repository for Macaulay2, a system for computing in commutative algebra, algebraic geometry and related fields.
https://macaulay2.com
343 stars 230 forks source link

Build path included in example output #1149

Closed d-torrance closed 4 years ago

d-torrance commented 4 years ago

The build path is included in quite a few example output files used in the documentation. This makes reproducible builds impossible.

For example

profzoom@gloria:~$ diff -u /usr/share/doc/Macaulay2/Macaulay2Doc/example-output/___Print.out ~/tmp/m2/usr/share/doc/Macaulay2/Macaulay2Doc/example-output/___Print.out 
--- /usr/share/doc/Macaulay2/Macaulay2Doc/example-output/___Print.out   2019-11-30 13:05:14.000000000 -0500
+++ /home/profzoom/tmp/m2/usr/share/doc/Macaulay2/Macaulay2Doc/example-output/___Print.out  2015-09-06 00:03:15.000000000 -0400
@@ -2,7 +2,7 @@

 i1 : code Thing#{Standard,Print}

-o1 = /home/dan/src/M2/M2.git/M2/Macaulay2/m2/robust.m2:130:28-146:19: --source code:
+o1 = /build/macaulay2-1.14.0.1.730.g1557b415b/M2/Macaulay2/m2/robust.m2:130:28-146:19: --source code:
      Thing#{Standard,Print} = x -> (
           oprompt := concatenate(interpreterDepth:"o", toString lineNumber, " = ");
           save := printWidth;

I suppose this could be fixed using sed during build, swapping out the build directory for the eventual installation directory.

DanGrayson commented 4 years ago

Reproducible builds might be a good idea -- do you have an application for them?

To fix the problem of including absolute paths in files, we could switching to relative paths in all such output. The relative path would always be the same.

d-torrance commented 4 years ago

Reproducible builds are a big thing for Debian (https://wiki.debian.org/ReproducibleBuilds). I stumbled on this build path issue because of a bunch of Lintian warnings from my current draft of the Macaulay2 Debian package. In particular, "file-references-package-build-path":

The listed file or maintainer script appears to reference the build path used to build the package as specified in the Build-Path field of the .buildinfo file.

This is likely to cause the package to be unreproducible, but it may also indicate that the package will not work correctly outside of the maintainer's own system.

Please note that this tag will not appear unless the .buildinfo file contains a Build-Path field. That field is optional. You may have to set DEB_BUILD_OPTIONS=buildinfo=+path or use --buildinfo-option=--always-include-path with dpkg-buildpackage when building.

Refer to https://reproducible-builds.org/, https://wiki.debian.org/ReproducibleBuilds/BuildinfoFiles, and the dpkg-genbuildinfo(1) manual page for details.

d-torrance commented 4 years ago

Would the nice Emacs feature that lets you pull up the source code by pressing enter with your cursor on the line containing the path to the source after running code still work with relative paths?

DanGrayson commented 4 years ago

Let's drop setting the Build-Path field.

Yes, relative paths work fine in emacs. (The current directory of the buffer has to agree with the current directory of M2, and it does.) Of course, if you save some output into a file and then view it later with a different current directory, it will not work.

Here's another problem with reproducible builds:

i16 : version

o16 = HashTable{architecture => x86_64                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 }
                atomic_ops version => 7.6.10
                build => x86_64-apple-darwin18.7.0
                compile node name => einsteinium
                compile time => Nov 30 2019, 14:30:53
                compiler => clang 11.0.0 (clang-1100.0.33.12)
                configure arguments =>  '--enable-encap' '--enable-download' '--enable-strip' '--enable-dmg' '--enable-build-libraries=' 'CC=' 'CXX=' 'FC=' 'AR=' 'CPPFLAGS=-I/usr/local/opt/readline/include' 'LDFLAGS=-L/usr/local/opt/readline/lib' '--prefix=/usr' '--build=x86_64-apple-darwin18.7.0' 'build_alias=x86_64-apple-darwin18.7.0'
                dumpdata => false
                endianness => dcba
                executable extension => 
                factory version => 4.1.1
                fflas_ffpack version => 2.3.2
                flint version => 2.5.2
                frobby version => 0.9.0
                gc version => 8.0.4
                gdbm version => GDBM version 1.18.1. 27/10/2018 (built Oct 29 2018 06:32:37)
                git description => version-1.15-1-ga37aa5f6ec6c4f16d39d5bc233c2b400864c4c0f
                givaro version => 4.0.2
                gmp version => not present
                host => x86_64-apple-darwin18.7.0
                issue => MacOS-10.14.6
                linbox version => not present
                M2 name => M2
                M2 suffix => 
                machine => x86_64-Darwin-MacOS-10.14.6
                mathic version => 1.0
                mathicgb version => 1.0
                memtailor version => 1.0
                mpfr version => 4.0.2
                mpir version => 3.0.0
                mysql version => not present
                ntl version => 10.5.0
                operating system release => 18.7.0
                operating system => Darwin
                packages => Style Macaulay2Doc FirstPackage Parsing Classic Browse Benchmark Text SimpleDoc PackageTemplate PrimaryDecomposition FourierMotzkin Dmodules Depth Elimination GenericInitialIdeal IntegralClosure HyperplaneArrangements LexIdeals Markov NoetherNormalization Points ReesAlgebra Regularity SchurRings SymmetricPolynomials SchurFunctors SimplicialComplexes LLLBases TangentCone ChainComplexExtras Schubert2 PushForward LocalRings PruneComplex BoijSoederberg BGG Bruns InvolutiveBases ConwayPolynomials EdgeIdeals FourTiTwo StatePolytope Polyhedra Truncations Polymake gfanInterface PieriMaps Normaliz Posets XML OpenMath SCSCP RationalPoints MapleInterface ConvexInterface SRdeformations NumericalAlgebraicGeometry BeginningMacaulay2 FormalGroupLaws Graphics WeylGroups HodgeIntegrals Cyclotomic Binomials Kronecker Nauty ToricVectorBundles ModuleDeformations PHCpack SimplicialDecomposability BooleanGB AdjointIdeal Parametrization Serialization NAGtypes NormalToricVarieties DGAlgebras Graphs GraphicalModels BIBasis KustinMiller Units NautyGraphs VersalDeformations CharacteristicClasses RandomIdeals RandomObjects RandomPlaneCurves RandomSpaceCurves RandomGenus14Curves RandomCanonicalCurves RandomCurves TensorComplexes MonomialAlgebras QthPower EliminationMatrices EllipticIntegrals Triplets CompleteIntersectionResolutions MCMApproximations MultiplierIdeals InvariantRing QuillenSuslin EnumerationCurves Book3264Examples Divisor EllipticCurves HighestWeights NumericalHilbert MinimalPrimes Bertini TorAlgebra Permanents BinomialEdgeIdeals TateOnProducts LatticePolytopes FiniteFittingIdeals HigherCIOperators LieTypes ConformalBlocks M0nbar AnalyzeSheafOnP1 MultiplierIdealsDim2 RunExternalM2 NumericalSchubertCalculus ToricTopology Cremona Resultants VectorFields SLPexpressions Miura ResidualIntersections Visualize EquivariantGB ExampleSystems RationalMaps FastLinAlg SpectralSequences SectionRing OldPolyhedra OldToricVectorBundles K3Carpets ChainComplexOperations NumericalCertification PhylogeneticTrees MonodromySolver ReactionNetworks PackageCitations NumericSolutions GradedLieAlgebras InverseSystems Pullback EngineTests SVDComplexes RandomComplexes CohomCalg Topcom ReflexivePolytopesDB AbstractToricVarieties Licenses TestIdeals FrobeniusThresholds Seminormalization AlgebraicSplines TriangularSets Chordal Tropical SymbolicPowers Complexes GroebnerWalk RandomMonomialIdeals Matroids NumericalImplicitization NonminimalComplexes CoincidentRootLoci RelativeCanonicalResolution RandomCurvesOverVerySmallFiniteFields StronglyStableIdeals SLnEquivariantMatrices CorrespondenceScrolls NCAlgebra SpaceCurves ExteriorIdeals ToricInvariants SegreClasses SemidefiniteProgramming SumsOfSquares MultiGradedRationalMap VirtualResolutions Quasidegrees DiffAlg DeterminantalRepresentations FGLM SpechtModule SpecialFanoFourfolds SchurComplexes
                pari version => 2.11.2
                pointer size => 8
                python version => not present
                readline version => 8.0
                scscp version => not present
                VERSION => 1.15

o16 : HashTable

I put a lot of that info in there so I could figure out what version of M2 the user was running when a bug report comes in. But I admit it isn't often used.

d-torrance commented 4 years ago

Closing as this was fixed with #1337.