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

use Connext 5.3.1 and Visual Studio 2017 #146

Merged
merged 5 commits into from
Apr 17, 2018
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion linux_docker_resources/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ RUN if test ${PLATFORM} = x86; then apt-get update && apt-get install --no-insta
RUN pip3 install pexpect

# Get and install the RTI web binaries.
RUN cd /tmp && curl --silent https://s3.amazonaws.com/RTI/Bundles/5.3.0/Evaluation/rti_connext_dds_secure-5.3.0-eval-x64Linux3gcc5.4.0.tar.gz | tar -xz
RUN cd /tmp && curl --silent https://s3.amazonaws.com/RTI/Bundles/5.3.1/Evaluation/rti_connext_dds_secure-5.3.1-eval-x64Linux3gcc5.4.0.tar.gz | tar -xz
ADD rti_web_binaries_install_script.py /tmp/rti_web_binaries_install_script.py

# Add the RTI license file.
Expand Down
2 changes: 1 addition & 1 deletion linux_docker_resources/entry_point.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ case "${CI_ARGS}" in
;;
*)
echo "Installing Connext binaries off RTI website..."
python3 -u /tmp/rti_web_binaries_install_script.py /tmp/rti_connext_dds-5.3.0-eval-x64Linux3gcc5.4.0.run /home/rosbuild/rti_connext_dds-5.3.0 --rtipkg_paths /tmp/rti_security_plugins-5.3.0-eval-x64Linux3gcc5.4.0.rtipkg
python3 -u /tmp/rti_web_binaries_install_script.py /tmp/rti_connext_dds-5.3.1-eval-x64Linux3gcc5.4.0.run /home/rosbuild/rti_connext_dds-5.3.1 --rtipkg_paths /tmp/rti_security_plugins-5.3.1-eval-x64Linux3gcc5.4.0.rtipkg
if [ $? -ne 0 ]
then
echo "Connext not installed correctly (maybe you're on an ARM machine?)." >&2
Expand Down
19 changes: 14 additions & 5 deletions linux_docker_resources/rti_web_binaries_install_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,20 @@ def install_connext(installer_path, install_directory):
child.sendline(install_directory)
child.expect_exact('Do you want to continue? [Y/n]:')
child.sendline('y')
result_index = child.expect_exact([
'Create an RTI Launcher shortcut on the Desktop [y/N]: ', pexpect.EOF], timeout=120)
if result_index == 0:
child.sendline('n')
child.expect(pexpect.EOF)
while True:
result_index = child.expect_exact([
pexpect.EOF,
'Disable copying of examples to rti_workspace [y/N]: ',
'Create an RTI Launcher shortcut on the Desktop [y/N]: ',
], timeout=120)
if result_index == 0:
return
elif result_index == 1:
child.sendline('y')
elif result_index == 2:
child.sendline('n')
Copy link
Member Author

@dirk-thomas dirk-thomas Apr 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume the index should never be not 0, 1, or 2? For safety I would propose to still add (to protect from a potentially infinite loop):

else:
    assert False, 'Unexpected result_index: %d' % result_index

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it'll return an index in the list or timeout (which is caught below), but there's no harm in adding it. How come not raise though? (not that we intend to run this optimised, but who knows.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come not raise though?

That is exactly what the assert does.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not if run with -O, right? Again it's "not that we intend to run this optimised, but who knows." 😄

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

=> what I meant was that today we don't, but for some unrelated reason in the future we might set PYTHONOPTIMIZE or something

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually I use assert for logic checks like this. For cases which "shouldn't happen". But I don't mind either way here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 1523332.

else:
raise RuntimeError('Unexpected result index: %d' % result_index)

except (pexpect.TIMEOUT, pexpect.EOF):
raise RuntimeError(
Expand Down
2 changes: 1 addition & 1 deletion ros2_batch_job/linux_batch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def setup_env(self):
if self.args.connext:
# Try to find the connext env file to later source it
connext_env_file = os.path.join(
os.path.expanduser('~'), 'rti_connext_dds-5.3.0', 'resource', 'scripts',
os.path.expanduser('~'), 'rti_connext_dds-5.3.1', 'resource', 'scripts',
'rtisetenv_x64Linux3gcc5.4.0.bash')

if os.path.exists(connext_env_file):
Expand Down
2 changes: 1 addition & 1 deletion ros2_batch_job/osx_batch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def setup_env(self):
if self.args.connext:
# Try to find the connext env file and source it
connext_env_file = os.path.join(
'/Applications', 'rti_connext_dds-5.3.0', 'resource', 'scripts',
'/Applications', 'rti_connext_dds-5.3.1', 'resource', 'scripts',
'rtisetenv_x64Darwin16clang8.0.bash')
if not os.path.exists(connext_env_file):
warn("Asked to use Connext but the RTI env was not found at '{0}'".format(
Expand Down
4 changes: 2 additions & 2 deletions ros2_batch_job/packaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ def exclude(filename):
h.add(args.installspace, arcname=folder_name, exclude=exclude)
elif args.os == 'windows':
archive_path = 'ros2-package-windows-%s.zip' % platform.machine()
# NOTE(esteve): hack to copy our custom built VS2015-compatible OpenCV DLLs
opencv_libdir = os.path.join(os.environ['OpenCV_DIR'], 'x64', 'vc14', 'bin')
# NOTE(esteve): hack to copy our custom built VS2017-compatible OpenCV DLLs
opencv_libdir = os.path.join(os.environ['OpenCV_DIR'], 'x64', 'vc15', 'bin')
for libpath in glob.glob('%s/*.dll' % opencv_libdir):
shutil.copy(libpath, os.path.join(args.installspace, 'bin', os.path.basename(libpath)))
with zipfile.ZipFile(archive_path, 'w') as zf:
Expand Down
6 changes: 3 additions & 3 deletions ros2_batch_job/windows_batch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def setup_env(self):
if self.args.connext:
pf = os.environ.get('ProgramFiles', "C:\\Program Files\\")
connext_env_file = os.path.join(
pf, 'rti_connext_dds-5.3.0', 'resource', 'scripts', 'rtisetenv_X64Win64VS2015.bat')
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))
Expand All @@ -67,8 +67,8 @@ def setup_env(self):
f.write("@echo off" + os.linesep)
f.write(
'call '
'"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat" '
'x86_amd64 8.1' + os.linesep)
'"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat" '
'x86_amd64' + os.linesep)
if connext_env_file is not None:
f.write('call "%s"%s' % (connext_env_file, os.linesep))
if opensplice_env_file is not None:
Expand Down