-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GitHub Actions CI workflow for CMake build #5197
base: RC_1_2
Are you sure you want to change the base?
Add GitHub Actions CI workflow for CMake build #5197
Conversation
I think it's good to build both. (unless it takes too long)
Does github provide storage for artifacts? I think the thing most people would like to have uploaded would be the python module. The other build artifacts may be a bit risky as they may not be ABI compatible with the environment of someone pulling them down. |
The build jobs run in parallel, so the total workflow time is that of the slowest job.
Yes, default retention is 90 days, according to
The artifacts generated as part of this workflow are not really for general use - my main intention was to provide them only for quick inspection purposes. Though in fairness, nothing stops someone from trying to actually use the artifacts produced by these builds. I think if you want to make some artifacts actually downloadable for some kind of production use (or even "official" prereleases), you're better off defining a workflow specifically for that purpose, possibly publishing the artifacts as actual releases. With this in mind, besides the python module, which other files would you want published in these artifacts? Or are you OK with simply the whole build folder? Since the storage is free, I'd say the only disadvantages of publishing the whole build folder are a) download times for slower connections and b) giving some people the potentially wrong idea that the executables/libraries are meant for general use. I noticed a small bug, artifacts were not being named differently based on them being built with/without deprecated functions, so there was a race condition with the uploads being overwritten. That's why https://github.com/FranciscoPombal/libtorrent/actions/runs/287100024 shows only 2 artifacts instead of 4. Will force-push to fix that shortly. |
288cb86
to
ea4f091
Compare
In a way I would be a bit cautious to upload artifacts without a good use case. "Nightly" builds may be a good one, with debug symbols. enum_if and client_test might be good binaries to have recent builds of. For them to be easy to use, though, it would have to link statically against libtorrent and boost. |
how come the github actions aren't being executed as part of this PR? is it because it's a draft? |
They will only run after this PR is merged in this repo. It will still run for draft PRs. |
ea4f091
to
1df6642
Compare
@arvidn Ok, I made some progress with the python bindings (only Python 3, at least for now), but I'm running into some issues. These tests are being done in an identical branch, but configured to trigger builds when it is pushed, not RC_1_2. I can reproduce these results locally also: https://github.com/FranciscoPombal/libtorrent/runs/1216222401?check_suite_focus=true As you can see, in the first run, the Then, in the second run, one build fails due to lack of space (we can ignore it for now). All the others that fail do so at the linking step. The libraries appear to all be successfully found, but the linking fails with unresolved symbols for boost-python. Please advise. In particular, should I extract the |
I seem to recall that conflicting python versions can cause this, as the python API differs between 2 and 3.
That probably makes sense. the |
I doubt 2 vs 3 is the issue, according to the CMake configure output, only 3 seems to be used. However, something funky might be happening due to the usage of
Ok, will do - I see it is already added to the main library as well anyway: Line 607 in 89b67d3
|
I don't think it's worth the effort to build and test against python2. |
the file |
73bd8bd
to
26ec835
Compare
Done (renamed to Alright, with the help of some exclusions, I have managed to get it working in the latest force-push. Here are examples of an uncached run, and a cached run, respectively: https://github.com/FranciscoPombal/libtorrent/actions/runs/316048316 About the 4 matrix exclusions (see the comments near them), there's 1 that can be lifted...
I can fix this one with the following patch: diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt
index d5cc9e51f..a6a55d6ff 100644
--- a/bindings/python/CMakeLists.txt
+++ b/bindings/python/CMakeLists.txt
@@ -41,7 +41,13 @@ set(boost-python-module-name "python${Python3_VERSION_MAJOR}${Python3_VERSION_MI
find_package(Boost REQUIRED COMPONENTS ${boost-python-module-name})
-Python3_add_library(python-libtorrent MODULE WITH_SOABI
+if (BUILD_SHARED_LIBS)
+ Python3_add_library(python-libtorrent MODULE WITH_SOABI
+else()
+ Python3_add_library(python-libtorrent STATIC
+endif()
+
+target_sources(python-libtorrent PRIVATE
src/module.cpp
src/sha1_hash.cpp
src/converters.cpp But does it ever make sense to build the python library statically? I legitimately don't know. If not, I won't apply this patch, and leave the exclusion be. ... and 2 would ideally be lifted, but it is not possible at this time:
Besides the one change/patch mentioned, the only thing remaining is to adjust the files that get uploaded as artifacts at the end of the build, as mentioned in #5197 (comment). I'll do that last, after this small matter is solved, so I'm awaiting your response. EDIT: |
26ec835
to
2e51e2c
Compare
@arvidn ping, can I get some feedback on my previous comment (#5197 (comment)), please? |
I can't imagine it ever making sense to build the python module (which is what I assume you're referring to) as a static library. since the whole point is to have |
I would think it would make sense to just remove the |
Roger that.
I use it all the time for qBittorrent builds, for example. However, we could just have two static builds, So what do you say? |
oh, right. the main library needs to be buildable as static library. I think it's pretty safe to assume that a static library works if a shared library does though. Most of the issues related to this are to missing |
2e51e2c
to
287a13c
Compare
Alright, this is now ready from my side. I cleaned up the warning annotations about the deprecated Actions function by updating the actions, and slimmed the uploaded artifacts significantly according to the suggestion in #5197 (comment). Here is an example test run of the final result: https://github.com/FranciscoPombal/libtorrent/actions/runs/329760926. By the way, here is the patch to get it working for diff --git a/.github/workflows/windows_cmake.yml b/.github/workflows/windows_cmake.yml
index 594a524d0..d60270517 100644
--- a/.github/workflows/windows_cmake.yml
+++ b/.github/workflows/windows_cmake.yml
@@ -2,10 +2,10 @@ name: Windows CMake build
on:
push:
- branches: [ RC_1_2 ]
+ branches: [ RC_2_0 ]
pull_request:
types: [edited, opened, reopened, synchronize]
- branches: [ RC_1_2 ]
+ branches: [ RC_2_0 ]
env:
# openssl: 1.1.1g#1
@@ -59,6 +59,8 @@ jobs:
steps:
- name: checkout repository
uses: actions/checkout@v2.3.3
+ with:
+ submodules: recursive
- name: setup environment - static build
if: matrix.build_variant == 'static'
@@ -114,6 +116,8 @@ jobs:
boost-crc:${{ env.VCPKG_TRIPLET }} `
boost-date-time:${{ env.VCPKG_TRIPLET }} `
boost-iterator:${{ env.VCPKG_TRIPLET }} `
+ boost-logic:${{ env.VCPKG_TRIPLET }} `
+ boost-multi-index:${{ env.VCPKG_TRIPLET }} `
boost-multiprecision:${{ env.VCPKG_TRIPLET }} `
boost-pool:${{ env.VCPKG_TRIPLET }} `
boost-python:${{ env.VCPKG_TRIPLET }} `
@@ -147,7 +151,7 @@ jobs:
- name: upload artifact as zip
uses: actions/upload-artifact@v2.2.0
with:
- name: libtorrent_RC_1_2-CI-Windows_x64-${{ matrix.build_variant }}-${{ matrix.build_config }}-${{ matrix.deprecated_functions }}-${{ matri 71 x.build_tests }}-${{ matrix.python_bindings }}
+ name: libtorrent_RC_2_0-CI-Windows_x64-${{ matrix.build_variant }}-${{ matrix.build_config }}-${{ matrix.deprecated_functions }}-${{ matri 72 x.build_tests }}-${{ matrix.python_bindings }}
path: |
cmake-build-dir/compile_commands.json
cmake-build-dir/target_graph.dot* |
if you rebase on top of |
a7d414e
to
cfc5343
Compare
cfc5343
to
59e0f53
Compare
I think it's fine to disable more tests as well, for now. Or are all the tests passing now? |
Not looking great still: https://github.com/FranciscoPombal/libtorrent/actions/runs/339660523. I should be able to figure something out tonight. |
I see. the tests linking dynamically appear to not find the DLL (so maybe those tests could be disabled). |
with python version being yet another dimension in this test matrix, I think it makes even more sense to remove I still think |
https://github.com/FranciscoPombal/libtorrent/actions/runs/342650928 Looks like all tests are passing now, except for Perhaps there is some bug? The logs are there if you need to check... (failure example: https://github.com/FranciscoPombal/libtorrent/runs/1344968233?check_suite_focus=true) I added two python versions to the test - the oldest supported and the newest available, which I think is reasonable. I'll start trimming down the matrix. |
there are still failing tests, right? My impression is it's not ready to merge right now. |
Partly addresses #5189 (and fully addresses #5189 (comment)).
See it in action here: https://github.com/FranciscoPombal/libtorrent/actions/runs/287100024.
@arvidn
The python bindings as well as a sister PR targeting RC_2_0 will be coming in a future commit shortly. For now I would especially appreciate comments concerning the following points:
compile_commands.json
andtarget_graph*
), or perhaps all of the generated tools/examples executables, or something else?