Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"update multiple targets" fails for ofxCv #121

Open
kylemcdonald opened this issue Mar 4, 2016 · 4 comments
Open

"update multiple targets" fails for ofxCv #121

kylemcdonald opened this issue Mar 4, 2016 · 4 comments

Comments

@kylemcdonald
Copy link
Contributor

i'm doing an computer vision + OF class at ITP this weekend and wanted to show them the "update multiple projects" tab. but when i try to run it on ofxCv i don't get any new project files. here is the verbose log:

[notice ] -----------------------------------------------
[notice ] updating an existing project
[notice ] target platform is: osx
[verbose]   addon_config.mk
[verbose]   bin
[verbose]   config.make
[verbose]   example-ar
[verbose]   example-background
[verbose]   example-bayer
[verbose]   example-blur
[verbose]   example-calibration
[verbose]   example-calibration-lcp
[verbose]   example-coherent-lines
[verbose]   example-contours-advanced
[verbose]   example-contours-basic
[verbose]   example-contours-color
[verbose]   example-contours-following
[verbose]   example-contours-quad
[verbose]   example-contours-tracking
[verbose]   example-difference
[verbose]   example-difference-columns
[verbose]   example-edge
[verbose]   example-empty
[verbose]   example-estimate-affine
[verbose]   example-face
[verbose]   example-face-follow
[verbose]   example-face-zoom
[verbose]   example-flow
[verbose]   example-flow-distort
[verbose]   example-flow-distort-shader
[verbose]   example-flow-keypoints
[verbose]   example-gesture
[verbose]   example-highpass
[verbose]   example-homography
[verbose]   example-kalman
[verbose]   example-kalman-euler
[verbose]   example-smile
[verbose]   example-threshold
[verbose]   example-undistortion
[verbose]   libs
[verbose]   license.md
[verbose]   Makefile
[verbose]   ofxaddons_thumbnail.png
[verbose]   ofxCv.xcodeproj
[verbose]   openFrameworks-Info.plist
[verbose]   Project.xcconfig
[verbose]   readme.md
[verbose]   src
[verbose]   update-projects.py
[verbose] listed 46 files in "/Users/kyle/Documents/openFrameworks-0.9.2/addons/ofxCv/"
[notice ] updating project /Users/kyle/Documents/openFrameworks-0.9.2/addons/ofxCv
[verbose] returning path ../../

[verbose]   ofxCv.h
[verbose] listed 1 files in "/Users/kyle/Documents/openFrameworks-0.9.2/addons/ofxCv/src/"
[notice ] parsing addons.make
[notice ] saving addons.make
[notice ] project updated! 
[notice ] -----------------------------------------------

1 project updated [notice ] in -4.96733 seconds





(command used:"/Users/kyle/Documents/openFrameworks-0.9.2/projectGenerator-osx/projectGenerator.app/Contents/Resources/app/app/projectGenerator" -r -v -o"/Users/kyle/Documents/openFrameworks-0.9.2" -p"osx" "/Users/kyle/Documents/openFrameworks-0.9.2/addons/ofxCv")

it offers me the option "open in IDE" and if i click it, it says:

Uncaught Exception:
Error: ENOENT: no such file or directory, stat '/Users/kyle/Documents/openFrameworks-0.9.2/apps/myApps/mySketch'
    at Error (native)
    at fs.statSync (fs.js:854:18)
    at Object.fs.statSync (ATOM_SHELL_ASAR.js:225:16)
    at EventEmitter.<anonymous> (/Users/kyle/Documents/openFrameworks-0.9.2/projectGenerator-osx/projectGenerator.app/Contents/Resources/app/index.js:800:16)
    at emitTwo (events.js:87:13)
    at EventEmitter.emit (events.js:172:7)
    at EventEmitter.<anonymous> (/Users/kyle/Documents/openFrameworks-0.9.2/projectGenerator-osx/projectGenerator.app/Contents/Resources/atom.asar/browser/api/lib/web-contents.js:54:23)
    at emitTwo (events.js:87:13)
    at EventEmitter.emit (events.js:172:7)

this is with 0.9.2 and the latest ofxCv.

is there something additional i should do to get the project generator to work?

@ofZach
Copy link
Contributor

ofZach commented Mar 4, 2016

I pulled the examples out of ofxCv into a new folder and did update and it worked. (although when I did verbose it stalled out I think because of a seperate issue with maxbuffer I need to look into #122).

I think here it's obviously getting confused about what is a project -- it sees the "src" folder in the root of ofxCv and it thinks that it is a project, rather than the examples.

[notice ] updating project /Users/kyle/Documents/openFrameworks-0.9.2/addons/ofxCv

I think it doesn't recursively look inside of projects for more projects, so here it finds src, tries to do something and doesn't seek deeper. (our "is this folder a project" check is quite simple it just lookss for src: https://github.com/openframeworks/projectGenerator/blob/master/commandLine/src/main.cpp#L191-L214)

I am not sure the best solution but this is the same w/ ofxCv in 0.9.0 as well -- I think the best bet is to pull examples out of the addon to update them or we need to think about a better check for if a folder is a project or not.

@kylemcdonald
Copy link
Contributor Author

i see, so this is a general bug with all addons that come with examples, not specific to ofxCv. in that case, would it make sense to assume that any folder starting with "ofx" is not a project folder?

i copied the examples into a new folder like you suggested and it worked, taking 83 seconds. i'll tell students to do that for now. i feel like it will give them the wrong intuition for how to work with addon examples, but maybe it doesn't matter when you're just getting started.

@ofZach
Copy link
Contributor

ofZach commented Mar 4, 2016

yes this is a general bug (which has existed since 0.9 and maybe longer) -- if a folder has src in it it will be assumed to be an project so most addons will fail for batch update.

I think it's a good solution to change how we assume a project folder is a project but I am not sure if using "ofx" to disambiguate is the best option either (just as using "src" might not be ideal) since there's a chance you might be work on a project that could turn into an addon, etc. Maybe we can search for "src/main.cpp" or something more specific to projects (such as having bin/data) ?

It's probably good to open a second issue about how long the updating takes -- this is specific to osx and the recursive parsing for opencv -- I think there might be a way to cache the results on batch updates (or after you've parsed the folder once) so we can likely shave down that time (since it's unlikely the addon changed from moment to moment while doing the batch updates).

@kylemcdonald
Copy link
Contributor Author

i understand. using main.cpp sounds more reliable. but if main.cpp is called ofApp.cpp that could be a problem. the most reliable solution might be checking if there is a void main or int main in the one of the files in src/, since this is the only real difference between an app and a library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants