The rosversion command requires that the package.xml are available at run time. The rosversion command is used when starting roscore.