-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
OpenCV.js build fails to recognize custom config file #19493
Copy link
Copy link
Closed
Description
When I try to build OpenCV.js with custom config file using --config option, the build results in an error:
Traceback (most recent call last):
File "/home/work/Projects/opencv/modules/js/generator/embindgen.py", line 910, in <module>
exec(open(whiteListFile).read())
FileNotFoundError: [Errno 2] No such file or directory: './my.config.py'
...
make: *** [Makefile:502: opencv.js] Error 2
Traceback (most recent call last):
File "/home/work/Projects/opencv/./platforms/js/build_js.py", line 287, in <module>
builder.build_opencvjs()
File "/home/work/Projects/opencv/./platforms/js/build_js.py", line 195, in build_opencvjs
execute(["make", "-j", str(multiprocessing.cpu_count()), "opencv.js"])
File "/home/work/Projects/opencv/./platforms/js/build_js.py", line 23, in execute
raise Fail("Child returned: %s" % retcode)
__main__.Fail: Child returned: 2
System information (version)
- OpenCV => 4.5.1 (master)
- Operating System / Platform => Linux
- Compiler => emscripten
Steps to reproduce
- Create config file with custom module whitelist
- Build opencv.js using
emcmakeand specify--configoption
$ cp ./platforms/js/opencv_js.config.py ./my.config.py
$ emcmake python ./platforms/js/build_js.py build_js --config="./my.config.py"
Detailed description
It seems that the relative path ./my.config.py is passed as-is to the environmental variable OPENCV_JS_WHITELIST. Then it is read by embindgen.py in another directory, resulting in file not found. Passing the file path as absolute solves the issue. Solution in PR.
Issue submission checklist
- I report the issue, it's not a question
- I checked the problem with documentation, FAQ, open issues,
forum.opencv.org, Stack Overflow, etc and have not found solution - I updated to latest OpenCV version and the issue is still there
- There is reproducer code and related data files: videos, images, onnx, etc
Reactions are currently unavailable