Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
befe3f7a
Commit
befe3f7a
authored
Dec 10, 2018
by
Ned Deily
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macOS installer build: mitigate hdiutil resource busy bug
parent
c540c4ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
Mac/BuildScript/build-installer.py
Mac/BuildScript/build-installer.py
+17
-6
No files found.
Mac/BuildScript/build-installer.py
View file @
befe3f7a
...
...
@@ -1533,16 +1533,27 @@ def buildDMG():
imagepath
=
imagepath
+
'.dmg'
os
.
mkdir
(
outdir
)
# Try to mitigate race condition in certain versions of macOS, e.g. 10.9,
# when hdiutil create fails with "Resource busy". For now, just retry
# the create a few times and hope that it eventually works.
volname
=
'Python %s'
%
(
getFullVersion
())
runCommand
(
"hdiutil create -format UDRW -volname %s -srcfolder %s
%s"
%
(
cmd
=
(
"hdiutil create -format UDRW -volname %s -srcfolder %s -size 100m
%s"
%
(
shellQuote
(
volname
),
shellQuote
(
os
.
path
.
join
(
WORKDIR
,
'installer'
)),
shellQuote
(
imagepath
+
".tmp.dmg"
)))
# Try to mitigate race condition in certain versions of macOS, e.g. 10.9,
# when hdiutil fails with "Resource busy"
time
.
sleep
(
10
)
for
i
in
range
(
5
):
fd
=
os
.
popen
(
cmd
,
'r'
)
data
=
fd
.
read
()
xit
=
fd
.
close
()
if
not
xit
:
break
sys
.
stdout
.
write
(
data
)
print
(
" -- retrying hdiutil create"
)
time
.
sleep
(
5
)
else
:
raise
RuntimeError
(
"command failed: %s"
%
(
commandline
,))
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
WORKDIR
,
"mnt"
)):
os
.
mkdir
(
os
.
path
.
join
(
WORKDIR
,
"mnt"
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment