def generate(boringssl_clone):
    # Change directory into boringssl_clone because generate_build_files.py
    # expects to run from this location
    os.chdir(boringssl_clone)

    # Import src/util/generate_build_files.py
    sys.path.append(os.path.join(boringssl_clone, 'src', 'util'))
    import generate_build_files

    g = BoringSSLGenerator()
    generate_build_files.EMBED_TEST_DATA = False
    generate_build_files.main([g])

    # Write third_party/boringssl/sources.cmake
    writeSourcesCmake(g)

    # Copy source files into third_party/boringssl/
    copySourceFiles(g, boringssl_clone)

    # Write fake-source files for ios/ which use #include "../..." to include
    # the original source file. This is necessary because webcrypto.podspec
    # cannot reference sources not under the ios/ folder.
    # But the C-preprocessor can still include them :D
    writeFakeIosSource(g)

    # Add a README.md to the third_party/boringssl/ folder
    readmePath = os.path.join('third_party', 'boringssl', 'README.md')
    writeFile(readmePath, BORINGSSL_FOLDER_README)

    # Copy LICENSE file for BoringSSL into third_party/boringssl/LICENSE
    # because all files in this folder are copied or generated from BoringSSL.
    LICENSE_src = os.path.join(boringssl_clone, 'src', 'LICENSE')
    LICENSE_dst = os.path.join(ROOT_PATH, 'third_party', 'boringssl',
                               'LICENSE')
    shutil.copy(LICENSE_src, LICENSE_dst)
Пример #2
0
            } for test in test_binaries],
            'tests': [{
                'name': 'boringssl_%s' % test,
                'args': [],
                'exclude_configs': ['asan', 'ubsan'],
                'ci_platforms': ['linux', 'mac', 'posix', 'windows'],
                'platforms': ['linux', 'mac', 'posix', 'windows'],
                'flaky': False,
                'gtest': True,
                'language': 'c++',
                'boringssl': True,
                'defaults': 'boringssl',
                'cpu_cost': 1.0
            } for test in test_binaries]
        }


os.chdir(os.path.dirname(sys.argv[0]))
os.mkdir('src')
try:
    for f in os.listdir(boring_ssl_root):
        os.symlink(os.path.join(boring_ssl_root, f), os.path.join('src', f))

    g = Grpc()
    generate_build_files.main([g])

    print(yaml.dump(g.yaml))

finally:
    shutil.rmtree('src')
Пример #3
0
            'args': [],
            'exclude_configs': ['asan', 'ubsan'],
            'ci_platforms': ['linux', 'mac', 'posix', 'windows'],
            'platforms': ['linux', 'mac', 'posix', 'windows'],
            'flaky': False,
            'gtest': True,
            'language': 'c++',
            'boringssl': True,
            'defaults': 'boringssl',
            'cpu_cost': 1.0
          }
          for test in test_binaries
      ]
    }


os.chdir(os.path.dirname(sys.argv[0]))
os.mkdir('src')
try:
  for f in os.listdir(boring_ssl_root):
    os.symlink(os.path.join(boring_ssl_root, f),
               os.path.join('src', f))

  g = Grpc()
  generate_build_files.main([g])

  print yaml.dump(g.yaml)

finally:
  shutil.rmtree('src')
Пример #4
0
                'cpu_cost': 1.0
            } for test in test_binaries]
        }


os.chdir(os.path.dirname(sys.argv[0]))
os.mkdir('src')
try:
    for f in os.listdir(boring_ssl_root):
        os.symlink(os.path.join(boring_ssl_root, f), os.path.join('src', f))

    grpc_platform = Grpc()
    # We use a hack to run boringssl's util/generate_build_files.py as part of this script.
    # The call will populate "grpc_platform" with boringssl's source file metadata.
    # As a side effect this script generates err_data.c and crypto_test_data.cc (requires golang)
    # Both of these files are already available under third_party/boringssl-with-bazel
    # so we don't need to generate them again, but there's no option to disable that behavior.
    # - crypto_test_data.cc is required to run boringssl_crypto_test but we already
    #   use the copy under third_party/boringssl-with-bazel so we just delete it
    # - err_data.c is currently only used by the obj-C boringssl podspec
    # TODO(jtattermusch): avoid the need to keep src/boringssl/err_data.c
    generate_build_files.main([grpc_platform])

    print(yaml.dump(grpc_platform.yaml))

finally:
    if os.path.exists('crypto_test_data.cc'):
        os.remove('crypto_test_data.cc'
                 )  # we don't want this file (see comment above)
    shutil.rmtree('src')