Skip to content

Commit

Permalink
Merge pull request #1057 from robgjansen/merge-master→dev
Browse files Browse the repository at this point in the history
Merge master→dev
  • Loading branch information
robgjansen committed Dec 15, 2020
2 parents 22ce2f1 + 96c9e18 commit b963f5e
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 64 deletions.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Questions, ideas, and general discussions
url: https://github.com/shadow/shadow/discussions
about: Please ask questions and share ideas here.
20 changes: 0 additions & 20 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

14 changes: 0 additions & 14 deletions .github/ISSUE_TEMPLATE/question.md

This file was deleted.

4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ updates:
interval: 'daily'
target-branch: 'dev'
labels:
- 'Component: Dependencies'
- 'Component: Build'

- package-ecosystem: 'cargo'
directory: '/src/test'
schedule:
interval: 'daily'
target-branch: 'dev'
labels:
- 'Component: Dependencies'
- 'Component: Build'
73 changes: 49 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ message(STATUS "SHADOW_VERSION_MAJOR=${SHADOW_VERSION_MAJOR}")
message(STATUS "SHADOW_VERSION_MINOR=${SHADOW_VERSION_MINOR}")
message(STATUS "SHADOW_VERSION_PATCH=${SHADOW_VERSION_PATCH}")

set(SHADOW_INFO_STRING_CONF "For more information, visit https://shadow.github.io or https://github.com/shadow")
set(SHADOW_VERSION_STRING_CONF "Shadow")

if(EXISTS ${CMAKE_SOURCE_DIR}/.git)
Expand All @@ -99,26 +98,19 @@ if(EXISTS ${CMAKE_SOURCE_DIR}/.git)
string(REGEX REPLACE "\n" "" DESCRIBE ${DESCRIBE})
set(SHADOW_VERSION_STRING_CONF "${SHADOW_VERSION_STRING_CONF} ${DESCRIBE}")
endif(DESCRIBE)

## current git commit short date
EXECUTE_PROCESS(COMMAND "git" "log" "--pretty=format:%ad" "--date=short" "-n" "1" OUTPUT_VARIABLE SHORTDATE)
if(SHORTDATE)
set(SHADOW_VERSION_STRING_CONF "${SHADOW_VERSION_STRING_CONF} ${SHORTDATE}")
endif(SHORTDATE)
EXECUTE_PROCESS(COMMAND "git" "log" "--pretty=format:%ad" "--date=format:%Y-%m-%d--%H:%M:%S" "-n" "1" OUTPUT_VARIABLE COMMITDATE)
if(COMMITDATE)
set(SHADOW_VERSION_STRING_CONF "${SHADOW_VERSION_STRING_CONF} ${COMMITDATE}")
endif(COMMITDATE)
else()
set(SHADOW_VERSION_STRING_CONF "${SHADOW_VERSION_STRING_CONF} v${SHADOW_VERSION_MAJOR}.${SHADOW_VERSION_MINOR}.${SHADOW_VERSION_PATCH}")
endif()

message(STATUS "Building ${SHADOW_VERSION_STRING_CONF}")

## current build date
string(TIMESTAMP BUILDDATE "%Y-%m-%d")
if(BUILDDATE)
set(SHADOW_VERSION_STRING_CONF "${SHADOW_VERSION_STRING_CONF} (built ${BUILDDATE})")
endif(BUILDDATE)

## setup shadow options
option(SHADOW_DEBUG "turn on debugging for verbose program output (default: OFF)" OFF)
option(SHADOW_PROFILE "build with profile settings (default: OFF)" OFF)
option(SHADOW_TEST "build tests (default: OFF)" OFF)
option(SHADOW_EXPORT "export service libraries and headers (default: OFF)" OFF)
Expand All @@ -129,10 +121,10 @@ option(SHADOW_COVERAGE "enable code-coverage instrumentation. (default: OFF)" OF
MESSAGE(STATUS)
MESSAGE(STATUS "-------------------------------------------------------------------------------")
MESSAGE(STATUS "Current settings: (change with '$ cmake -D<OPTION>=<ON|OFF>')")
MESSAGE(STATUS "SHADOW_DEBUG=${SHADOW_DEBUG}")
MESSAGE(STATUS "SHADOW_PROFILE=${SHADOW_PROFILE}")
MESSAGE(STATUS "SHADOW_TEST=${SHADOW_TEST}")
MESSAGE(STATUS "SHADOW_EXPORT=${SHADOW_EXPORT}")
MESSAGE(STATUS "SHADOW_WERROR=${SHADOW_WERROR}")
MESSAGE(STATUS "-------------------------------------------------------------------------------")
MESSAGE(STATUS)

Expand All @@ -142,17 +134,20 @@ set(CMAKE_C_FLAGS_RELEASE "")
add_compile_options(-ggdb)
add_compile_options(-fno-omit-frame-pointer)

if(SHADOW_DEBUG STREQUAL ON)
message(STATUS "CMAKE_BUILD_TYPE Debug enabled.")
message(STATUS "Found CMAKE_BUILD_TYPE='$ENV{CMAKE_BUILD_TYPE}'")
if("$ENV{CMAKE_BUILD_TYPE}" STREQUAL "Debug")
message(STATUS "Debug build enabled.")
set(CMAKE_BUILD_TYPE Debug)
add_definitions(-DDEBUG)
add_compile_options(-O0)
else(SHADOW_DEBUG STREQUAL ON)
message(STATUS "CMAKE_BUILD_TYPE Release enabled.")
elseif(("$ENV{CMAKE_BUILD_TYPE}" STREQUAL "") OR ("$ENV{CMAKE_BUILD_TYPE}" STREQUAL "Release"))
message(STATUS "Release build enabled.")
set(CMAKE_BUILD_TYPE Release)
add_definitions(-DNDEBUG)
add_compile_options(-O3)
endif(SHADOW_DEBUG STREQUAL ON)
else()
MESSAGE(FATAL_ERROR "Unknown build type '$ENV{CMAKE_BUILD_TYPE}'; valid types are 'Release' or 'Debug'")
endif()

if(SHADOW_WERROR STREQUAL ON)
add_compile_options(-Werror)
Expand Down Expand Up @@ -184,10 +179,6 @@ if(SHADOW_EXPORT STREQUAL ON)
MESSAGE(STATUS "will export Shadow plug-in service libraries and headers")
endif(SHADOW_EXPORT STREQUAL ON)

## generate config header and make sure its on the include path
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_BINARY_DIR}/src/shd-config.h)
install(FILES ${CMAKE_BINARY_DIR}/src/shd-config.h DESTINATION include/)

#if(POLICY CMP0026)
# cmake_policy(SET CMP0026 OLD)
#endif()
Expand All @@ -203,10 +194,44 @@ add_subdirectory(${CMAKE_SOURCE_DIR}/resource/)
add_subdirectory(${CMAKE_SOURCE_DIR}/src/)
add_subdirectory(${CMAKE_SOURCE_DIR}/cpack/)

## Add more build info that will appear in 'shadow -v' and in the log file
## This should come after the project tree recursion so we can pick up the
## compile options for the shadow target
string(TIMESTAMP BUILDDATE "%Y-%m-%d--%H:%M:%S")
get_target_property(SHADOW_COMPILE_OPTIONS shadow COMPILE_OPTIONS)
get_target_property(SHADOW_LINK_OPTIONS shadow LINK_FLAGS)
set(SHADOW_BUILD_STRING_CONF "Shadow was built")
if(EXISTS ${CMAKE_SOURCE_DIR}/.git)
## current branch name (will be added)
EXECUTE_PROCESS(COMMAND "git" "rev-parse" "--abbrev-ref" "HEAD" OUTPUT_VARIABLE BRANCHNAME)
if(BRANCHNAME)
string(REGEX REPLACE "\n" "" BRANCHNAME ${BRANCHNAME})
set(SHADOW_BUILD_STRING_CONF "${SHADOW_BUILD_STRING_CONF} from branch ${BRANCHNAME}")
endif(BRANCHNAME)
endif()
if(BUILDDATE)
set(SHADOW_BUILD_STRING_CONF "${SHADOW_BUILD_STRING_CONF} on ${BUILDDATE}")
endif(BUILDDATE)
if(CMAKE_BUILD_TYPE)
set(SHADOW_BUILD_STRING_CONF "${SHADOW_BUILD_STRING_CONF} in ${CMAKE_BUILD_TYPE} mode")
endif(CMAKE_BUILD_TYPE)
if(SHADOW_COMPILE_OPTIONS)
set(SHADOW_BUILD_STRING_CONF "${SHADOW_BUILD_STRING_CONF} with compile options: ${SHADOW_COMPILE_OPTIONS}")
endif(SHADOW_COMPILE_OPTIONS)
if(SHADOW_LINK_OPTIONS)
set(SHADOW_BUILD_STRING_CONF "${SHADOW_BUILD_STRING_CONF} and link options: ${SHADOW_LINK_OPTIONS}")
endif(SHADOW_LINK_OPTIONS)
## build info
set(SHADOW_INFO_STRING_CONF "For more information, visit https://shadow.github.io or https://github.com/shadow")

## generate config header and make sure its on the include path
## this should come after create the version info to make sure it's included
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_BINARY_DIR}/src/shd-config.h)
install(FILES ${CMAKE_BINARY_DIR}/src/shd-config.h DESTINATION include/)

## install our 'exported' libs so they can be imported by others
file(GLOB CMAKE_CUSTOM_MODULES "${CMAKE_SOURCE_DIR}/cmake/*cmake")
install(FILES ${CMAKE_CUSTOM_MODULES} DESTINATION share/cmake/Modules/)
if(SHADOW_EXPORT STREQUAL ON)
install(EXPORT shadow-externals DESTINATION share/)
endif(SHADOW_EXPORT STREQUAL ON)

1 change: 1 addition & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#endif

#define SHADOW_VERSION_STRING "${SHADOW_VERSION_STRING_CONF}"
#define SHADOW_BUILD_STRING "${SHADOW_BUILD_STRING_CONF}"
#define SHADOW_INFO_STRING "${SHADOW_INFO_STRING_CONF}"

#define SHADOW_VERSION_FULL "${SHADOW_VERSION_FULL}"
Expand Down
2 changes: 1 addition & 1 deletion setup
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def build(args, remaining):
cmake_cmd = "cmake " + rootdir + " -DCMAKE_INSTALL_PREFIX=" + installdir

# other cmake options
if args.do_debug: cmake_cmd += " -DSHADOW_DEBUG=ON"
if args.do_debug: os.putenv("CMAKE_BUILD_TYPE", "Debug")
if args.do_verbose: os.putenv("VERBOSE", "1")
if args.do_test: cmake_cmd += " -DSHADOW_TEST=ON"
if args.do_profile: cmake_cmd += " -DSHADOW_PROFILE=ON"
Expand Down
2 changes: 1 addition & 1 deletion src/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if(SHADOW_PROFILE STREQUAL ON)
add_cflags(-pg)
endif(SHADOW_PROFILE STREQUAL ON)

if(SHADOW_DEBUG STREQUAL ON)
if(CMAKE_BUILD_TYPE STREQUAL Debug)
message(STATUS "Building Rust library in debug mode.")
set(RUST_BUILD_TYPE "debug")
set(RUST_BUILD_FLAG "")
Expand Down
5 changes: 3 additions & 2 deletions src/main/core/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ static gint _main_helper(Options* options) {
}
g_free(startupStr);

message(SHADOW_BUILD_STRING);
message(SHADOW_INFO_STRING);
message("logging current startup arguments and environment");

Expand Down Expand Up @@ -205,19 +206,19 @@ gint main_runShadow(gint argc, gchar* argv[]) {
return EXIT_FAILURE;
}


// If we are just printing the version or running a cleanup+exit,
// then print the version, cleanup if requested, and exit with success.
if (options_doRunPrintVersion(options) ||
options_shouldExitAfterShmCleanup(options)) {
g_printerr("%s running GLib v%u.%u.%u and IGraph v%s\n%s\n",
g_printerr("%s running GLib v%u.%u.%u and IGraph v%s\n%s\n%s\n",
SHADOW_VERSION_STRING,
(guint)GLIB_MAJOR_VERSION, (guint)GLIB_MINOR_VERSION, (guint)GLIB_MICRO_VERSION,
#if defined(IGRAPH_VERSION)
IGRAPH_VERSION,
#else
"(n/a)",
#endif
SHADOW_BUILD_STRING,
SHADOW_INFO_STRING);

if (options_shouldExitAfterShmCleanup(options)) {
Expand Down

0 comments on commit b963f5e

Please sign in to comment.