Skip to content

Commit 2110095

Browse files
authored
Merge pull request #3223 from softins/mac-codeql-fix
Autobuild: Work around CodeQL-induced build failures
2 parents 57a29b2 + 0cfb631 commit 2110095

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

mac/deploy_mac.sh

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

121121
# Build installer image
122122

123-
create-dmg \
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+
#
132+
# /System/Library/PrivateFrameworks/DiskImages.framework/Resources/diskimages-helper.
133+
sudo -u "$USER" create-dmg \
124134
--volname "${client_target_name} Installer" \
125135
--background "${resources_path}/installerbackground.png" \
126136
--window-pos 200 400 \

0 commit comments

Comments
 (0)