Skip to content

Commit

Permalink
Add detailed explanation for the use of sudo
Browse files Browse the repository at this point in the history
  • Loading branch information
softins committed Feb 6, 2024
1 parent bebca88 commit 0196abe
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion mac/deploy_mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,14 @@ build_installer_image() {

# Build installer image

# Using sudo gets rid of CodeQL's virally infecting dylib preloads which break hdiutil's helper
# When this script is run on Github's CI with CodeQL enabled, CodeQL adds dynamic library
# shims via environment variables, so that it can monitor the compilation of code.
# In order for these settings to propagate to compilation called via shell/bash scripts,
# the CodeQL libs automatically create the same environment variables in sub-shells.
# Unfortunately, the CodeQL libraries are not compatible with the hdiutil program called
# by create-dmg. In order to prevent the automatic propagation of the environment, we use
# sudo to the same user in order to invoke create-dmg with a clean environment.
#
# /System/Library/PrivateFrameworks/DiskImages.framework/Resources/diskimages-helper.
sudo -u "$USER" create-dmg \
--volname "${client_target_name} Installer" \
Expand Down

0 comments on commit 0196abe

Please sign in to comment.