Project

General

Profile

Support #3385

[Mac OSX RCP]: Resolution of dependencies of dynamic libraries

Added by Simon Barner over 2 years ago. Updated about 1 year ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
04/18/2018
Due date:
% Done:

0%

Estimated time:

Description

Scenario: Open AF3 app on Mac on try to execute the DSE workflow in which Z3 is invoked (described below)

Expected: you should be able to execute the scenario successfully.

Actual: The scenario fails and an error message is logged in the log file.

Detailed analysis:
In the current build setup, the RCP application for Mac OSX is not an Mac OSX application, but an application that is run in the Unix subsystem. The reason for this is that in the Unix subsystem the DYLD_LIBRARY_PATH environment variable can be used to to enable the resolution of dependencies of native libraries, i.e. other native libraries of libraries that are called from Java code. However, in the native Mac subsystem, DYLD_LIBRARY_PATH is purged by MacOS System Integrity Protection: https://developer.apple.com/library/content/documentation/Security/Conceptual/System_Integrity_Protection_Guide/RuntimeProtections/RuntimeProtections.html

The following code was used the build shell script executed in the af3-phoenix-04-product-macosx Jenkins job to generate shell wrapper script that sets DYLD_LIBRARY_PATH.

echo "Creating launcher shell script." 

echo '#!/bin/bash' > start-autofocus3-phoenix
echo 'BASEDIR=$(dirname $0)' >> start-autofocus3-phoenix
echo 'cd $BASEDIR/Contents/MacOS' >> start-autofocus3-phoenix
echo "DYLD_LIBRARY_PATH=\$DYLD_LIBRARY_PATH:${msdir}/lib/x64 ./autofocus3-phoenix \$*" >> start-autofocus3-phoenix
chmod a+x start-autofocus3-phoenix

In order to have a native Mac OS application again, the approach with the shell script has now been abandoned, and the shared libraries (*.dylib files) are copied in the same directory as the autofocus3-phoenix binary: Contents/MacOS/. (Side note: native Mac OS applications are located in a folder that has the extension .app, such as AutoFOCUS3.app).

Currently this affects only Z3, hence the appropriate *.dylib library files from Contents/Eclipse/plugins/com.microsoft.z3_[\.0-9]* are copied.

In this ticket, the above workaround should be replaced with a proper solution (hint: -vmargs -Djava.library.path=... does not work either).

Testing:
  • Load the attached model AF3-Project (4 ECUs) Strong Causality
  • Open DSE Perspective
  • Home
  • Select / Change Project
    • Unfold AF3-Project (4 ECUs) Strong Causality node
    • Select NEW DSE... node
    • Finish
  • Schedule
    • Generate
    • If all Z3 libraries have been resolved properly, the schedule view opens and the resulting schedule is shown
    • Otherwise, errors are logged to <workspace>/.metadata/.log

As a reference, also the version of the shell scripts that create the AutoFOCUS3 wrapper script that is executed in the Unix subsystem are attached.

AF3-Project_4-ECUs_strong_causality.af3_23 (45.9 KB) AF3-Project_4-ECUs_strong_causality.af3_23 Test case Simon Barner, 04/18/2018 01:58 PM
af3-macos-wrapper-64bit.sh (1.39 KB) af3-macos-wrapper-64bit.sh Old MacOS build script (64 bit) Simon Barner, 04/18/2018 02:05 PM
af3-macos-wrapper-32bit.sh (1.39 KB) af3-macos-wrapper-32bit.sh Old MacOS build script (32 bit) Simon Barner, 04/18/2018 02:05 PM

History

#1 Updated by Anonymous over 2 years ago

  • Assignee changed from Anonymous to Anonymous

#2 Updated by Anonymous over 2 years ago

  • Tracker changed from Change Request to Support

#3 Updated by Simon Barner over 2 years ago

  • Target version changed from AF3 2.13 Release to AF3 2.14 Release

#4 Updated by Anonymous over 2 years ago

  • Description updated (diff)

#5 Updated by Johannes Eder over 1 year ago

  • Target version changed from AF3 2.14 Release to Backlog

#6 Updated by Simon Barner about 1 year ago

  • Assignee changed from Anonymous to Simon Barner
  • Target version changed from Backlog to AF3 2.16 Release

RC3 should be tested on all platforms.

#7 Updated by Simon Barner about 1 year ago

  • Status changed from New to Resolved
  • Assignee changed from Simon Barner to Alexander Diewald

IMO superseded by #3674. Pls reject if you agree.

#8 Updated by Alexander Diewald about 1 year ago

  • Status changed from Resolved to Rejected
  • Assignee deleted (Alexander Diewald)

Agreed.

Also available in: Atom PDF