[raiguard][2.0.7] Importing large strings is broken on Linux

Post Reply
PALKOVNIK
Manual Inserter
Manual Inserter
Posts: 3
Joined: Mon Oct 21, 2024 7:41 pm
Contact:

[raiguard][2.0.7] Importing large strings is broken on Linux

Post by PALKOVNIK »

Steps to reproduce:
- grab the KoS book from https://drive.google.com/drive/folders/ ... MjGkoRkOAg
- try to import it in game

Result:
- nothing happens at all

Breaking down the string into smaller chunks allows me to paste the chunks one by one in the import window in game, but import still fails in the end with error saying "decompression failed".

User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 557
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

Re: [2.0.7] Importing large strings is broken on Linux

Post by raiguard »

Please try switching to Wayland in the graphics settings.
Don't forget, you're here forever.

User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 557
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

Re: [2.0.7] Importing large strings is broken on Linux

Post by raiguard »

A bit of background on this:

This is a known issue. In the past, we worked around this by implementing custom X11 clipboard code. However, for 2.0, I have removed our dependency on X11 and switched to using SDL's clipboard functions. SDL2 does not support the mechanism required to transfer large clipboard contents on X11, but this has been fixed for SDL3.

In other words, the only way to fix it is to switch to Wayland, or wait for us to update to SDL3 at some unknown point in the future.

I'm sorry!
Don't forget, you're here forever.

PALKOVNIK
Manual Inserter
Manual Inserter
Posts: 3
Joined: Mon Oct 21, 2024 7:41 pm
Contact:

Re: [2.0.7] Importing large strings is broken on Linux

Post by PALKOVNIK »

I can't switch to wayland :/ To be frank I'm quite sad you are using SDL, it sucks enormously

User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 557
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

Re: [2.0.7] Importing large strings is broken on Linux

Post by raiguard »

SDL is far better than what we were using before. :)

In any case, I just ran into this when I was copying a not-even-that-large blueprint for a different bug report (I run the game under xwayland while debugging for a few reasons) so I'll look into seeing how difficult it would be to backport the fix from SDL3 into SDL2.
Don't forget, you're here forever.

credomane
Filter Inserter
Filter Inserter
Posts: 282
Joined: Tue Apr 12, 2016 6:21 pm
Contact:

Re: [2.0.7] Importing large strings is broken on Linux

Post by credomane »

Same. Wayland is still a pain to use when you just want everything to work. I'm super excited for the changes that frog-protocols has already kicked up in wayland so hopefully that will start changing in the next couple years. That and Nvidia quit being difficult too.


I remember reading the FFF that talked about X11/wayland where this breakage was mentioned. Reasoning being to massively reduce dependencies (a good thing!) but I was hopeful something would have been put in place to resolve that by release.

Would it be possible to have the ability to open a file dialog window to open a txt file with the blueprint string in it instead? Just make the factorio client process the file like it was actually a normal clipboard import so it doesn't break the lock-step/syncronization in multiplayer? Probably not, since SDL2 doesn't have native file dialogs....but SDL3 does. lol. Hopefully a port to SDL3 isn't prohibitively difficult and will happen at some point.

Would it at least be possible to detect the BP string was incomplete/corrupt and that you are on Linux running X11 then provide feedback of some sort instead of silently failing?

User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 557
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

Re: [2.0.7] Importing large strings is broken on Linux

Post by raiguard »

credomane wrote:
Tue Oct 22, 2024 8:11 pm
Same. Wayland is still a pain to use when you just want everything to work. I'm super excited for the changes that frog-protocols has already kicked up in wayland so hopefully that will start changing in the next couple years. That and Nvidia quit being difficult too.
I've been running wayland for years, but I have an AMD GPU. Sometimes I forget that wayland is still a PITA for those with NVIDIA cards.

credomane wrote:
Tue Oct 22, 2024 8:11 pm
I remember reading the FFF that talked about X11/wayland where this breakage was mentioned. Reasoning being to massively reduce dependencies (a good thing!) but I was hopeful something would have been put in place to resolve that by release.
I had intended on adding the capability to SDL2, but the changes were too invasive so it was put into SDL3. SDL2 is in "maintenance mode".
credomane wrote:
Tue Oct 22, 2024 8:11 pm
Would it be possible to have the ability to open a file dialog window to open a txt file with the blueprint string in it instead? Just make the factorio client process the file like it was actually a normal clipboard import so it doesn't break the lock-step/syncronization in multiplayer? Probably not, since SDL2 doesn't have native file dialogs....but SDL3 does. lol. Hopefully a port to SDL3 isn't prohibitively difficult and will happen at some point.
Yeah, SDL3 will have convenient open-file dialogs, but that is SDL3, not SDL2. And upgrading to SDL3 will be a pretty involved process.,
credomane wrote:
Tue Oct 22, 2024 8:11 pm
Would it at least be possible to detect the BP string was incomplete/corrupt and that you are on Linux running X11 then provide feedback of some sort instead of silently failing?
Unfortunately not. When you try to paste a large blueprint, the game receives nothing because X11 tries to send it over INCR, but the game doesn't support it so it doesn't see anything.


There are two paths forward: either I try to backport the SDL3 fix into SDL2, or I re-introduce our custom clipboard code and try to figure out how to link against X11 at runtime (to avoid requiring X11 to be installed for the game to run at all). Both solutions sound like royal pains. I promise I will look into it, but it may take a little while.
Don't forget, you're here forever.

credomane
Filter Inserter
Filter Inserter
Posts: 282
Joined: Tue Apr 12, 2016 6:21 pm
Contact:

Re: [raiguard][2.0.7] Importing large strings is broken on Linux

Post by credomane »

If it isn't possible then it isn't possible. Just sucks is all.

Yeah my next GPU is definitely gonna be team AMD just because of the headaches with nvidia and linux.

Post Reply

Return to “Assigned”