RedHatEMEA / satools

18 stars 7 forks source link

can't build satools-search unless satools is installed #44

Closed jim-minter closed 11 years ago

jamesread commented 11 years ago

The issue is caused due to

/Makefile:59: cd search/app && python -c 'import app'

ie: The app is being run following the make, giving no chance for an install to complete. The issue is easily worked around by commenting out the line for the time being, but that does not solve this issue. Having the Makefile run the application after a make is incredibly convenient, but should not really be in the build system.

However, running the app is a nice way of doing a poor mans dependency check - python will fail at runtime if the 3rd party libraries web, cgi, email, json, etc are not present, which has a "nice" knock on effect of failing the build.

@jim-minter How would you like to proceed - what do you think about having a hard RPM dependency on the likes of python-webpy, etc?

jim-minter commented 11 years ago

@jamesread, welcome :)

This issue occurs when a 'make all' runs, i.e. the target that creates the 4 satools RPMs. If you just do a 'make search' in root, it works OK because the symlinks resolve to allow python to find satools.{common,mailindex}.

The root reason why python -c 'import app' is actually run is because it eventually causes satools.search to be imported, which as a by-product spits out parsetab.py and parsetab.pyc, the LALR parser tables, into juno/app. These are then packaged into the satools-search RPM. The same happens for juno in Makefile:37 cd juno/app && python search.py , but because in juno's case its search.py isn't sneakily reused from satools, there's no problem.

Clearly for better or worse there is currently an actual build dependency on satools, therefore I think the first part of the fix is to change the preprep-satools-search Makefile target to include the satools subdirectory in the sources tar.gz so that everything required is available at RPM build time. A second part of the fix may be to get those parsetab files generated a little more elegantly [if so, this should be done for juno as well] and add a documentation note to explain what's going on [if so, this should be done for juno as well]!