Ejemplo n.º 1
0
def main():
    # Fixup env variables.  Leaving `USE_CCACHE` on will cause scribe to fail to build
    # VCPKG_ROOT seems to cause confusion on Windows systems that previously used it for
    # building OpenSSL
    removeEnvVars = ['VCPKG_ROOT', 'USE_CCACHE']
    for var in removeEnvVars:
        if var in os.environ:
            del os.environ[var]

    args = parse_args()

    if args.ci_build:
        logging.basicConfig(datefmt='%s',
                            format='%(asctime)s %(guid)s %(message)s',
                            level=logging.INFO)

    logger.info('sha=%s' % headSha())
    logger.info('start')

    # Only allow one instance of the program to run at a time
    pm = hifi_vcpkg.VcpkgRepo(args)
    with hifi_singleton.Singleton(pm.lockFile) as lock:
        with timer('Bootstraping'):
            if not pm.upToDate():
                pm.bootstrap()

        # Always write the tag, even if we changed nothing.  This
        # allows vcpkg to reclaim disk space by identifying directories with
        # tags that haven't been touched in a long time
        pm.writeTag()

        # Grab our required dependencies:
        #  * build host tools, like spirv-cross and scribe
        #  * build client dependencies like openssl and nvtt
        with timer('Setting up dependencies'):
            pm.setupDependencies()

        # wipe out the build directories (after writing the tag, since failure
        # here shouldn't invalidte the vcpkg install)
        with timer('Cleaning builds'):
            pm.cleanBuilds()

        # If we're running in android mode, we also need to grab a bunch of additional binaries
        # (this logic is all migrated from the old setupDependencies tasks in gradle)
        if args.android:
            # Find the target location
            appPath = hifi_utils.scriptRelative('android/apps/' + args.android)
            # Copy the non-Qt libraries specified in the config in hifi_android.py
            hifi_android.copyAndroidLibs(pm.androidPackagePath, appPath)
            # Determine the Qt package path
            qtPath = os.path.join(pm.androidPackagePath, 'qt')
            hifi_android.QtPackager(appPath, qtPath).bundle()

        # Write the vcpkg config to the build directory last
        with timer('Writing configuration'):
            pm.writeConfig()

    logger.info('end')
Ejemplo n.º 2
0
def main():
    # Fixup env variables.  Leaving `USE_CCACHE` on will cause scribe to fail to build
    # VCPKG_ROOT seems to cause confusion on Windows systems that previously used it for 
    # building OpenSSL
    removeEnvVars = ['VCPKG_ROOT', 'USE_CCACHE']
    for var in removeEnvVars:
        if var in os.environ:
            del os.environ[var]

    args = parse_args()

    if args.ci_build:
        logging.basicConfig(datefmt='%s', format='%(asctime)s %(guid)s %(message)s', level=logging.INFO)

    logger.info('sha=%s' % headSha())
    logger.info('start')

    # Only allow one instance of the program to run at a time
    pm = hifi_vcpkg.VcpkgRepo(args)
    with hifi_singleton.Singleton(pm.lockFile) as lock:
        with timer('Bootstraping'):
            if not pm.upToDate():
                pm.bootstrap()

        # Always write the tag, even if we changed nothing.  This 
        # allows vcpkg to reclaim disk space by identifying directories with
        # tags that haven't been touched in a long time
        pm.writeTag()

        # Grab our required dependencies:
        #  * build host tools, like spirv-cross and scribe
        #  * build client dependencies like openssl and nvtt
        with timer('Setting up dependencies'):
            pm.setupDependencies()

        # wipe out the build directories (after writing the tag, since failure 
        # here shouldn't invalidte the vcpkg install)
        with timer('Cleaning builds'):
            pm.cleanBuilds()

        # If we're running in android mode, we also need to grab a bunch of additional binaries
        # (this logic is all migrated from the old setupDependencies tasks in gradle)
        if args.android:
            # Find the target location
            appPath = hifi_utils.scriptRelative('android/apps/' + args.android)
            # Copy the non-Qt libraries specified in the config in hifi_android.py
            hifi_android.copyAndroidLibs(pm.androidPackagePath, appPath)
            # Determine the Qt package path
            qtPath = os.path.join(pm.androidPackagePath, 'qt')
            hifi_android.QtPackager(appPath, qtPath).bundle()

        # Write the vcpkg config to the build directory last
        with timer('Writing configuration'):
            pm.writeConfig()

    logger.info('end')
Ejemplo n.º 3
0
def main():
    # Fixup env variables.  Leaving `USE_CCACHE` on will cause scribe to fail to build
    # VCPKG_ROOT seems to cause confusion on Windows systems that previously used it for
    # building OpenSSL
    removeEnvVars = ['VCPKG_ROOT', 'USE_CCACHE']
    for var in removeEnvVars:
        if var in os.environ:
            del os.environ[var]

    args = parse_args()
    nsis_urls = hifi_utils.readEnviromentVariableFromFile(
        args.build_root, 'EXTERNAL_NSIS_HIFI_PLUGINS_URLS').split(';')

    if args.ci_build:
        logging.basicConfig(datefmt='%H:%M:%S',
                            format='%(asctime)s %(guid)s %(message)s',
                            level=logging.INFO)

    logger.info('start')

    # OS dependent information
    system = platform.system()
    if 'Windows' == system and 'CI_BUILD' in os.environ and os.environ[
            "CI_BUILD"] == "Github":
        logger.info("Downloading NSIS")
        with timer('NSIS'):
            hifi_utils.downloadAndExtract(nsis_urls, "C:/Program Files (x86)")

    qtInstallPath = None
    # If not android, install our Qt build
    if not args.android:
        qt = hifi_qt.QtDownloader(args)
        qtInstallPath = qt.cmakePath

        if qtInstallPath is not None:
            # qtInstallPath is None when we're doing a system Qt build
            print("cmake path: " + qtInstallPath)

            with hifi_singleton.Singleton(qt.lockFile) as lock:
                with timer('Qt'):
                    qt.installQt()
                    qt.writeConfig()
        else:
            if (os.environ["VIRCADIA_USE_SYSTEM_QT"]):
                print("System Qt selected")
            else:
                raise Exception(
                    "Internal error: System Qt not selected, but hifi_qt.py failed to return a cmake path"
                )

    pm = hifi_vcpkg.VcpkgRepo(args)
    if qtInstallPath is not None:
        pm.writeVar('QT_CMAKE_PREFIX_PATH', qtInstallPath)

    # Only allow one instance of the program to run at a time

    if qtInstallPath is not None:
        pm.writeVar('QT_CMAKE_PREFIX_PATH', qtInstallPath)

    # Only allow one instance of the program to run at a time
    with hifi_singleton.Singleton(pm.lockFile) as lock:

        with timer('Bootstraping'):
            if not pm.upToDate():
                pm.bootstrap()

        # Always write the tag, even if we changed nothing.  This
        # allows vcpkg to reclaim disk space by identifying directories with
        # tags that haven't been touched in a long time
        pm.writeTag()

        # Grab our required dependencies:
        #  * build host tools, like spirv-cross and scribe
        #  * build client dependencies like openssl and nvtt
        with timer('Setting up dependencies'):
            pm.setupDependencies(qt=qtInstallPath)

        # wipe out the build directories (after writing the tag, since failure
        # here shouldn't invalidate the vcpkg install)
        with timer('Cleaning builds'):
            pm.cleanBuilds()

        # If we're running in android mode, we also need to grab a bunch of additional binaries
        # (this logic is all migrated from the old setupDependencies tasks in gradle)
        if args.android:
            # Find the target location
            appPath = hifi_utils.scriptRelative('android/apps/' + args.android)
            # Copy the non-Qt libraries specified in the config in hifi_android.py
            hifi_android.copyAndroidLibs(pm.androidPackagePath, appPath)
            # Determine the Qt package path
            qtPath = os.path.join(pm.androidPackagePath, 'qt')
            hifi_android.QtPackager(appPath, qtPath).bundle()

        # Fixup the vcpkg cmake to not reset VCPKG_TARGET_TRIPLET
        pm.fixupCmakeScript()

        if not args.vcpkg_skip_clean:
            # Cleanup downloads and packages folders in vcpkg to make it smaller for CI
            pm.cleanupDevelopmentFiles()

        # Write the vcpkg config to the build directory last
        with timer('Writing configuration'):
            pm.writeConfig()

    logger.info('end')
Ejemplo n.º 4
0
def main():
    # Fixup env variables.  Leaving `USE_CCACHE` on will cause scribe to fail to build
    # VCPKG_ROOT seems to cause confusion on Windows systems that previously used it for
    # building OpenSSL
    removeEnvVars = ['VCPKG_ROOT', 'USE_CCACHE']
    for var in removeEnvVars:
        if var in os.environ:
            del os.environ[var]

    args = parse_args()

    if args.ci_build:
        logging.basicConfig(datefmt='%H:%M:%S',
                            format='%(asctime)s %(guid)s %(message)s',
                            level=logging.INFO)

    logger.info('sha=%s' % headSha())
    logger.info('start')

    # OS dependent information
    system = platform.system()
    if 'Windows' == system and 'CI_BUILD' in os.environ and os.environ[
            "CI_BUILD"] == "Github":
        logger.info("Downloading NSIS")
        with timer('NSIS'):
            hifi_utils.downloadAndExtract(
                'https://athena-public.s3.amazonaws.com/dependencies/NSIS-hifi-plugins-1.0.tgz',
                "C:/Program Files (x86)")

    qtInstallPath = ''
    # If not android, install our Qt build
    if not args.android:
        qt = hifi_qt.QtDownloader(args)
        qtInstallPath = qt.cmakePath
        with hifi_singleton.Singleton(qt.lockFile) as lock:
            with timer('Qt'):
                qt.installQt()
                qt.writeConfig()

    pm = hifi_vcpkg.VcpkgRepo(args)
    if qtInstallPath != '':
        pm.writeVar('QT_CMAKE_PREFIX_PATH', qtInstallPath)

    # Only allow one instance of the program to run at a time
    with hifi_singleton.Singleton(pm.lockFile) as lock:

        with timer('Bootstraping'):
            if not pm.upToDate():
                pm.bootstrap()

        # Always write the tag, even if we changed nothing.  This
        # allows vcpkg to reclaim disk space by identifying directories with
        # tags that haven't been touched in a long time
        pm.writeTag()

        # Grab our required dependencies:
        #  * build host tools, like spirv-cross and scribe
        #  * build client dependencies like openssl and nvtt
        with timer('Setting up dependencies'):
            pm.setupDependencies(qt=qtInstallPath)

        # wipe out the build directories (after writing the tag, since failure
        # here shouldn't invalidte the vcpkg install)
        with timer('Cleaning builds'):
            pm.cleanBuilds()

        # If we're running in android mode, we also need to grab a bunch of additional binaries
        # (this logic is all migrated from the old setupDependencies tasks in gradle)
        if args.android:
            # Find the target location
            appPath = hifi_utils.scriptRelative('android/apps/' + args.android)
            # Copy the non-Qt libraries specified in the config in hifi_android.py
            hifi_android.copyAndroidLibs(pm.androidPackagePath, appPath)
            # Determine the Qt package path
            qtPath = os.path.join(pm.androidPackagePath, 'qt')
            hifi_android.QtPackager(appPath, qtPath).bundle()

        # Write the vcpkg config to the build directory last
        with timer('Writing configuration'):
            pm.writeConfig()

    logger.info('end')