Skip to content
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

Added workaround for deprecation of macos-12 runner #8203

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
build:
strategy:
matrix:
os: [macos-12, ubuntu-latest, windows-latest]
os: [ubuntu-latest, windows-latest] # macos-12 is no longer on GitHub Actions, we use the Mac mini for this

runs-on: ${{ matrix.os }}

Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
cd src
python run_unit_tests.py -a
macos:
runs-on: macos-12
runs-on: macos-14
timeout-minutes: 2
steps:
- uses: actions/checkout@v4
Expand All @@ -47,9 +47,12 @@ jobs:
with:
python-version: '3.9'
cache: 'pip'
- shell: bash
run: |
cp /opt/homebrew/opt/libsodium/lib/libsodium.dylib /Library/Frameworks/Python.framework/Versions/3.9/lib/libsodium.dylib
sed -i".backup" 's|libtorrent==1.2.19|https://tribler.org/libtorrent-2.0.11-cp39-cp39-macosx_14_0_arm64.whl|' requirements.txt
- run: python -m pip install -r requirements.txt
- name: Run unit tests
run: |
cd src
python run_unit_tests.py -a

3 changes: 2 additions & 1 deletion src/tribler/core/libtorrent/torrents.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ def create_torrent_file(file_path_list: list[Path], params: InfoDict, # noqa: C
fs.add_file(str(relative), getsize(str(path)))

piece_size = params[b"piece length"] if params.get(b"piece length") else 0
flags = lt.create_torrent_flags_t.optimize
flag_v1_only = 2**6 # Backward compatibility for libtorrent < 2.x
flags = lt.create_torrent_flags_t.optimize | flag_v1_only
params = {k: (v.decode() if isinstance(v, bytes) else v) for k, v in params.items()}

torrent = lt.create_torrent(fs, piece_size=piece_size, flags=flags)
Expand Down