{"action":"created","issue":{"url":"https://api.github.com/repos/solettaproject/soletta/issues/1979","repository_url":"https://api.github.com/repos/solettaproject/soletta","labels_url":"https://api.github.com/repos/solettaproject/soletta/issues/1979/labels{/name}","comments_url":"https://api.github.com/repos/solettaproject/soletta/issues/1979/comments","events_url":"https://api.github.com/repos/solettaproject/soletta/issues/1979/events","html_url":"https://github.com/solettaproject/soletta/issues/1979","id":153136458,"number":1979,"title":"Add support to disable modules that are not used/needed","user":{"login":"jimmy-huang","id":1037247,"avatar_url":"https://avatars.githubusercontent.com/u/1037247?v=3","gravatar_id":"","url":"https://api.github.com/users/jimmy-huang","html_url":"https://github.com/jimmy-huang","followers_url":"https://api.github.com/users/jimmy-huang/followers","following_url":"https://api.github.com/users/jimmy-huang/following{/other_user}","gists_url":"https://api.github.com/users/jimmy-huang/gists{/gist_id}","starred_url":"https://api.github.com/users/jimmy-huang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimmy-huang/subscriptions","organizations_url":"https://api.github.com/users/jimmy-huang/orgs","repos_url":"https://api.github.com/users/jimmy-huang/repos","events_url":"https://api.github.com/users/jimmy-huang/events{/privacy}","received_events_url":"https://api.github.com/users/jimmy-huang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-04T23:11:24Z","updated_at":"2016-05-05T18:50:29Z","closed_at":null,"body":"<!-- TEMPLATE FOR TASKS -->\r\n\r\n#### Task Description\r\nCurrently when building on Zephyr, to use Soletta to build a simple GPIO app, some of the libraries are stilll being built and linked although the app do not use these libraries or modules.  Some can be disabled through menuconfig like LOG, FLOW_SUPPORT, USE_UPDATE, but some can't be disabled like crypto, buffer, random, vector (or maybe they do but not well-documented or through menuconfig), It would be nice if they can be configured as well so the app can be build with the absolute minimal config that includes the mainloop, gpio and whatever neccesary to function in order to further reduce the library size.\r\n\r\n#### Steps to reproduce\r\n\r\n 1.  Current sol.conf\r\nNETWORK=n\r\nFLOW_SUPPORT=n\r\nUSE_UPDATE=n\r\nLOG=n\r\n\r\n 2. soletta modules gets built and linked with this config\r\nlib/soletta/lib.a(sol-mainloop.o)\r\n                              ../apps/soletta_test/src/built-in.o (sol_timeout_add)\r\nlib/soletta/lib.a(sol-platform.o)\r\n                              lib/soletta/lib.a(sol-mainloop.o) (sol_platform_init)\r\nlib/soletta/lib.a(sol-mainloop-common.o)\r\n                              lib/soletta/lib.a(sol-mainloop.o) (sol_mainloop_impl_init)\r\nlib/soletta/lib.a(sol-mainloop-impl-zephyr.o)\r\n                              lib/soletta/lib.a(sol-mainloop-common.o) (sol_mainloop_impl_platform_init)\r\nlib/soletta/lib.a(sol-platform-impl-zephyr.o)\r\n                              lib/soletta/lib.a(sol-platform.o) (sol_platform_impl_init)\r\nlib/soletta/lib.a(sol-gpio-common.o)\r\n                              ../apps/soletta_test/src/built-in.o (sol_gpio_open)\r\nlib/soletta/lib.a(sol-gpio-impl-zephyr.o)\r\n                              ../apps/soletta_test/src/built-in.o (sol_gpio_close)\r\nlib/soletta/lib.a(sol-modules.o)\r\n                              lib/soletta/lib.a(sol-mainloop.o) (sol_modules_clear_cache)\r\nlib/soletta/lib.a(sol-monitors.o)\r\n                              lib/soletta/lib.a(sol-platform.o) (sol_monitors_init_custom)\r\nlib/soletta/lib.a(sol-util.o)\r\n                              lib/soletta/lib.a(sol-platform.o) (sol_util_replace_str_if_changed)\r\nlib/soletta/lib.a(sol-random.o)\r\n                              lib/soletta/lib.a(sol-util.o) (sol_random_new)\r\nlib/soletta/lib.a(sol-util-impl-zephyr.o)\r\n                              lib/soletta/lib.a(sol-mainloop-common.o) (sol_util_timespec_get_current)\r\nlib/soletta/lib.a(sol-buffer.o)\r\n                              lib/soletta/lib.a(sol-util.o) (sol_buffer_expand)\r\nlib/soletta/lib.a(sol-str-table.o)\r\n                              lib/soletta/lib.a(sol-gpio-common.o) (sol_str_table_lookup_fallback)\r\nlib/soletta/lib.a(sol-vector.o)\r\n                              lib/soletta/lib.a(sol-monitors.o) (sol_vector_init)\r\nlib/soletta/lib.a(sol-crypto.o)\r\n                              lib/soletta/lib.a(sol-mainloop.o) (sol_crypto_init)\r\nlib/soletta/lib.a(sol-blob.o)\r\n\r\n\r\n#### Board information\r\n\r\nHost OS and architecture:\r\nUbuntu 14.04 64bit\r\n\r\nTarget OS and platform:\r\nZephyr Nanokernel and ARduino 101\r\n\r\nSoletta version (top commit hash): 3354c99fdf7b494e7aa664cefa42dd2570c53b55\r\n"},"comment":{"url":"https://api.github.com/repos/solettaproject/soletta/issues/comments/217241174","html_url":"https://github.com/solettaproject/soletta/issues/1979#issuecomment-217241174","issue_url":"https://api.github.com/repos/solettaproject/soletta/issues/1979","id":217241174,"user":{"login":"bdilly","id":22437,"avatar_url":"https://avatars.githubusercontent.com/u/22437?v=3","gravatar_id":"","url":"https://api.github.com/users/bdilly","html_url":"https://github.com/bdilly","followers_url":"https://api.github.com/users/bdilly/followers","following_url":"https://api.github.com/users/bdilly/following{/other_user}","gists_url":"https://api.github.com/users/bdilly/gists{/gist_id}","starred_url":"https://api.github.com/users/bdilly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdilly/subscriptions","organizations_url":"https://api.github.com/users/bdilly/orgs","repos_url":"https://api.github.com/users/bdilly/repos","events_url":"https://api.github.com/users/bdilly/events{/privacy}","received_events_url":"https://api.github.com/users/bdilly/received_events","type":"User","site_admin":false},"created_at":"2016-05-05T18:50:28Z","updated_at":"2016-05-05T18:50:28Z","body":"Even if you're not using it directly eventually other modules that you need are using them.\r\n\r\nSure, we should review that and see if all of them are really required.\r\nMaybe some of them could be avoided if not used, maybe with lazy loads / init\r\n\r\nFor example, only initialize crypto function when first use is required instead of initializing on mainloop?\r\n\r\n@glima are you facing issues like that?"}}