-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
57 changed files
with
1,640 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ on: | |
- 'main' | ||
|
||
env: | ||
BUILDER_VERSION: v0.9.43 | ||
BUILDER_VERSION: v0.9.49 | ||
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net | ||
BUILDER_SOURCE: releases | ||
PACKAGE_NAME: aws-c-common | ||
|
@@ -197,10 +197,9 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build ${{ env.PACKAGE_NAME }} + consumers | ||
uses: cross-platform-actions/action@v0.10.0 | ||
uses: cross-platform-actions/action@v0.20.0 | ||
with: | ||
operating_system: openbsd | ||
architecture: x86-64 | ||
version: '7.2' | ||
shell: bash | ||
run: | | ||
|
@@ -209,6 +208,23 @@ jobs: | |
chmod a+x builder | ||
./builder build -p ${{ env.PACKAGE_NAME }} | ||
freebsd: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- name: Build ${{ env.PACKAGE_NAME }} + consumers | ||
uses: cross-platform-actions/[email protected] | ||
with: | ||
operating_system: freebsd | ||
version: '13.2' | ||
run: | | ||
sudo pkg install -y python3 py39-urllib3 py39-pip cmake | ||
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz', 'builder')" | ||
chmod a+x builder | ||
./builder build -p ${{ env.PACKAGE_NAME }} | ||
cross_compile: | ||
name: Cross Compile ${{matrix.arch}} | ||
runs-on: ubuntu-20.04 # latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
project(print-sys-info C) | ||
|
||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_INSTALL_PREFIX}/lib/cmake") | ||
|
||
file(GLOB SI_SRC | ||
"*.c" | ||
) | ||
|
||
set(SI_PROJECT_NAME print-sys-info) | ||
add_executable(${SI_PROJECT_NAME} ${SI_SRC}) | ||
aws_set_common_properties(${SI_PROJECT_NAME}) | ||
|
||
|
||
target_include_directories(${SI_PROJECT_NAME} PUBLIC | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
$<INSTALL_INTERFACE:include>) | ||
|
||
target_link_libraries(${SI_PROJECT_NAME} PRIVATE aws-c-common) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
|
||
|
||
#include <aws/common/byte_buf.h> | ||
#include <aws/common/logging.h> | ||
#include <aws/common/system_info.h> | ||
|
||
int main(void) { | ||
struct aws_allocator *allocator = aws_default_allocator(); | ||
aws_common_library_init(allocator); | ||
struct aws_logger_standard_options options = { | ||
.file = stderr, | ||
.level = AWS_LOG_LEVEL_TRACE, | ||
}; | ||
|
||
struct aws_logger logger; | ||
aws_logger_init_standard(&logger, allocator, &options); | ||
aws_logger_set(&logger); | ||
|
||
struct aws_system_environment *env = aws_system_environment_load(allocator); | ||
|
||
fprintf(stdout, "crt-detected env: {\n"); | ||
|
||
struct aws_byte_cursor virtualization_vendor = aws_system_environment_get_virtualization_vendor(env); | ||
fprintf( | ||
stdout, | ||
" 'virtualization vendor': '" PRInSTR "',\n", | ||
(int)virtualization_vendor.len, | ||
virtualization_vendor.ptr); | ||
struct aws_byte_cursor product_name = aws_system_environment_get_virtualization_product_name(env); | ||
fprintf(stdout, " 'product name': '" PRInSTR "',\n", (int)product_name.len, product_name.ptr); | ||
fprintf( | ||
stdout, " 'number of processors': '%lu',\n", (unsigned long)aws_system_environment_get_processor_count(env)); | ||
size_t numa_nodes = aws_system_environment_get_cpu_group_count(env); | ||
|
||
if (numa_nodes > 1) { | ||
fprintf(stdout, " 'numa architecture': 'true',\n"); | ||
fprintf(stdout, " 'number of numa nodes': '%lu'\n", (unsigned long)numa_nodes); | ||
} else { | ||
fprintf(stdout, " 'numa architecture': 'false'\n"); | ||
} | ||
|
||
fprintf(stdout, "}\n"); | ||
aws_system_environment_release(env); | ||
aws_logger_clean_up(&logger); | ||
|
||
aws_common_library_clean_up(); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.