mirror of
				https://github.com/cookiengineer/audacity
				synced 2025-10-31 22:23:54 +01:00 
			
		
		
		
	Reattempt fixing MacOS build problem related to CPack issue (#198)
* Undo non-working Mac OS CI build fix in build_dist.sh * Implement CPack workaround for CMake PR #4769 * Fix typo in scripts/ci/package.sh * Fix typo in scripts/ci/package.sh * Add debug option for hdiutil_repeat.sh * Make reviewer changes * Change typo in package.sh with hdiutil script name. * Change path reference in package.sh to use $PWD. * Add strings to escape path in scripts/ci/package.sh * Fix scripts/ci/macos/repeat_hdiutil.sh * Remove -e option. Don't copy/paste without double checking closely I guess. 😐 * 💲 Add dollar signs where appropriate as reviewers pointed out. * Replace until/do contents with easier to read if block. * Cleanup readability of scripts/ci/macos/repeat_hdiutil.sh * Add $wait_before_retry config value * Replace $cmd_string with literal value * Move do onto same line as until. * Minor changes to fix for MacOS CMake builds * Rename variable in scripts/ci/macos/repeat_hdiutil.sh * Use . instead of pwd in package.sh Signed-off-by: Emily Mabrey <emilymabrey93@gmail.com>
This commit is contained in:
		| @@ -205,7 +205,7 @@ cp "${SRCROOT}/Resources/Audacity-DMG-background.png" "${DMG}/.background" | ||||
| ATTACHED=$(hdiutil info | awk "/\/Volumes\/${VOL}/{print \$1}") | ||||
| if [ -n "${ATTACHED}" ] | ||||
| then | ||||
|    #hdiutil detach "${ATTACHED}" | ||||
|    hdiutil detach "${ATTACHED}" | ||||
| fi | ||||
|  | ||||
| # Create and mount the image | ||||
|   | ||||
							
								
								
									
										20
									
								
								scripts/ci/macos/repeat_hdiutil.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								scripts/ci/macos/repeat_hdiutil.sh
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,20 @@ | ||||
| #!/usr/bin/env bash | ||||
|  | ||||
| ((${BASH_VERSION%%.*} >= 4)) || { echo >&2 "$0: Error: Please upgrade Bash."; exit 1; } | ||||
|  | ||||
| set -uxo pipefail | ||||
|  | ||||
| max_retry=5 | ||||
| counter=0 | ||||
| num_secs_await_retry=1 | ||||
|  | ||||
| until /usr/bin/hdiutil ""$*"" -debug; do | ||||
|    sleep $num_secs_await_retry | ||||
|    if [[ $counter -eq $max_retry ]]; then | ||||
|         echo "CPack failed despite retry attempts!" | ||||
|         exit 1 | ||||
|    else | ||||
|         echo "Trying CPack hdiutil call again. Try #$counter" | ||||
|         ((counter++)) | ||||
|    fi | ||||
| done | ||||
| @@ -9,6 +9,7 @@ cd build | ||||
| if [[ "${OSTYPE}" == msys* && ${GIT_BRANCH} == release* ]]; then # Windows | ||||
|     cmake --build . --target innosetup --config "${AUDACITY_BUILD_TYPE}" | ||||
| else | ||||
|     export CPACK_COMMAND_HDIUTIL="./macos/repeat_hdiutil.sh" | ||||
|     cpack -C "${AUDACITY_BUILD_TYPE}" --verbose | ||||
| fi | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user