How to include Lua module in build - api

I downloaded this Lua module and installed it with make. However, when I try to use it in my code, I get the following error:
VirtualBox:~/Downloads$ lua socket_test.lua
lua: socket_test.lua:1: module 'nixio.util' not found:
no field package.preload['nixio.util']
no file './nixio/util.lua'
no file '/usr/local/share/lua/5.1/nixio/util.lua'
no file '/usr/local/share/lua/5.1/nixio/util/init.lua'
no file '/usr/local/lib/lua/5.1/nixio/util.lua'
no file '/usr/local/lib/lua/5.1/nixio/util/init.lua'
no file '/usr/share/lua/5.1/nixio/util.lua'
no file '/usr/share/lua/5.1/nixio/util/init.lua'
no file './nixio/util.so'
no file '/usr/local/lib/lua/5.1/nixio/util.so'
no file '/usr/lib/i386-linux-gnu/lua/5.1/nixio/util.so'
no file '/usr/lib/lua/5.1/nixio/util.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file './nixio.so'
no file '/usr/local/lib/lua/5.1/nixio.so'
no file '/usr/lib/i386-linux-gnu/lua/5.1/nixio.so'
no file '/usr/lib/lua/5.1/nixio.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'require'
socket_test.lua:1: in main chunk
[C]: ?
And the first line of my code:
local nixio = require "nixio", require "nixio.util"
Any help would be appreciated!

I see these options:
Try make install and hope that it works. Perhaps set some variable such as PREFIX nothing.
Manually move dist/usr/local/share/lua/5.1/nixio to /usr/local/share/lua/5.1/nixio and dist/usr/local/lib/lua/5.1/nixio.so to /usr/local/lib/lua/5.1/nixio.so.
Add the dist paths to the environment: LUA_CPATH='dist/usr/local/lib/lua/5.1/?.so;;' and LUA_PATH='dist/usr/local/share/lua/5.1/?.lua;;'.
Add the dist paths in Lua: package.cpath='dist/usr/local/lib/lua/5.1/?.so;'..package.cpath and package.path='dist/usr/local/share/lua/5.1/?.lua;'..package.path.

Related

CMAKE_BUILD_DIR pointing to symlink and causing issues

in my build system i have /private/tmp/ws and there is symlink /tmp to this.
I call a script which takes argument CMAKE_BUILD_DIR , but taking /tmp/ws/..., rather /private/tmp/ws/..
example error
File "/private/tmp/ws/tools_path/create_symbol_list.py", line 212, in <module>
main()
File "/private/tmp/ws/tools_path/create_symbol_list.py", line 188, in main
obj_file_path = find_object_file(build_folder_path=user_args.path_to_build_folder,
File "/private/tmp/ws/tools_path/create_symbol_list.py", line 83, in find_object_file
raise Exception("Compiled object for source file: {} was not found at expected path: {}"
Exception: Compiled object for source file: /private/tmp/ws/src_path/overlay_id_db.c was not found at expected path: /tmp/ws/modem/output_path/CMakeFiles/libname1.dir//private/tmp/ws/src_path/overlay_id_db.c.obj
Missing file /tmp/ws/modem/output_path/CMakeFiles/libname1.dir//private/tmp/ws/src_path/overlay_id_db.c.obj
is present at /tmp/ws/modem/output_path/CMakeFiles/libname1.dir/tmp/ws/src_path/overlay_id_db.c.obj which means CMAKE_BUILD_DIR is taking symlink.
anyway to fix this?

Importing Docstrings from Python modules using Sphinx and autodoc [duplicate]

I have faced a problem with Sphinx in Python. Even if I have followed the instructions from https://groups.google.com/forum/#!topic/sphinx-users/lO4CeNJQWjg I was not able to solve it.
I have Docs/source folder which contains:
conf.py
index.rst
RstFiles (the folder which contains .rst files for each module).
In conf.py I specify the abs path in the following way:
sys.path.insert(0, os.path.abspath('..'))
In index.rst I call all the modules from RstFiles folder in the following way:
.. toctree::
:maxdepth: 2
:caption: Contents:
BatchDataContainer.rst
BatchDefaultValues.rst
BatchTypes.rst
And finally, the content of each .rst file is in the following way:
BatchDataContainer
==================
.. automodule:: RstFiles.BatchDataContainer
:members:
When I run sphinx-build I get 2 main errors:
D:\hfTools\Projects\Validation-Source\Docs\source\RstFiles\BatchDataContainer.rst:
WARNING: document isn't included in any toctree
and
WARNING: autodoc: failed to import module 'BatchDataContainer' from
module 'RstFiles'; the following exception was raised: No module named
'RstFiles'
Any ideas what might be wrong cause I have tried different things already and nothing has helped?
If conf.py is located in this directory,
D:\hfTools\Projects\Validation-Source\Docs\source,
and the project's Python modules (including BatchDataContainer.py) are in
D:\hfTools\Projects\Validation-Source\Products,
then you need sys.path.insert(0, os.path.abspath('../..')) in conf.py.
The automodule directive needs to be updated as well:
.. automodule:: Products.BatchDataContainer
:members:

Xcode GoogleCast problem with CFBundleExecutable at Archieve App

Hello I'm Making a Sound App integrated with ChromeCast in Obj-C. I use ChromeCast 4.4.7 dynamic SDK.
I use the manual method adding the SDK, and everything works fine. The app Connects with Chromecast and sends info.
The problem is what I want to Achieve the Project, using the strip_unused_archs.sh joined with the SDK. I've got 6 errors.
I Paste them
The domain/default pair of (/Users/juanjocontreras/Library/Developer/Xcode/DerivedData/WMYA_Radio-fzjavmckasiwebglravdbxefwoel/Build/Intermediates.noindex/ArchiveIntermediates/WMYA/Info.plist, CFBundleExecutable) does not exist
Removing unused architectures from framework:
fatal error: lipo: can't open input file: /Users/juanjocontreras/Library/Developer/Xcode/DerivedData/WMYA_Radio-fzjavmckasiwebglravdbxefwoel/Build/Intermediates.noindex/ArchiveIntermediates/WMYA/ (No such file or directory)
fatal error: lipo: can't open input file: /Users/juanjocontreras/Library/Developer/Xcode/DerivedData/WMYA_Radio-fzjavmckasiwebglravdbxefwoel/Build/Intermediates.noindex/ArchiveIntermediates/WMYA/_armv7 (No such file or directory)
mv: rename /Users/juanjocontreras/Library/Developer/Xcode/DerivedData/WMYA_Radio-fzjavmckasiwebglravdbxefwoel/Build/Intermediates.noindex/ArchiveIntermediates/WMYA/_thinned to /Users/juanjocontreras/Library/Developer/Xcode/DerivedData/WMYA_Radio-fzjavmckasiwebglravdbxefwoel/Build/Intermediates.noindex/ArchiveIntermediates/WMYA/: No such file or directory
2020-05-18 16:11:30.130 defaults[10081:96863]
The domain/default pair of (Radio/InstallationBuildProductsLocation/Applications//Ibiza1Radio.app/Frameworks/GoogleCast.framework/Info.plist, CFBundleExecutable) does not exist
Removing unused architectures from framework:
fatal error: lipo: can't open input file: Radio/InstallationBuildProductsLocation/Applications//Ibiza1Radio.app/Frameworks/GoogleCast.framework/ (No such file or directory)
fatal error: lipo: can't open input file: Radio/InstallationBuildProductsLocation/Applications//Ibiza1Radio.app/Frameworks/GoogleCast.framework/_armv7 (No such file or directory)
mv: rename Radio/InstallationBuildProductsLocation/Applications//Ibiza1Radio.app/Frameworks/GoogleCast.framework/_thinned to Radio/InstallationBuildProductsLocation/Applications//Ibiza1Radio.app/Frameworks/GoogleCast.framework/: No such file or directory
Any idea of what can I do to Archive and publish the app?
Thnx to all of U

AWS Lambda package-deployed functions require() of a relative path, not found

I have a zip file containing the following structure (this is the root of the archive, not nested in a top-level folder, which I understand is a common cause of errors for aws-s3-lambda deployments):
- support/
- shared.js
- one.js
- two.js
and then in one.js and two.js:
var shared = require("./support/shared");
// ...
When I run this code locally, it works. I use the aws-sdk to upload the zip file to AWS-S3 and then use aws.lambda.createFunction() to create a function with that name and handler and everything. The created function DOES show up in my Lambda dashboard, but when I test it, I get "Cannot find module './support/shared'". I have also tried var shared = require("./support/shared.js"); and that gives "Cannot find module './support/shared.js'".
This is for runtime node6.10. The filename cases are correct for case-sensitive lambda.
Shouldn't this work?? What's the gotcha?
Is there a way to verify the file structure that Lambda is working in to show that the additional ./support/shared.js file actually made it to the working directory or whatever it uses?
The gotcha is that the zip file created on a windows machine has the wrong chmod permissions set in it for when AWS unpacks it. The files are there, but inaccessible but node just gives a generic warning about not found instead of that the folder access is denied.

lua and "module 'gears' not found:"

I have the awesome rc.lua file , awesome 3.5 and lua 5.2 .When i use awesome -k i get the following result:
mohsen#debian:~$ awesome -k
✔ Configuration file syntax OK.
But when i use :
mohsen#debian:~$ lua .config/awesome/rc.lua
lua: .config/awesome/rc.lua:2: module 'gears' not found:
no field package.preload['gears']
no file '/usr/local/share/lua/5.2/gears.lua'
no file '/usr/local/share/lua/5.2/gears/init.lua'
no file '/usr/local/lib/lua/5.2/gears.lua'
no file '/usr/local/lib/lua/5.2/gears/init.lua'
no file '/usr/share/lua/5.2/gears.lua'
no file '/usr/share/lua/5.2/gears/init.lua'
no file './gears.lua'
no file '/usr/local/lib/lua/5.2/gears.so'
no file '/usr/lib/i386-linux-gnu/lua/5.2/gears.so'
no file '/usr/lib/lua/5.2/gears.so'
no file '/usr/local/lib/lua/5.2/loadall.so'
no file './gears.so'
stack traceback:
[C]: in function 'require'
.config/awesome/rc.lua:2: in main chunk
[C]: in ?
Gear is exist in :
/usr/share/awesome/lib/gears
/usr/share/awesome/lib/gears/init.lua
/usr/share/awesome/lib/gears/wallpaper.lua
/usr/share/awesome/lib/gears/object.lua
/usr/share/awesome/lib/gears/debug.lua
/usr/share/awesome/lib/gears/sort.lua
/usr/share/awesome/lib/gears/surface.lua
/usr/share/awesome/lib/gears/color.lua
Question: How can i solve my problem?