{"id":4564,"date":"2017-05-20T11:23:30","date_gmt":"2017-05-20T11:23:30","guid":{"rendered":"https:\/\/really.zonky.org\/?p=4564"},"modified":"2017-05-20T11:23:30","modified_gmt":"2017-05-20T11:23:30","slug":"ubuntu-compiling-awesome-and-messing-with-lua","status":"publish","type":"post","link":"https:\/\/really.zonky.org\/?p=4564","title":{"rendered":"Ubuntu, Compiling Awesome, and Messing With Lua"},"content":{"rendered":"<p>I just\u00a0<em>love<\/em> messing around with run-time languages that I know relatively little about (and if your sarcasm detector isn&#8217;t flashing red about now, take it out and give it a good talking to).<\/p>\n<p>The problem detailed here is something that you are unlikely to encounter unless you get into weird stuff like running an odd-ball window manager, aren&#8217;t content with the version of said window manager distributed with your Linux distribution, and are used to re-compiling things from scratch.<\/p>\n<p>It all started when I upgraded Ubuntu on my work machine (to Zesty Zapus). The window manager version was upgraded from 3.5 to 4.0, which broke on my configuration file (3.5); not a big problem I thought, as I had already upgraded my window manager at home to 4.1 and reconfigured the configuration file. I copied the updated configuration file from home into place.<\/p>\n<p>And it failed. Apparently I use 4.1-isms within the file. As I was not happy about tinkering with the file to\u00a0<em>downgrade<\/em> it (in a language I know relatively little about), I decided to re-compile Awesome 4.1 instead.<\/p>\n<p>Which failed with a weird error :-<\/p>\n<pre>\u00bb awesome --version\r\nawesome v4.1 (Technologic)\r\n \u2022 Compiled against Lua 5.3.3 (running with Lua 5.3)\r\n \u2022 D-Bus support: \u2714\r\n \u2022 execinfo support: \u2714\r\n \u2022 xcb-randr version: 1.4\r\n \u2022 LGI version: [string \"return require('lgi.version')\"]:1: module 'lgi.version' not found:\r\n\tno field package.preload['lgi.version']\r\n\tno file '\/usr\/local\/share\/lua\/5.3\/lgi\/version.lua'\r\n\tno file '\/usr\/local\/share\/lua\/5.2\/lgi\/version.lua'\r\n\tno file '\/usr\/local\/share\/lua\/5.3\/lgi\/version\/init.lua'\r\n\tno file '\/usr\/local\/share\/lua\/5.2\/lgi\/version\/init.lua'\r\n\tno file '\/usr\/local\/lib\/lua\/5.3\/lgi\/version.lua'\r\n\tno file '\/usr\/local\/lib\/lua\/5.3\/lgi\/version\/init.lua'\r\n\tno file '\/usr\/share\/lua\/5.3\/lgi\/version.lua'\r\n\tno file '\/usr\/share\/lua\/5.3\/lgi\/version\/init.lua'\r\n\tno file '.\/lgi\/version.lua'\r\n\tno file '.\/lgi\/version\/init.lua'\r\n\tno file '\/usr\/local\/lib\/lua\/5.3\/lgi\/version.so'\r\n\tno file '\/usr\/lib\/x86_64-linux-gnu\/lua\/5.3\/lgi\/version.so'\r\n\tno file '\/usr\/lib\/lua\/5.3\/lgi\/version.so'\r\n\tno file '\/usr\/local\/lib\/lua\/5.3\/loadall.so'\r\n\tno file '.\/lgi\/version.so'\r\n\tno file '\/usr\/local\/lib\/lua\/5.3\/lgi.so'\r\n\tno file '\/usr\/lib\/x86_64-linux-gnu\/lua\/5.3\/lgi.so'\r\n\tno file '\/usr\/lib\/lua\/5.3\/lgi.so'\r\n\tno file '\/usr\/local\/lib\/lua\/5.3\/loadall.so'\r\n\tno file '.\/lgi.so'\r\n<\/pre>\n<p>Which had me stumped for a while, and it turns out that DuckDuckGo didn&#8217;t have an obvious fix (one of the reasons for writing this).<\/p>\n<p>Eventually I figured out that\u00a0<em>awesome<\/em> was not finding the LGI module (I can be slow at times) which was odd because it was definitely installed. However it turns out that it was installed in\u00a0<em>\/usr\/share\/lua\/5.2\/lgi<\/em>. So despite having lua 5.3 installed, extra lua modules can only be seen if you have lua 5.2 installed?<\/p>\n<p>The &#8220;fix&#8221; for this was to create an environment variable telling LUA to search for files in rather more places before starting Awesome :-<\/p>\n<pre>export LUA_PATH=\"\/usr\/local\/share\/lua\/5.3\/?.lua;\/usr\/local\/share\/lua\/5.2\/?.lua;\/usr\/local\/share\/lua\/5.3\/?\/init.lua;\/usr\/local\/share\/lua\/5.2\/?\/init.lua;\/usr\/local\/lib\/lua\/5.3\/?.lua;\/usr\/local\/lib\/lua\/5.3\/?\/init.lua;\/usr\/share\/lua\/5.3\/?.lua;\/usr\/share\/lua\/5.2\/?.lua;\/usr\/share\/lua\/5.3\/?\/init.lua;\/usr\/share\/lua\/5.2\/?\/init.lua;.\/?.lua;.\/?\/init.lua\"\r\n<\/pre>\n<p>This was created by running <em>lua<\/em> from the command line and running <em>print(package.path)<\/em> to display the default setting, and adding the 5.2 equivalent for many elements.<\/p>\n<p>As to whether it works or not, well I cannot be sure (I&#8217;m not going into work on a weekend just to check if the window manager fires up), but Awesome itself seems happy with the result :-<\/p>\n<pre>\u00bb awesome --version\r\nawesome v4.1 (Technologic)\r\n \u2022 Compiled against Lua 5.3.3 (running with Lua 5.3)\r\n \u2022 D-Bus support: \u2714\r\n \u2022 execinfo support: \u2714\r\n \u2022 xcb-randr version: 1.4\r\n \u2022 LGI version: 0.9.1\r\n<\/pre>\n<p>So it can find LGI, but whether it can do anything useful with it remains to be seen!<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4289\" src=\"https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/solidus.jpeg?resize=695%2C463&#038;ssl=1\" alt=\"\" width=\"695\" height=\"463\" srcset=\"https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/solidus.jpeg?w=792&amp;ssl=1 792w, https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/solidus.jpeg?resize=300%2C200&amp;ssl=1 300w, https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/solidus.jpeg?resize=768%2C512&amp;ssl=1 768w\" sizes=\"auto, (max-width: 695px) 100vw, 695px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I just\u00a0love messing around with run-time languages that I know relatively little about (and if your sarcasm detector isn&#8217;t flashing red about now, take it out and give it a good talking to). The problem detailed here is something that you are unlikely to encounter unless you get into weird stuff like running an odd-ball <a href='https:\/\/really.zonky.org\/?p=4564' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_share_on_mastodon":"0"},"categories":[4,209,226],"tags":[1048,1532,61,725],"class_list":["post-4564","post","type-post","status-publish","format-standard","hentry","category-it","category-linux-it","category-working-notes","tag-awesome","tag-lua","tag-ubuntu","tag-window-manager","category-4-id","category-209-id","category-226-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"share_on_mastodon":{"url":"","error":""},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p1f2KI-1bC","_links":{"self":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/4564","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4564"}],"version-history":[{"count":2,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/4564\/revisions"}],"predecessor-version":[{"id":4566,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/4564\/revisions\/4566"}],"wp:attachment":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4564"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4564"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4564"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}