Install `version.h` under `include/ccf` (#2562)

This commit is contained in:
Julien Maffre 2021-05-06 19:47:00 +01:00 коммит произвёл GitHub
Родитель bcded7f935
Коммит df8d6928ea
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
10 изменённых файлов: 44 добавлений и 12 удалений

5
.gitignore поставляемый
Просмотреть файл

@ -25,7 +25,8 @@ latex/
env/
*.egg-info
**/dist
python/setup.py
node_modules
package-lock.json
.cache
.cache
include/ccf/version.h
python/version.py

Просмотреть файл

@ -43,10 +43,16 @@ include(GNUInstallDirs)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/common.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/aft.cmake)
configure_file(
${CCF_DIR}/src/common/version.h.in ${CCF_GENERATED_DIR}/version.h @ONLY
set(CMAKE_GENERATED_COMMENT
"This file was auto-generated by CMake from a corresponding *.in file. DO NOT EDIT"
)
configure_file(${CCF_DIR}/python/setup.py.in ${CCF_DIR}/python/setup.py @ONLY)
configure_file(
${CCF_DIR}/src/common/version.h.in ${CCF_DIR}/include/ccf/version.h @ONLY
)
configure_file(
${CCF_DIR}/python/version.py.in ${CCF_DIR}/python/version.py @ONLY
)
install(FILES ${CCF_DIR}/include/ccf/version.h DESTINATION include/ccf)
if(ENABLE_BFT)
set(CONSENSUSES cft bft)

Просмотреть файл

@ -1,8 +1,12 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache 2.0 License.
from setuptools import setup # type: ignore
from os import path
from setuptools import setup # type: ignore
# pylint: disable=import-error
import version # type: ignore
import versionifier
PACKAGE_NAME = "ccf"
@ -13,12 +17,12 @@ path_here = path.abspath(path.dirname(__file__))
with open(path.join(path_here, "README.md"), encoding="utf-8") as f:
long_description = f.read()
with open('requirements.txt') as f:
with open("requirements.txt") as f:
requirements = f.read().splitlines()
setup(
name=PACKAGE_NAME,
version=str(versionifier.to_python_version("@CCF_VERSION@")),
version=str(versionifier.to_python_version(version.CCF_VERSION)),
description="Set of tools and utilities for the Confidential Consortium Framework (CCF)",
long_description=long_description,
long_description_content_type="text/markdown",

12
python/version.py.in Normal file
Просмотреть файл

@ -0,0 +1,12 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache 2.0 License.
# fmt: off
#
# @CMAKE_GENERATED_COMMENT@
#
CCF_VERSION = "@CCF_VERSION@"
# fmt: on

Просмотреть файл

@ -11,6 +11,7 @@
#include "ccf/historical_queries_adapter.h"
#include "ccf/http_query.h"
#include "ccf/user_frontend.h"
#include "ccf/version.h"
#include <charconv>
#define FMT_HEADER_ONLY

Просмотреть файл

@ -6,5 +6,13 @@
namespace ccf
{
// clang-format off
//
// @CMAKE_GENERATED_COMMENT@
//
static constexpr auto ccf_version = "@CCF_VERSION@";
// clang-format on
}

Просмотреть файл

@ -1,5 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the Apache 2.0 License.
#include "ccf/version.h"
#include "common/enclave_interface_types.h"
#include "ds/json.h"
#include "ds/logger.h"
@ -8,7 +9,6 @@
#include "enclave.h"
#include "enclave_time.h"
#include "oe_shim.h"
#include "version.h"
#include <chrono>
#include <thread>

Просмотреть файл

@ -2,11 +2,11 @@
// Licensed under the Apache 2.0 License.
#pragma once
#include "ccf/version.h"
#include "crypto/hash.h"
#include "crypto/key_pair.h"
#include "ds/logger.h"
#include "enclave/interface.h"
#include "version.h"
#include <dlfcn.h>
#ifdef VIRTUAL_ENCLAVE

Просмотреть файл

@ -1,5 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the Apache 2.0 License.
#include "ccf/version.h"
#include "ds/cli_helper.h"
#include "ds/files.h"
#include "ds/logger.h"
@ -16,7 +17,6 @@
#include "snapshot.h"
#include "ticker.h"
#include "time_updater.h"
#include "version.h"
#include <CLI11/CLI11.hpp>
#include <codecvt>

Просмотреть файл

@ -3,7 +3,7 @@
# Licensed under the Apache 2.0 License.
set -ex
mkdir build_against_install
mkdir -p build_against_install
cd build_against_install
CC=$(which clang-8) CXX=$(which clang++-8) cmake -GNinja ../samples/apps/logging/
ninja