holzschu / a-shell

A terminal for iOS, with multiple windows
BSD 3-Clause "New" or "Revised" License
2.66k stars 116 forks source link

"Package not found" constant error #561

Closed sykeben closed 1 year ago

sykeben commented 1 year ago

Every time I attempt to install any package using pkg install [name] I always receive Package [name] not found.

I have tried double-checking my network configuration (I'm an on-campus student) and I am able to contact the package repository server, so I'm not sure what's happening.

holzschu commented 1 year ago

Yes, it's an issue introduced by a recent upgrade. I'm trying to understand what is causing it. It should be fixed soon (but right now I'm scratching my head).

sykeben commented 1 year ago

Hmmmmmmm... That is quite odd. There might be a recently upgraded library you're using that may have changed something in an unexpected way, perhaps?

holzschu commented 1 year ago

Yes, I think this was introduced between versions 1.10.4 and 1.10.5, but reverting the code to 1.10.4 does not fix the issue (to be more precise: I have a fix for the issue "package not found", but the second call to pkg crashes the app).

sykeben commented 1 year ago

I think this was introduced between versions 1.10.4 and 1.10.5, but reverting the code to 1.10.4 does not fix the issue

I would look at the various checks you perform to see if a package is found, and look at the libraries that are referenced and check the change logs on those and see if anything was changed between the releases of 1.10.4 and 1.10.5.

I have a fix for the issue "package not found", but the second call to pkg crashes the app

Sounds like that could be a memory leak or maybe an out-of-bounds issue caused by some variables not being properly initialized the second time. I don't develop iOS apps, so I don't know how Apple's debugger works, but does it give you a stacktrace when the app crashes?

sykeben commented 1 year ago

I took a look at the pkg script and it looks like the output from grep isn't being written to the temporary file your using properly, causing length to always be 0 or incorrect.

There might be a bug in the implementation of grep that's being used that's causing it to not properly interact with stdout redirection?

As a sanity check I tried double-quoting the search query and I got a new error: (23) Failed writing body, so there might be a permissions issue or a misuse of file APIs that's preventing the temporary file from being written to.

holzschu commented 1 year ago

Hi, it will be fixed in the next version.

sykeben commented 1 year ago

Sounds good! Hope I was able to help.

Seas0 commented 1 year ago

Seems fixed to me now.

sykeben commented 1 year ago

I can confirm! I'll close this issue.