Trying to use synfigapp: how to save canvas to file?

For crazy reasons, I’m playing a bit with synfigapp API.
So I wrote the code below, but I can’t save canvas.

Any idea?

    // g++ basic.cpp -I../src `pkg-config --cflags --libs sigc++-2.0 gtkmm-3.0` -I ../../_production/build/include/ETL/ -I ../../_production/build/include/synfig-1.0/ -L ../../_production/build/lib/ -lsynfig -lsynfigapp
    // LD_LIBRARY_PATH=../../_production/build/lib:$LD_LIBRARY_PATH ./a.out

    #include <iostream>
    #include <cstdlib>

    #include <synfigapp/main.h>
    #include <synfigapp/action.h>
    #include <synfigapp/instance.h>
    #include <synfigapp/canvasinterface.h>
    #include <synfigapp/uimanager.h>

    #include <synfig/canvasfilenaming.h>

    #include <synfig/layer.h>

    int main(int argc, char** argv) {
    	synfigapp::Main main("");
    	
    	synfig::Canvas::Handle canvas = synfig::Canvas::create();
    	canvas->set_name("none");
    	canvas->set_file_name("none");
    	// first try...
    	//synfig::FileSystemNative::Handle container = synfig::FileSystemNative::instance();
    	// second try...
    	synfig::FileSystem::Handle container = new synfig::FileSystemEmpty();

    	etl::handle<synfigapp::Instance> instance = synfigapp::Instance::create(canvas, container);
    	instance->set_ui_interface(new synfigapp::ConsoleUIInterface());
    	
    	etl::handle<synfigapp::CanvasInterface> canvas_interface = synfigapp::CanvasInterface::create(instance, canvas);
    	synfig::Layer::Handle layer = synfig::Layer::create("SolidColor");
    	layer->set_param("color", synfig::Color(1.0, 0, 0));
    	
    	synfigapp::Action::Handle action = synfigapp::Action::create("LayerAdd");
    	action->set_param("canvas", canvas);
    	action->set_param("canvas_interface", canvas_interface);
    	action->set_param("new", layer);
    	bool success = instance->perform_action(action);
    	
    	bool saved = instance->save_as("somestuff.sif");
    	printf("saved: %i\n", saved);
    	return success ? EXIT_SUCCESS : EXIT_FAILURE;
    }

@KonstantinDmitriev @ice0 @blackwarthog @BobSynfig

Did you have problems with FileSystemNative? I see you commented it.

Yes, I did. Same problem.
The problem I got is save is cancelled due to FileSystem::copy_recursive().

As far as I could get:
from_file_system->is_file(from_filename) is false
as well as from_file_system->is_directory(from_filename)
and then it leaves returning false :confused: