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

Linux -- runs but requires libbambu_networking plugin #122

Closed
wants to merge 17 commits into from

Conversation

deftdawg
Copy link
Contributor

@deftdawg deftdawg commented Aug 13, 2022

  • Part way a Linux build (fix for 🐧 Build for Linux #12): builds, links, creates AppImage and starts. But requires libbambu_networking plugin which doesn't exist in this git repo

@deftdawg deftdawg changed the title Linux Linux -- works but requires libbambu_networking plugin Aug 13, 2022
@deftdawg deftdawg changed the title Linux -- works but requires libbambu_networking plugin Linux -- runs but requires libbambu_networking plugin Aug 13, 2022
@gihad
Copy link

gihad commented Aug 15, 2022

That's awesome! I hope they merge this PR in. I already have my X1 Carbon but my printing room PC only runs linux.

Copy link

@maxiangelo maxiangelo left a comment

Choose a reason for hiding this comment

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

good work

@gihad
Copy link

gihad commented Aug 19, 2022

@deftdawg Do you have instructions for running this?

@gihad
Copy link

gihad commented Aug 29, 2022

@lanewei120 Can you tell us anything about a linux build? It seems that the community got to a point where we are blocked because there is no access to libbambu_networking

Are you able to help with this?

@lanewei120
Copy link
Collaborator

lanewei120 commented Aug 30, 2022

@lanewei120 Can you tell us anything about a linux build? It seems that the community got to a point where we are blocked because there is no access to libbambu_networking

Are you able to help with this?

libbambu_networking is just a plugin, the app can run without it.
maybe there are some codes not considering the linux environment

I am sorry for the late reply, we are preparing the new version v1.2.0,
and we will spend time on the issue of linux after this version released;
we will solve these issues with the community together

Copy link
Collaborator

@lanewei120 lanewei120 left a comment

Choose a reason for hiding this comment

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

we have submitted a fix for the wxWidgets compiling under linux before,
it should fixed the '-ldep-name-NOTFOUND' issue for v3.1.5
you can try it and remove the changes of this part

@deftdawg
Copy link
Contributor Author

deftdawg commented Sep 8, 2022

We get the SSL certs dialog on first run, then we crash:

Thread 1 "bambu-studio" received signal SIGSEGV, Segmentation fault.
0x0000555556832718 in ComboBox::SetFont(wxFont const&) ()
(gdb) bt
#0  0x0000555556832718 in ComboBox::SetFont(wxFont const&) ()
#1  0x000055555860b405 in wxWindowBase::InheritAttributes() ()
#2  0x00005555586f3276 in wxWindow::PostCreation() ()
#3  0x00005555586f3605 in wxWindow::Create(wxWindow*, int, wxPoint const&, wxSize const&, long, wxString const&) ()
#4  0x00005555568405fb in StaticBox::Create(wxWindow*, int, wxPoint const&, wxSize const&, long) ()
#5  0x000055555684c3f1 in TextInput::Create(wxWindow*, wxString, wxString, wxString, wxPoint const&, wxSize const&, long) ()
#6  0x0000555556834e09 in ComboBox::ComboBox(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, int, wxString const*, long) ()
#7  0x000055555659aad6 in Slic3r::GUI::PresetComboBox::PresetComboBox(wxWindow*, Slic3r::Preset::Type, wxSize const&, Slic3r::PresetBundle*) ()
#8  0x0000555556776029 in Slic3r::GUI::DiffPresetDialog::DiffPresetDialog(Slic3r::GUI::MainFrame*)::{lambda(Slic3r::GUI::PresetComboBox**, Slic3r::PresetBundle*)#1}::operator()(Slic3r::GUI::PresetComboBox**, Slic3r::PresetBundle*) const ()
#9  0x000055555677f189 in Slic3r::GUI::DiffPresetDialog::DiffPresetDialog(Slic3r::GUI::MainFrame*) ()
#10 0x00005555564eb0c6 in Slic3r::GUI::MainFrame::MainFrame() ()
#11 0x00005555564b20cc in Slic3r::GUI::GUI_App::on_init_inner() ()
#12 0x00005555564b31fa in Slic3r::GUI::GUI_App::OnInit() ()
#13 0x0000555558852b57 in wxEntry(int&, wchar_t**) ()
#14 0x0000555556489dcb in Slic3r::GUI::GUI_Run(Slic3r::GUI::GUI_InitParams&) ()
#15 0x0000555555d5d7b3 in Slic3r::CLI::run(int, char**) ()
#16 0x0000555555cc6e19 in main ()

Potential problems for Linux that still need to be worked out:

  1. I don't think bambustudio_main can be used as a thread name (17 chars; 1 longer than the buffer), at least not for GNU/Linux... Thread.cpp has a buffer length of 16, and it looks the underlying GNU library shares that limit in it's NAMELEN value.
    bambustudio_main is referenced here:
    if (current_thread_name && *current_thread_name != "bambustudio_main")

Currently in my Linux PR I've made the current_thread_name check conditional to WIN32, however I'm not sure if that's the best approach.

  1. starting without ~/.config/BambuStudio/ existing prior to the app starting, Bambu Studio gives an unhandled exception because of Boost logging

    Uncaught exception: boost::filesystem::create_directory: No such file or directory: "/home/deftdawg/.config/BambuStudio/log"
    Unhandled unknown exception; terminating the application.
    

    if mkdir -p ~/.config/BambuStudio/ is run, prior the app will start and then segfault.

    I recall seeing an exception handler somewhere in the code, but perhaps its not conditionally defined for Linux?

@lanewei120
Copy link
Collaborator

there should be lots of issues under linux, we are starting to solve them.

for this pull request, we can merge it as a patch for first linux buildable version.
however we need to do a cleanup(keep the author information and merge them into a few commits )
we will do it soon

thanks very much

@deftdawg
Copy link
Contributor Author

deftdawg commented Sep 9, 2022

Sure merge, patch or cherry pick... Whatever you need to do.

Just hoping we can get it running soon so I can finally use my X1C. (Wine+BambuStudio runs, but EdgeWebViewer is broken, so no home tab, can't login, pick printer profiles and stuff and network plugin doesn't run either)

Let me know if there's anything I can help you with further or anything else you need.

@lanewei120
Copy link
Collaborator

lanewei120 commented Sep 15, 2022

already merged these patches into one and fix some small issues

Author: DeftDawg DeftDawg@gmail.com
Date: Fri Aug 12 23:57:54 2022 -0400

Add Linux related build scripts

including following changes:
- Linux build scripts from SuperSlicer project;
- Update BuildLinux dev dependencies, remove unused bits;
- Update BuildLinuxImage to use nproc for cpus;
- CMake: render BuildLinuxImage and build_appimage templates;
- Fix "DSO missing" linking problems;
- Add Podman Containerfile for building;
- Update BuildLinux.sh to work better in container build;
- fixes to create AppImage inside container;
- add env to build environment;
- Update build instructions in Containerfile;

Change-Id: I73e30ab488cda8c1b0886cd34858e125596f282b
(cherry picked from commit 83fc26670ca592c91c7af1d4033a04b587cfd4cd)

@wms
Copy link

wms commented Sep 15, 2022

I'm still mid-compile so don't know if a functional Linux build is possible yet, but it appears to be progressing.

I initially encountered Could not find a package configuration file provided by "ECM" and had to run the following to fix:

sudo apt install extra-cmake-modules

This is on Ubuntu 20.04 - if other folks can reproduce, its probably sensible to update BuildLinux.sh to ensure this dep is installed when running with the -u flag.

@wms
Copy link

wms commented Sep 15, 2022

Despite a successful compilation, I'm seeing a segfault on startup, similar to has been reported before:

./build/BambuStudio_ubu64.AppImage
[2022-09-15 10:09:06.945516] [0x00007f6ed0b7b900] [trace]   Initializing StaticPrintConfigs
loading network module at /home/warren/.BambuStudio/plugins/libbambu_networking.so
error, dlerror is /home/warren/.BambuStudio/plugins/libbambu_networking.so: cannot open shared object file: No such file or directory
after dlopen, network_module is (nil)
fish: Job 1, './build/BambuStudio_ubu64.AppIm…' terminated by signal SIGSEGV (Address boundary error)

@deftdawg
Copy link
Contributor Author

I'm still mid-compile so don't know if a functional Linux build is possible yet, but it appears to be progressing.

I initially encountered Could not find a package configuration file provided by "ECM" and had to run the following to fix:

sudo apt install extra-cmake-modules

This is on Ubuntu 20.04 - if other folks can reproduce, its probably sensible to update BuildLinux.sh to ensure this dep is installed when running with the -u flag.

My last commit to the branch should have installed that package for you... Might be a bug in my if condition check.

@deftdawg
Copy link
Contributor Author

Despite a successful compilation, I'm seeing a segfault on startup, similar to has been reported before:

./build/BambuStudio_ubu64.AppImage
[2022-09-15 10:09:06.945516] [0x00007f6ed0b7b900] [trace]   Initializing StaticPrintConfigs
loading network module at /home/warren/.BambuStudio/plugins/libbambu_networking.so
error, dlerror is /home/warren/.BambuStudio/plugins/libbambu_networking.so: cannot open shared object file: No such file or directory
after dlopen, network_module is (nil)
fish: Job 1, './build/BambuStudio_ubu64.AppIm…' terminated by signal SIGSEGV (Address boundary error)

You're all caught up! 😄

It segfaults on combobox::set font, refer to the gdb backtrace I posted a few comments ago... My best guess is that it's trying to paint on a window that's not ready to be painted or something... But I don't know for sure what is going on.

@wms
Copy link

wms commented Sep 15, 2022

Sorry, I should have been more specific - those comments were based off me running latest master following the recent merge as detailed in this comment: #122 (comment)

@deftdawg
Copy link
Contributor Author

Oh fair play, @lanewei120 , you'll want to cherry pick 50d0ec8 to master also

Sorry, I should have been more specific - those comments were based of me running latest master following the recent merge as detailed in this comment: #122 (comment)

@lanewei120
Copy link
Collaborator

done

@lanewei120
Copy link
Collaborator

already cherry-picked and merged, close it

@fleutot
Copy link

fleutot commented Jan 16, 2023

I have a similar issue on the current SoftFever build, commit cdbd2fe0 (so, yesterday old):

[2023-01-16 14:46:34.967113] [0x00007fbcb1920940] [trace]   Initializing StaticPrintConfigs
loading network module at /home/gauthier/.config/BambuStudio/plugins/libbambu_networking.so
error, dlerror is /home/gauthier/.config/BambuStudio/plugins/libbambu_networking.so: cannot open shared object file: No such file or directory
after dlopen, network_module is (nil)

The gdb backtrace is:

#0  0x00005555588d2c04 in wxObject::Ref(wxObject const&) ()
#1  0x000055555692f1fb in Slic3r::GUI::StatusBasePanel::init_bitmaps() ()
#2  0x000055555693dd4c in Slic3r::GUI::StatusBasePanel::StatusBasePanel(wxWindow*, int, wxPoint const&, wxSize const&, long, wxString const&) ()
#3  0x000055555693efdf in Slic3r::GUI::StatusPanel::StatusPanel(wxWindow*, int, wxPoint const&, wxSize const&, long, wxString const&) ()
#4  0x0000555556674fe7 in Slic3r::GUI::MonitorPanel::init_tabpanel() ()
#5  0x00005555566755d2 in Slic3r::GUI::MonitorPanel::MonitorPanel(wxWindow*, int, wxPoint const&, wxSize const&, long) ()
#6  0x000055555650357a in Slic3r::GUI::MainFrame::init_tabpanel() ()
#7  0x0000555556504105 in Slic3r::GUI::MainFrame::MainFrame() ()
#8  0x00005555564c85dd in Slic3r::GUI::GUI_App::on_init_inner() ()
#9  0x00005555564c983a in Slic3r::GUI::GUI_App::OnInit() ()
#10 0x00005555588b53c7 in wxEntry(int&, wchar_t**) ()
#11 0x000055555649d95b in Slic3r::GUI::GUI_Run(Slic3r::GUI::GUI_InitParams&) ()
#12 0x0000555555d4a1f3 in Slic3r::CLI::run(int, char**) ()
#13 0x0000555555c9dd49 in main ()

This is when I build with the script ./BuildLinux.sh -ri.

Potentially interesting info, since the complaint is about wxObject: if I build directly with make in the build directory, I get errors related to wxFont:

/home/gauthier/src/BambuStudio/src/slic3r/GUI/Widgets/Label.cpp: In static member function ‘static void Label::initSysFont()’:
/home/gauthier/src/BambuStudio/src/slic3r/GUI/Widgets/Label.cpp:48:27: error: ‘AddPrivateFont’ is not a member of ‘wxFont’
   48 |     bool result = wxFont::AddPrivateFont(font_path);
      |                           ^~~~~~~~~~~~~~
/home/gauthier/src/BambuStudio/src/slic3r/GUI/Widgets/Label.cpp:52:22: error: ‘AddPrivateFont’ is not a member of ‘wxFont’
   52 |     result = wxFont::AddPrivateFont(font_path);
      |

, maybe it's a smoking gun.

@deftdawg
Copy link
Contributor Author

You're not building with the dependencies in deps, hence whatever wxwidgets you have is too old.

The recommend way to build is via podman/docker into an Appimage... See Containerfile and/or #12

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.

6 participants