Skip to content

Commit 9ee9cdb

Browse files
authored
support windows python (#592)
* feat(id): support unique id - unique id in ms - refactor common library - remove dependence from shm - php-agent 0.5.0 - python-agent v1.2.1 * feat(win32): support win32 - python-agent - common library - refactor common library - fix bug when pooling - cibuildwheel - code style - fix bug in endTrace * fix bug in thread mode * remove ambiguous API * pipy 1.2.4 release test * test char encoding * fix bug in python * hello packet, avoiding conflict * fix bug in flask * fix convert problem
1 parent 9f3ba08 commit 9ee9cdb

File tree

98 files changed

+2836
-3130
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+2836
-3130
lines changed

.clang-format

Lines changed: 0 additions & 15 deletions
This file was deleted.

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"formulahendry.vscode-mysql",
4242
"ms-python.autopep8",
4343
"streetsidesoftware.code-spell-checker",
44-
"jeff-hykin.better-dockerfile-syntax"
44+
"jeff-hykin.better-dockerfile-syntax",
45+
"cschlosser.doxdocgen"
4546
]
4647
}

.github/workflows/build-wheels.yml

Lines changed: 50 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: build-wheels
22

3-
on:
3+
on:
44
workflow_dispatch:
55
inputs:
66
release-testpypi:
@@ -16,131 +16,130 @@ on:
1616

1717
jobs:
1818
build_wheels_pypitest:
19-
name: Build wheels on ${{ matrix.os }}
19+
name: Build test wheels on ${{ matrix.os }}
2020
runs-on: ${{ matrix.os }}
2121
if: ${{ inputs.release-testpypi }}
2222
strategy:
2323
matrix:
24-
os: [ubuntu-20.04, macos-latest]
24+
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
2525

2626
steps:
2727
- uses: actions/checkout@v4
2828

29-
# Used to host cibuildwheel
29+
- name: rename file
30+
run: |
31+
cp setup_pypi_test.py setup.py
32+
3033
- uses: actions/setup-python@v3
3134

32-
- name: set test version
33-
run: |
34-
rm setup.py
35-
ln -s setup_pypi_test.py setup.py
35+
- name: Set up QEMU
36+
if: runner.os == 'Linux'
37+
uses: docker/setup-qemu-action@v3
38+
with:
39+
platforms: all
3640

37-
# - name: Set up QEMU
38-
# if: runner.os == 'Linux'
39-
# uses: docker/setup-qemu-action@v3
40-
# with:
41-
# platforms: all
41+
- name: Release dist
42+
if: runner.os == 'Linux'
43+
run: |
44+
pip install build
45+
python -m build -s --outdir wheelhouse
4246
4347
- name: Install cibuildwheel
44-
run: python -m pip install cibuildwheel==2.16.0
45-
46-
# - name: Build wheels
47-
# uses: pypa/[email protected]
48-
# env:
49-
# # configure cibuildwheel to build native archs ('auto'), and some
50-
# # emulated ones
51-
# CIBW_ARCHS_LINUX: auto aarch64 ppc64le s390x
48+
run: python -m pip install cibuildwheel
5249

5350
- name: Build wheels
5451
run: python -m cibuildwheel --output-dir wheelhouse
55-
# to supply options, put them in 'env', like:
5652
env:
57-
CIBW_ARCHS_MACOS: "x86_64 arm64"
58-
# CIBW_ARCHS_LINUX: "auto aarch64"
53+
CIBW_ARCHS_LINUX: auto aarch64
54+
CIBW_ARCHS_WINDOWS: ARM64 AMD64 x86
55+
CIBW_ARCHS_MACOS: auto x86_64 arm64
5956

6057
- uses: actions/upload-artifact@v3
6158
with:
6259
name: pypi_test
63-
path: ./wheelhouse/*.whl
60+
path: ./wheelhouse/*
6461

6562
publish-pypitest:
6663
needs: build_wheels_pypitest
6764
runs-on: ubuntu-latest
6865
steps:
6966
- uses: actions/download-artifact@v3
70-
with:
67+
with:
7168
name: pypi_test
7269
path: ./wheelhouse/
7370

7471
- name: show all artifact
7572
run: |
7673
ls -R ./wheelhouse/
77-
74+
7875
- name: Publish package to pypitest
7976
uses: pypa/gh-action-pypi-publish@release/v1
8077
with:
8178
user: __token__
8279
password: ${{ secrets.EELIUTEST }}
83-
packages_dir: ./wheelhouse/
84-
repository_url: https://test.pypi.org/legacy/
80+
packages_dir: ./wheelhouse/
81+
repository_url: https://test.pypi.org/legacy/
8582

8683
build_wheels:
8784
name: Build wheels on ${{ matrix.os }}
8885
runs-on: ${{ matrix.os }}
8986
if: ${{ inputs.release }}
9087
strategy:
9188
matrix:
92-
os: [ubuntu-20.04, macos-latest]
89+
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
9390

9491
steps:
9592
- uses: actions/checkout@v4
9693

97-
# Used to host cibuildwheel
94+
- name: rename file
95+
run: |
96+
cp setup_pypi_test.py setup.py
97+
9898
- uses: actions/setup-python@v3
9999

100-
# - name: Set up QEMU
101-
# if: runner.os == 'Linux'
102-
# uses: docker/setup-qemu-action@v3
103-
# with:
104-
# platforms: all
100+
- name: Set up QEMU
101+
if: runner.os == 'Linux'
102+
uses: docker/setup-qemu-action@v3
103+
with:
104+
platforms: all
105105

106-
- name: Install cibuildwheel
107-
run: python -m pip install cibuildwheel==2.16.0
106+
- name: Release dist
107+
if: runner.os == 'Linux'
108+
run: |
109+
pip install build
110+
python -m build -s --outdir wheelhouse
108111
109-
# - name: Build wheels
110-
# uses: pypa/[email protected]
111-
# env:
112-
# # configure cibuildwheel to build native archs ('auto'), and some
113-
# # emulated ones
114-
# CIBW_ARCHS_LINUX: auto aarch64 ppc64le s390x
112+
- name: Install cibuildwheel
113+
run: python -m pip install cibuildwheel
115114

116115
- name: Build wheels
117116
run: python -m cibuildwheel --output-dir wheelhouse
118-
# to supply options, put them in 'env', like:
119117
env:
120-
CIBW_ARCHS_MACOS: "x86_64 arm64"
121-
# CIBW_ARCHS_LINUX: "auto aarch64"
118+
CIBW_ARCHS_LINUX: auto aarch64
119+
CIBW_ARCHS_WINDOWS: ARM64 AMD64 x86
120+
CIBW_ARCHS_MACOS: auto x86_64 arm64
122121

123122
- uses: actions/upload-artifact@v3
124123
with:
125124
name: pypi
126-
path: ./wheelhouse/*.whl
125+
path: ./wheelhouse/*
127126

128127
publish:
129128
needs: build_wheels
130129
runs-on: ubuntu-latest
131130
steps:
132131
- uses: actions/download-artifact@v3
133-
with:
132+
with:
134133
name: pypi
135134
path: ./wheelhouse/
136135

137136
- name: show all artifact
138137
run: |
139138
ls -R ./wheelhouse/
140-
139+
141140
- name: Publish package to pypitest
142141
uses: pypa/gh-action-pypi-publish@release/v1
143142
with:
144143
user: __token__
145144
password: ${{ secrets.PINPOINTPY }}
146-
packages_dir: ./wheelhouse/
145+
packages_dir: ./wheelhouse/

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343

4444
# Initializes the CodeQL tools for scanning.
4545
- name: Initialize CodeQL
46-
uses: github/codeql-action/init@v1
46+
uses: github/codeql-action/init@v2
4747
with:
4848
languages: ${{ matrix.language }}
4949
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -54,7 +54,7 @@ jobs:
5454
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5555
# If this step fails, then you should remove it and run the build manually (see below)
5656
- name: Autobuild
57-
uses: github/codeql-action/autobuild@v1
57+
uses: github/codeql-action/autobuild@v2
5858

5959
# ℹ️ Command-line programs to run using the OS shell.
6060
# 📚 https://git.io/JvXDl
@@ -68,4 +68,4 @@ jobs:
6868
# make release
6969

7070
- name: Perform CodeQL Analysis
71-
uses: github/codeql-action/analyze@v1
71+
uses: github/codeql-action/analyze@v2

.github/workflows/main.yml

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: CI
22

3-
on: [pull_request, workflow_dispatch]
3+
on: [pull_request, workflow_dispatch,push]
44

55
jobs:
66
cpp:
@@ -25,6 +25,26 @@ jobs:
2525
- name: Codecovage
2626
uses: codecov/codecov-action@v1
2727

28+
cpp-windows:
29+
runs-on: [windows-latest]
30+
steps:
31+
- uses: actions/checkout@v2
32+
# - name: actions-setup-cmake
33+
# uses: jwlawson/[email protected]
34+
# with:
35+
# cmake-version: 'latest'
36+
37+
- name: powershell allow...
38+
shell: cmd
39+
run: powershell -Command "Set-ExecutionPolicy RemoteSigned -Scope CurrentUser"
40+
41+
- name: Build agent
42+
run: |
43+
cd common
44+
cmake --no-warn-unused-cli -DWITH_TEST_CASE=1 -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -S. -B./build -G "Visual Studio 17 2022" -T host=x86 -A win32
45+
cmake --build build --target ALL_BUILD --config debug --
46+
./build/bin/Debug/TestCommon.exe
47+
2848
memory-leak:
2949
runs-on: ubuntu-latest
3050
steps:
@@ -74,7 +94,7 @@ jobs:
7494
strategy:
7595
matrix:
7696
# php-versions: ["7.0", "7.1", "7.2", "7.3", "7.4", "8.0"]
77-
php-versions: ["7.4","8.0"]
97+
php-versions: ["7.4", "8.0"]
7898
steps:
7999
- uses: actions/checkout@v2
80100
- uses: shivammathur/setup-php@v2
@@ -95,12 +115,12 @@ jobs:
95115
# composer install
96116
# cp tests/think .
97117
# php think unit -v
98-
118+
99119
Python:
100120
strategy:
101121
matrix:
102122
os: [ubuntu-latest, macos-latest]
103-
python-version: ["3.8","3.9","3.10","3.11"]
123+
python-version: ["3.8", "3.9", "3.10", "3.11"]
104124
runs-on: ${{ matrix.os }}
105125
steps:
106126
- uses: actions/checkout@v2
@@ -119,14 +139,14 @@ jobs:
119139
steps:
120140
- uses: actions/checkout@v2
121141
with:
122-
submodules: 'true'
142+
submodules: "true"
123143
- name: update docker compose
124144
run: |
125145
wget "https://github.com/docker/compose/releases/latest/download/docker-compose-linux-x86_64"
126146
chmod +x docker-compose-linux-x86_64
127147
./docker-compose-linux-x86_64 version
128-
# - name: build python-plugins
129148
# run: docker-compose -f "testapps/compose.yaml" build python-plugins
149+
# - name: build python-plugins
130150
- name: start test environment
131151
run: ./docker-compose-linux-x86_64 -f "testapps/compose.yaml" up python-plugins --exit-code-from python-plugins
132152
- name: Stop containers
@@ -146,13 +166,13 @@ jobs:
146166
- name: Checkout code
147167
uses: actions/checkout@v2
148168
with:
149-
submodules: 'true'
169+
submodules: "true"
150170

151171
- name: Setup protoc
152172
uses: arduino/[email protected]
153-
173+
154174
- run: |
155175
go install google.golang.org/protobuf/cmd/[email protected]
156176
go install google.golang.org/grpc/cmd/[email protected]
157177
export PATH="$PATH:$(go env GOPATH)/bin"
158-
cd collector-agent && make && go test ./... -v
178+
cd collector-agent && make && go test ./... -v

.github/workflows/publish-build-env.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: publish-build-env
22

33
on:
44
release:
5-
types: [workflow_dispatch]
65
workflow_dispatch:
76

87

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ compile_commands.json
7373
testapps/PHP/composer-setup.php
7474
testapps/PHP/composer.phar
7575
wheelhouse/
76-
.clangd
7776
collector-agent/pinpoint-grpc-idl/
7877
*.so
78+
.clangd
79+
.vs

0 commit comments

Comments
 (0)