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

Assume pre-configured environment variables instead of setup script for Connext #651

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions ros2_batch_job/windows_batch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,12 @@ def show_env(self):
self.run([self.python, '-m', 'pip', 'freeze', '--all'])

def setup_env(self):
# Try to find the connext env file and source it
connext_env_file = None
# Warn if connext-related variables are not correctly set up.
if ('rmw_connext_cpp' not in self.args.ignore_rmw or
'rmw_connextdds' not in self.args.ignore_rmw):
pf = os.environ.get('ProgramFiles', "C:\\Program Files\\")
connext_env_file = os.path.join(
pf, 'rti_connext_dds-5.3.1', 'resource', 'scripts', 'rtisetenv_x64Win64VS2017.bat')
if not os.path.exists(connext_env_file):
warn("Asked to use Connext but the RTI env was not found at '{0}'".format(
connext_env_file))
connext_env_file = None
for envar in ('CONNEXTDDS_DIR', 'RTI_OPENSSL_BIN', 'RTI_OPENSSL_LIB'):
if envar not in os.environ:
warn(f'Asked to use Connext but the environment variable `{envar}` was not found.')

# Generate the env file
if os.path.exists('env.bat'):
Expand All @@ -61,8 +56,6 @@ def setup_env(self):
'call '
'"C:\\Program Files (x86)\\Microsoft Visual Studio\\%s\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat" ' %
self.args.visual_studio_version + 'x86_amd64' + os.linesep)
if connext_env_file is not None:
f.write('call "%s"%s' % (connext_env_file, os.linesep))
f.write("%*" + os.linesep)
f.write("if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%" + os.linesep)

Expand Down