unoconv / unoserver

MIT License
495 stars 69 forks source link

Add `--user-installation` flag to `unoserver` #76

Closed socheatsok78 closed 12 months ago

socheatsok78 commented 12 months ago

I found myself needing to have a persistence UserInstallation. This should add the ability to set custom --user-installation and still keep the old functionality the same.

regebro commented 12 months ago

Great, thanks!

Rafiot commented 10 months ago

Just FYI, if the user doesn't pass a path to user_installation, it falls back to None and raises the following exception:

terminate called after throwing an instance of 'com::sun::star::lang::WrappedTargetRuntimeException'
Unspecified Application Error                                                                                               

Fatal exception: Signal 6                                                     
Stack:        
/usr/lib/libreoffice/program/libuno_sal.so.3(+0x41502)[0x7f7c83cf9502]
/usr/lib/libreoffice/program/libuno_sal.so.3(+0x416ba)[0x7f7c83cf96ba]
/lib/x86_64-linux-gnu/libc.so.6(+0x3c4b0)[0x7f7c7e83c4b0]
/lib/x86_64-linux-gnu/libc.so.6(pthread_kill+0x11b)[0x7f7c7e890ffb]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x16)[0x7f7c7e83c406]
/lib/x86_64-linux-gnu/libc.so.6(abort+0xd7)[0x7f7c7e82287c]
/usr/lib/libreoffice/program/libmergedlo.so(+0x1217e69)[0x7f7c7fe17e69]
/usr/lib/libreoffice/program/libmergedlo.so(+0x24c3beb)[0x7f7c810c3beb]  
/usr/lib/libreoffice/program/libmergedlo.so(+0x3721af7)[0x7f7c82321af7]      
/usr/lib/libreoffice/program/libuno_sal.so.3(+0x19902)[0x7f7c83cd1902]
/usr/lib/libreoffice/program/libuno_sal.so.3(+0x41604)[0x7f7c83cf9604]                                                      
/lib/x86_64-linux-gnu/libc.so.6(+0x3c4b0)[0x7f7c7e83c4b0]
/lib/x86_64-linux-gnu/libc.so.6(pthread_kill+0x11b)[0x7f7c7e890ffb]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x16)[0x7f7c7e83c406]                                                               
/lib/x86_64-linux-gnu/libc.so.6(abort+0xd7)[0x7f7c7e82287c]
/lib/x86_64-linux-gnu/libstdc++.so.6(+0xa4ee6)[0x7f7c7e4a4ee6]                                                              
/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb6e9c)[0x7f7c7e4b6e9c]            
/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb6f07)[0x7f7c7e4b6f07]            
/lib/x86_64-linux-gnu/libstdc++.so.6(__cxa_rethrow+0x4b)[0x7f7c7e4b71bb]                                                    
/usr/lib/libreoffice/program/libmergedlo.so(+0xecdb4d)[0x7f7c7facdb4d]
/usr/lib/libreoffice/program/libmergedlo.so(+0x24d09ed)[0x7f7c810d09ed]
/usr/lib/libreoffice/program/libmergedlo.so(+0x24c93d6)[0x7f7c810c93d6]
/usr/lib/libreoffice/program/libmergedlo.so(_Z10ImplSVMainv+0x4a)[0x7f7c8232386a]
/usr/lib/libreoffice/program/libmergedlo.so(soffice_main+0x9c)[0x7f7c810e83ec] 
/usr/lib/libreoffice/program/soffice.bin(+0x10af)[0x55c7d5d410af]
/lib/x86_64-linux-gnu/libc.so.6(+0x23a90)[0x7f7c7e823a90]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x89)[0x7f7c7e823b49]
/usr/lib/libreoffice/program/soffice.bin(+0x10e5)[0x55c7d5d410e5]        
regebro commented 10 months ago

Hm, yeah, maybe there should be an explicit error there.

That said, starting unoserver this way will likely be unsupported in the future. Currently it works, because unoserver doesn't import the uno library, instead the converter client does that. I'm looking into changing that, probably by using xmlrpc, and letting the client be light and not require the uno library, and instead have the server do that. That means you can use the converter as a library, which is a lot more useful than using the server as a library.

Rafiot commented 10 months ago

Absolutely, the way I use the converter is... not clean :sob: https://github.com/pandora-analysis/pandora/blob/main/pandora/file.py#L44

regebro commented 10 months ago

Yeah, currently it's better to just run it as a separate process.