Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strange error message when installing older package #3307

Closed
mikestillman opened this issue Jun 16, 2024 · 12 comments · Fixed by #3382
Closed

strange error message when installing older package #3307

mikestillman opened this issue Jun 16, 2024 · 12 comments · Fixed by #3382

Comments

@mikestillman
Copy link
Member

I am trying to resurrect some older packages to place into M2. The package format for this package is likely no longer correct (I'm not sure of this yet). But I get the following when trying to install:

i1 : installPackage "TowerRings"
stdio:1:1:(3): error: makeDocumentTag: package cannot be determined: (adjustComputation,Computation)

There is no adjustComputation method in this package.

I'm not yet sure what the problem is.

Along the way, I am getting a few other error messages I don't understand. When I switch to 1.24.01-dirty.... (pretty much the current development branch) from version 1.23, and try to start M2, I get the following error message. I had removed the local end encap directories in the Application Support Macaulay2 directory. Perhaps this should be another issue, not sure yet.

i1 : restart
Macaulay2, version 1.24.05-154-g97d787b49-dirty (development)
with packages: ConwayPolynomials, Elimination, IntegralClosure, InverseSystems, Isomorphism, LLLBases, MinimalPrimes, OnlineLookup,
               PrimaryDecomposition, ReesAlgebra, Saturation, TangentCone, Truncations, Varieties
../../../../../M2-current-branches/M2-development/M2/Macaulay2/m2/installPackage.m2:333:44:(1):[10]: error: can't read directory '/Users/mike/Library/Application Support/Macaulay2/local/share/doc/Macaulay2/' : No such file or directory
../../../../../M2-current-branches/M2-development/M2/Macaulay2/m2/installPackage.m2:333:44:(1):[10]: --entering debugger (type help to see debugger commands)
../../../../../M2-current-branches/M2-development/M2/Macaulay2/m2/installPackage.m2:333:43-333:57: --source code:
                        contents := select(readDirectory docdir, fn -> fn != "." and fn != ".." );

After removing the local and encap subdirectories, it starts fine. @d-torrance did the structure of the directory change from 1.23 to 1.24?

Anyway, after doing this, I get the following:

i1 : needsPackage "TowerRings"

o1 = TowerRings

o1 : Package

i2 : installPackage "TowerRings"
stdio:2:1:(3): error: makeDocumentTag: package cannot be determined: (adjustComputation,Computation)

@d-torrance @DanGrayson @mahrud Any ideas what the problem is? I'll keep looking at it, but at the least, we probably need better error messages.

@mikestillman
Copy link
Member Author

mikestillman commented Jun 16, 2024

OK, if I then restart, I get an error:

Macaulay2, version 1.24.05-154-g97d787b49-dirty (development)
with packages: ConwayPolynomials, Elimination, IntegralClosure, InverseSystems, Isomorphism, LLLBases, MinimalPrimes, OnlineLookup,
               PrimaryDecomposition, ReesAlgebra, Saturation, TangentCone, Truncations, Varieties
../../../../../M2-current-branches/M2-development/M2/Macaulay2/m2/installPackage.m2:333:44:(1):[10]: error: can't read directory '/Users/mike/Library/Application Support/Macaulay2/local/share/doc/Macaulay2/' : No such file or directory
../../../../../M2-current-branches/M2-development/M2/Macaulay2/m2/installPackage.m2:333:44:(1):[10]: --entering debugger (type help to see debugger commands)
../../../../../M2-current-branches/M2-development/M2/Macaulay2/m2/installPackage.m2:333:43-333:57: --source code:
                        contents := select(readDirectory docdir, fn -> fn != "." and fn != ".." );

Not sure yet what the issue is....

EDIT: this part of the problem went away when #3301 was merged.

@d-torrance
Copy link
Member

I think the readDirectory error should be fixed when #3301 is merged.

@mikestillman
Copy link
Member Author

@d-torrance Thanks! I just "rebased and merged" that pull request.

@mahrud
Copy link
Member

mahrud commented Jun 16, 2024

Without knowing more about the package, I have no idea why this error might be occurring. Did you do debug Core or maybe define a Computation type?

@mikestillman
Copy link
Member Author

Yes, debug Core is being done there...

@mikestillman
Copy link
Member Author

I plan on changing that. I just merged in some of @d-torrance 's fixes, so I'll see where this stands now.

@mikestillman
Copy link
Member Author

After the PR merges today, this documentTag error still seems to be a problem, at least when running off a build tree.

@mahrud
Copy link
Member

mahrud commented Jun 16, 2024

In Utah, I kept seeing the same error, except for some random methods defined in Complexes. The problem in that case stemmed from our changes to a local version of Complexes, which was being loaded when we ran the tests but not while the examples were being generated by installPackage.

The solution in that case was to install Complexes from the local copy first, which was extremely time consuming, so I'd like to see installPackage use local copies of imported packages first before looking at the installed ones. This is probably doable, but I'm not sure what would be the unintended side effects.

@mikestillman
Copy link
Member Author

mikestillman commented Jun 16, 2024

In this case, removing debug Core, and adding a number of importFrom_Core { " ... " } lines instead fixed the problem. Still, the error message is completely inscrutable, and should be more informative!
EDIT: my mistake, this did not fix the documentTag problem.
EDIT of EDIT: actually, I had missed a debug Core before the package header. Removing that does fix this problem. Not sure how to fix the problem though in the case when the debug Core is there.

@mahrud I don't yet understand the problem you raise. That seems like a bug in installPackage?

@mahrud
Copy link
Member

mahrud commented Jun 16, 2024

I don't know. installPackage.m2 is probably due for an audit and maybe further simplification after four years.

@mahrud
Copy link
Member

mahrud commented Jun 17, 2024

I don't yet understand the problem you raise. That seems like a bug in installPackage?

Here's how to reproduce the issue I described above, in #3307 (comment):

  1. Make a copy of FirstPackage.m2 in your home directory.
  2. Edit firstFunction by adding:
firstFunction Thing := String => n -> "This is a thing!"
  1. Create MyPackage.m2 with contents:
newPackage(
    "MyPackage",
    Headline => "my package",
    PackageExports => { "FirstPackage" }
    )

TEST ///
  assert(firstFunction "foo" === "This is a thing!")
///

beginDocumentation()

doc ///
Node
  Key
    MyPackage
  Description
    Example
      firstFunction "foo"
///
  1. Now run:
loadPackage("FirstPackage", FileName => "./FirstPackage.m2")
loadPackage("MyPackage",    FileName => "./MyPackage.m2")

check "MyPackage" -- works fine
installPackage "MyPackage" -- fails with error:
-- i1 : firstFunction "foo"
-- stdio:1:8:(3): error: no method found for applying firstFunction to:
--      argument   :  "foo" (of class String)

Of course, the solution is to install the local copy of FirstPackage first, then install MyPackage, but this can be time consuming (e.g. if you just needed to fix a small bug in a very large package).

Is this a bug in installPackage? I don't know! It's certainly confusing to figure out and annoying to fix, but there may be unintended consequences in having installPackage look at the directories on path in order rather than just using the installed packages.

@mahrud
Copy link
Member

mahrud commented Aug 2, 2024

@mahrud mahrud linked a pull request Aug 2, 2024 that will close this issue
@mahrud mahrud closed this as completed Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants