diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2023-09-11 10:07:51 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2023-09-11 10:07:51 -0400 |
commit | 29300a1fd356b7355ecfb56951e7d7ad0553ef15 (patch) | |
tree | 44df1dfbfe94451a850f36eba574a36aba19ce4b /indra | |
parent | dc0ebc96a4556b99b515364465b23a64e84f0899 (diff) |
SL-19242: Try harder to post artifacts containing exactly app image.
In a Windows build tree, we don't actually have an app-named top directory, so
don't package its containing directory -- just the app dir itself, e.g.
"newview/Release".
In a Mac build tree, though we do have "Second Life Mumble.app", its parent
directory also contains other large stuff. Try posting a temp directory
containing a symlink to the .app.
Ditch the "!*.bat" exclusion: the presence of a second path (even an
exclusion) changes how upload-artifact nests its contents.
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/newview/viewer_manifest.py | 46 |
1 files changed, 36 insertions, 10 deletions
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index dd9ca569ce..4084c1d9a4 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -37,6 +37,7 @@ import re import shutil import subprocess import sys +import tempfile import time viewer_dir = os.path.dirname(__file__) @@ -490,11 +491,8 @@ class WindowsManifest(ViewerManifest): if self.is_packaging_viewer(): # Find secondlife-bin.exe in the 'configuration' dir, then rename it to the result of final_exe. self.path(src='%s/secondlife-bin.exe' % self.args['configuration'], dst=self.final_exe()) - # Emit the whole app image as one of the GitHub step outputs. The - # current get_dst_prefix() is the top-level contents of the app - # directory -- so hop outward to the directory containing the app - # name. - self.set_github_output_path('viewer_app', os.pardir) + # Emit the whole app image as one of the GitHub step outputs. + self.set_github_output_path('viewer_app', '') with self.prefix(src=os.path.join(pkgdir, "VMP")): # include the compiled launcher scripts so that it gets included in the file_list @@ -855,11 +853,39 @@ class DarwinManifest(ViewerManifest): return bool(set(["package", "unpacked"]).intersection(self.args['actions'])) def construct(self): - # copy over the build result (this is a no-op if run within the xcode script) - self.path(os.path.join(self.args['configuration'], self.channel()+".app"), dst="") - # capture the entire destination app bundle, including the containing - # .app directory - self.set_github_output_path('viewer_app', os.pardir) + # copy over the build result (this is a no-op if run within the xcode + # script) + appname = self.channel() + ".app" + self.path(os.path.join(self.args['configuration'], appname), dst="") + RUNNER_TEMP = os.getenv('RUNNER_TEMP') + # When running as a GitHub Action job, RUNNER_TEMP is the recommended + # temp directory. If we're not running on GitHub, don't create this + # temp directory or this symlink: we don't clean them up, trusting + # that the runner is itself transient. On a dev machine, that would + # result in temp-directory clutter. + if RUNNER_TEMP: + # We want an artifact containing the "Second Life Mumble.app" + # directory, which in turn contains the whole app bundle. + # Unfortunately, the directory that contains the .app directory + # also contains other stuff, notably the xcarchive.zip, which is + # itself enormous. Create a temp directory containing only (a link + # to) our .app dir, and specify that as the directory to upload. + wrapdir = tempfile.mkdtemp(dir=RUNNER_TEMP) + applink = os.path.join(wrapdir, appname) + # This link will be used by a different job step, so link to an + # absolute path: we can't guarantee that the other step will have + # the same current directory. + # diagnostic output + parentdir = os.path.abspath(os.path.join(self.get_dst_prefix(), os.pardir)) + for dir in parentdir, os.path.join(parentdir, appname): + print(f'Contents of {dir}:') + for item in os.listdir(dir): + print(f' {item}') + # end diagnostic output + appreal = os.path.abspath(os.path.join(self.get_dst_prefix(), os.pardir, appname)) + print(f"Linking {applink} => {appreal}") + os.symlink(appreal, applink) + self.set_github_output_path('viewer_app', wrapdir) pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') relpkgdir = os.path.join(pkgdir, "lib", "release") |