Skip to content

Commit

Permalink
Merge branch 'grand_dispatch_queue' of github.com:awslabs/aws-c-io in…
Browse files Browse the repository at this point in the history
…to nw_socket
  • Loading branch information
xiazhvera committed Nov 8, 2024
2 parents 86f3b2d + f808b35 commit 72b51a0
Show file tree
Hide file tree
Showing 36 changed files with 966 additions and 769 deletions.
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ body:
description: What is the problem? A clear and concise description of the bug.
validations:
required: true
- type: checkboxes
id: regression
attributes:
label: Regression Issue
description: What is a regression? If it worked in a previous version but doesn't in the latest version, it's considered a regression. In this case, please provide specific version number in the report.
options:
- label: Select this option if this issue appears to be a regression.
required: false
- type: textarea
id: expected
attributes:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ jobs:
runs-on: macos-14 # latest
strategy:
matrix:
eventloop: ["-DAWS_USE_DISPATCH_QUEUE=ON", "-DAWS_USE_DISPATCH_QUEUE=OFF"]
eventloop: ["-DAWS_EVENT_LOOP_DISPATCH_QUEUE_OVERRIDE=ON", "-DAWS_EVENT_LOOP_DISPATCH_QUEUE_OVERRIDE=OFF"]
steps:
- name: Build ${{ env.PACKAGE_NAME }} + consumers
run: |
Expand All @@ -181,7 +181,7 @@ jobs:
runs-on: macos-14 # latest
strategy:
matrix:
eventloop: ["-DAWS_USE_DISPATCH_QUEUE=ON", "-DAWS_USE_DISPATCH_QUEUE=OFF"]
eventloop: ["-DAWS_EVENT_LOOP_DISPATCH_QUEUE_OVERRIDE=ON", "-DAWS_EVENT_LOOP_DISPATCH_QUEUE_OVERRIDE=OFF"]
steps:
- name: Build ${{ env.PACKAGE_NAME }} + consumers
run: |
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/issue-regression-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Apply potential regression label on issues
name: issue-regression-label
on:
issues:
types: [opened, edited]
jobs:
add-regression-label:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Fetch template body
id: check_regression
uses: actions/github-script@v7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TEMPLATE_BODY: ${{ github.event.issue.body }}
with:
script: |
const regressionPattern = /\[x\] Select this option if this issue appears to be a regression\./i;
const template = `${process.env.TEMPLATE_BODY}`
const match = regressionPattern.test(template);
core.setOutput('is_regression', match);
- name: Manage regression label
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ "${{ steps.check_regression.outputs.is_regression }}" == "true" ]; then
gh issue edit ${{ github.event.issue.number }} --add-label "potential-regression" -R ${{ github.repository }}
else
gh issue edit ${{ github.event.issue.number }} --remove-label "potential-regression" -R ${{ github.repository }}
fi
30 changes: 14 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@

cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.9)
project(aws-c-io C)

if (POLICY CMP0069)
cmake_policy(SET CMP0069 NEW) # Enable LTO/IPO if available in the compiler, see AwsCFlags
endif()

if (DEFINED CMAKE_PREFIX_PATH)
file(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH)
endif()
Expand Down Expand Up @@ -78,7 +74,7 @@ if (WIN32)
)
list(APPEND AWS_IO_OS_SRC ${AWS_IO_IOCP_SRC})

set(EVENT_LOOP_DEFINES "AWS_USE_IO_COMPLETION_PORTS")
set(EVENT_LOOP_DEFINE "IO_COMPLETION_PORTS")
endif ()

if (MSVC)
Expand All @@ -105,7 +101,7 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Androi
)
set(PLATFORM_LIBS "")

set(EVENT_LOOP_DEFINES "-DAWS_USE_EPOLL")
set(EVENT_LOOP_DEFINE "EPOLL")
set(USE_S2N ON)

elseif (APPLE)
Expand All @@ -114,8 +110,6 @@ elseif (APPLE)
)

file(GLOB AWS_IO_OS_SRC
"source/bsd/*.c"
"source/posix/*.c"
"source/darwin/*.c"
)

Expand All @@ -131,12 +125,16 @@ elseif (APPLE)

#No choice on TLS for apple, darwinssl will always be used.
list(APPEND PLATFORM_LIBS "-framework Security -framework Network")
set(EVENT_LOOP_DEFINES "DISPATCH_QUEUE" )

if(AWS_USE_DISPATCH_QUEUE OR IOS)
set(EVENT_LOOP_DEFINES "-DAWS_USE_DISPATCH_QUEUE" )
message("use dispatch queue")
else ()
set(EVENT_LOOP_DEFINES "-DAWS_USE_KQUEUE")
# Enable KQUEUE on MacOS
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
file(GLOB AWS_IO_KUEUE_SRC
"source/bsd/*.c"
"source/posix/*.c"
)
list(APPEND AWS_IO_OS_SRC ${AWS_IO_KUEUE_SRC})
set(EVENT_LOOP_DEFINE "KQUEUE")
endif()

elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
Expand All @@ -148,7 +146,7 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "NetB
"source/posix/*.c"
)

set(EVENT_LOOP_DEFINES "-DAWS_USE_KQUEUE")
set(EVENT_LOOP_DEFINE "KQUEUE")
set(USE_S2N ON)

endif()
Expand Down Expand Up @@ -201,7 +199,7 @@ aws_add_sanitizers(${PROJECT_NAME})
# We are not ABI stable yet
set_target_properties(${PROJECT_NAME} PROPERTIES VERSION 1.0.0)

target_compile_definitions(${PROJECT_NAME} PUBLIC "${EVENT_LOOP_DEFINES}")
target_compile_definitions(${PROJECT_NAME} PUBLIC "-DAWS_ENABLE_${EVENT_LOOP_DEFINE}")

if (BYO_CRYPTO)
target_compile_definitions(${PROJECT_NAME} PUBLIC "-DBYO_CRYPTO")
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This library is licensed under the Apache 2.0 License.

### Building

CMake 3.1+ is required to build.
CMake 3.9+ is required to build.

`<install-path>` must be an absolute path in the following instructions.

Expand Down
Loading

0 comments on commit 72b51a0

Please sign in to comment.