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

Fix linux installation for newer Unity versions #387

Merged
merged 1 commit into from
Dec 11, 2023

Conversation

Larusso
Copy link
Owner

@Larusso Larusso commented Dec 11, 2023

Description

It seems a very old bug suddenly surfaced.
The linux pkg install logic is reading the contents of the archive into memory and passing it down to the stdin for the cpio command. I used the singe write call to copy the buffer to the stdin without checking if all bytes are actually written. It seems pure luck that this worked until now. It seems that in recent versions of Unity some packages got so big that a single call to write wasn't writing all the bytes into the memory location.

I replaced the logic with a filestream copy instead. Something I should have done to begin with ...

Description
============

It seems a very old bug suddenly surfaced.
The linux pkg install logic is reading the contents of the archive
into memory and passing it down to the stdin for the `cpio` command.
I used the singe `write` call to copy the `buffer` to the `stdin` without
checking if all bytes are actually written. It seems pure luck that this
worked until now. It seems that in recent versions of Unity some packages
got so big that a single call to `write` wasn't writing all the bytes into the
memory location.

I replaced the logic with a filestream copy instead. Something I should have done
to begin with ...
Copy link

@Azurelol Azurelol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nods confidently

@Larusso Larusso merged commit aeada01 into master Dec 11, 2023
3 checks passed
@Larusso Larusso deleted the fix/linux_pkg_installer branch December 11, 2023 09:44
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