Skip to content

Commit 0cfb631

Browse files
committed
Add detailed explanation for the use of sudo
1 parent bebca88 commit 0cfb631

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

mac/deploy_mac.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,15 @@ build_installer_image() {
120120

121121
# Build installer image
122122

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

0 commit comments

Comments
 (0)