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

build: pin manylinux image tag to fix segfault #534 #560

Merged
merged 4 commits into from
Dec 1, 2023
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
4 changes: 2 additions & 2 deletions .github/workflows/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
# Build test packages
- name: Test build briefcase package
shell: bash -l {0}
run: hatch run python bundle/build.py --framework=briefcase --dev
run: hatch run bundle --dev
- name: Print briefcase log in case of error
if: failure()
shell: bash -l {0}
Expand Down Expand Up @@ -176,7 +176,7 @@ jobs:
python-version: "3.10"
- name: Build package briefcase
shell: bash -l {0}
run: hatch run python bundle/build.py --framework=briefcase
run: hatch run bundle
- name: Draft release
if: github.repository == 'dynobo/normcap'
uses: ncipollo/release-action@v1
Expand Down
3 changes: 3 additions & 0 deletions bundle/platforms/macos_briefcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import shutil
from pathlib import Path

from retry import retry

from platforms.utils import BuilderBase


Expand Down Expand Up @@ -82,6 +84,7 @@ def bundle_tesseract(self) -> None:
)
shutil.copy(tesseract_source, tesseract_target)

@retry(tries=5, delay=1, backoff=2)
def install_system_deps(self) -> None:
self.run(cmd="brew install tesseract")
self.run(cmd="brew install dylibbundler")
Expand Down
9 changes: 7 additions & 2 deletions bundle/platforms/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
import toml
from retry import retry

# TODO: Add retries to all downloads


class BuilderBase(ABC):
"""Create a prebuilt package."""
Expand Down Expand Up @@ -72,8 +70,15 @@ def compile_locales(self) -> None:
cwd=self.PROJECT_PATH,
)

def clean(self) -> None:
build_dir = self.PROJECT_PATH / "build"
if build_dir.exists():
print(f"Removing old build directory {build_dir.resolve()}") # noqa: T201
shutil.rmtree(build_dir, ignore_errors=True)

def create(self) -> None:
"""Run all steps to build prebuilt packages."""
self.clean()
self.download_tessdata()
self.install_system_deps()
self.compile_locales()
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ locales-compile = "python bundle/l10n.py"
locales-update = "python bundle/l10n.py --update-all"
create-locale = "python bundle/l10n.py --create-new"
version = "tbump {args:current-version}"
bundle = ["locales-compile", "python bundle/build.py --framework=briefcase {args}"]

[[tool.hatch.envs.all.matrix]]
python = ["3.9", "3.10", "3.11"]
Expand Down Expand Up @@ -276,6 +277,7 @@ requires = ["std-nslog==1.0.0"]
template = "https://github.com/beeware/briefcase-linux-appimage-template"
template_branch = "v0.3.16"
manylinux = "manylinux_2_28"
manylinux_image_tag="2023-09-16-066b049"
system_requires = [
"wget",
"tesseract",
Expand Down