flathub / com.bambulab.BambuStudio

https://flathub.org/apps/details/com.bambulab.BambuStudio
13 stars 3 forks source link

Problem with locales #6

Closed grm closed 5 months ago

grm commented 5 months ago

Hello, i hope your are doing well. Grate job making a flatpak of bambulab !

I have a problem launching bambulab wich does not works out of the box :

I installed the latest version (but i had the same issue with beta flatpak images) :

$ flatpak run com.bambulab.BambuStudio
[2024-01-20 10:51:41.931972] [0x00007f43bacc4bc0] [trace]   Initializing StaticPrintConfigs
terminate called after throwing an instance of 'std::runtime_error'
  what():  locale::facet::_S_create_c_locale name not valid

Here are my locales :

LANG=fr_FR.UTF-8
LANGUAGE=en
LC_CTYPE="fr_FR.UTF-8"
LC_NUMERIC=fr_FR.UTF-8
LC_TIME=fr_FR.UTF-8
LC_COLLATE="fr_FR.UTF-8"
LC_MONETARY=fr_FR.UTF-8
LC_MESSAGES="fr_FR.UTF-8"
LC_PAPER=fr_FR.UTF-8
LC_NAME=fr_FR.UTF-8
LC_ADDRESS=fr_FR.UTF-8
LC_TELEPHONE=fr_FR.UTF-8
LC_MEASUREMENT=fr_FR.UTF-8
LC_IDENTIFICATION=fr_FR.UTF-8
LC_ALL=

but if I define LC_ALL using the command :

export LC_ALL=C.UTF-8

Bambustudio launches correctly. As i had multiple locales, i switched completely to only one, but the issue is still there.

I tried with the appimage and it launches without defining locales. Thanks for your help !

hadess commented 5 months ago

$ flatpak run com.bambulab.BambuStudio [2024-01-20 10:51:41.931972] [0x00007f43bacc4bc0] [trace] Initializing StaticPrintConfigs terminate called after throwing an instance of 'std::runtime_error' what(): locale::facet::_S_create_c_locale name not valid

This means that the "OS", in this case the Flatpak runtime, doesn't have support for the locale you selected. You can verify this with: flatpak run --command=ls com.bambulab.BambuStudio -lL /usr/lib/locale/ 2> /dev/null | grep 1970

On my system with English, French and Portuguese locales selected, I see all those locales available.

You add a new supported language to Flatpak by running: flatpak config --user --set languages en,fr and running flatpak update.

I implemented a feature in AccountsService so this will eventually get a UI in GNOME: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1969

The crash itself, instead of fallback, is a problem with BambuStudio and the C++ runtime: https://github.com/bambulab/BambuStudio/issues/3440

hadess commented 5 months ago

I implemented a work-around for that in https://github.com/flathub/com.bambulab.BambuStudio/pull/8 if you want to test it. It should be built in around 30 minutes.

grm commented 5 months ago

With the test version built from #8 , it works out of the box now :)

Thanks a lot