Skip to content

feat: Server library cleanup on paper install#4046

Open
harrisonablack wants to merge 2 commits intoitzg:masterfrom
harrisonablack:feat/serverLibraryCleanupPaper
Open

feat: Server library cleanup on paper install#4046
harrisonablack wants to merge 2 commits intoitzg:masterfrom
harrisonablack:feat/serverLibraryCleanupPaper

Conversation

@harrisonablack
Copy link
Copy Markdown

Adds support for itzg/mc-image-helper#748

Adds flag $CLEAN_SERVER_LIBRARIES which defaults to true. When set appends --clean-libraries to mc-image-helper call.

master already sets MC_HELPER_VERSION=1.57.2 > minimum 1.57.1 for the feature.

Two questions, do you want the feature true or false by default? And should documentation be added iteratively on each jar type support, or done at the end? if iteratively, added under Misc Options or would you suggest a better location?

Defaults to true, do we want this or default to false?
…ERVER_LIBRARIES

Split direct call to mc-image-helper on custom paper url to append
--clean-libraries flag
@harrisonablack
Copy link
Copy Markdown
Author

One thing of note, i found the warn on "Failed to read installed libraries" when initially installing noisy and unnecessary

mc-1  | [init] Changing ownership of /data to 1000 ...
mc-1  | [init] Running as uid=1000 gid=1000 with /data as 'drwxr-xr-x 2 1000 1000 64 May  7 12:59 /data'
mc-1  | [init] Image info: buildtime=local,version=local,revision=local
mc-1  | [init] Resolving type given paper
mc-1  | [mc-image-helper] 13:00:00.105 INFO  : Downloaded /data/paper-1.19.2-307.jar
mc-1  | [mc-image-helper] 13:00:00.112 WARN  : Failed to read installed libraries
mc-1  | java.nio.file.NoSuchFileException: /data/libraries
mc-1  | 	at java.base/sun.nio.fs.UnixException.translateToIOException(Unknown Source)
mc-1  | 	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source)

I realised however a check can be performed if the manifest exists from a previous install.
If the manifest exists, check for the libraries, if not safely skip as this will be an initial install.

That way the warn can be removed, which isn't really helpfull.
Can get a pr for this before proceeding with mc-image-helper support for more types

@itzg
Copy link
Copy Markdown
Owner

itzg commented May 7, 2026

i found the warn on "Failed to read installed libraries" when initially installing noisy and unnecessary

Yep, I was wondering about some of these scenarios. Yes, a PR to address that first would be great. I hadn't yet cut a release for Purpur library cleaning, so that can be included at same time.

@itzg
Copy link
Copy Markdown
Owner

itzg commented May 7, 2026

Two questions, do you want the feature true or false by default?

The way you have it, true by default makes sense to me. Then setting it to false can be a way to mitigate any unexpected behavior.

And should documentation be added iteratively on each jar type support, or done at the end? if iteratively, added under Misc Options or would you suggest a better location?

I like the non-specific variable name you introduced since it can be utilized across server types. As such, yeah that misc options area seems good.

@harrisonablack
Copy link
Copy Markdown
Author

i found the warn on "Failed to read installed libraries" when initially installing noisy and unnecessary

Yep, I was wondering about some of these scenarios. Yes, a PR to address that first would be great. I hadn't yet cut a release for Purpur library cleaning, so that can be included at same time.

itzg/mc-image-helper#759

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 this pull request may close these issues.

2 participants