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

Using CLI to change bundle identifier always results in Low Memory error #63

Closed
v-sypayr opened this issue Jan 22, 2020 · 3 comments
Closed

Comments

@v-sypayr
Copy link

v-sypayr commented Jan 22, 2020

Issue:

When using the CLI to change the identifier of a particular bundle using the command
packagesutil --file <pkgproj path> set package-<index> identifier <string>
any valid string returns the error "packagesutil: Low memory"

Examples of strings tested include defaultIdentifier and com.mypackage.pkg.application, in the format packagesutil --file <pkgproj path> set package-1 identifier defaultIdentifier. These are valid identifiers when using the GUI to save the pkgproj, but do not work from the CLI using the above command.

Possible Cause:

The pertinent line in PUUtilities.m may have a bug. Please see

if (tFormatter!=nil)
{
(void)fprintf(stderr, "%s: Low memory\n",__PACKAGESUTIL_NAME__);
return NO;
}
This is where the "packagesutil: Low memory" error arises.

Possible Solution:

It seems that if (tFormatter!=nil) may need to be if (tFormatter==nil) instead. When PKGBundleIdentifierFormatter initializes, it stores NSCharacterSet * _forbiddenCharacterSet;. It may be that if packagesutil is truly out of memory and PKGBundleIdentifierFormatter was not able to initialize properly, then the stored value will be nil. In this case, a properly initialized PKGBundleIdentifierFormatter would always trigger the error condition, which seems consistent with current symptoms.

Request:

Would it be possible to check this issue, or otherwise resolve why the CLI can't be used to rename bundle identifiers? This is a very useful functionality for automating packaging workflows with Packages.

Thank you for your help!

@rudyrichter
Copy link

yeah, it looks like tFormatter==nil would be the right early return there.

@packagesdev
Copy link
Owner

You're right. Will be fixed in the next minor update.

packagesdev pushed a commit that referenced this issue Mar 28, 2020
Fix test
@packagesdev
Copy link
Owner

Fixed in 1.2.9.

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

No branches or pull requests

3 participants