From 8332b811b787e4ae779bd3cf96f4e1522456d6e2 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Thu, 31 Jul 2025 15:59:08 -0700 Subject: [PATCH 01/15] extract correct GLIBC version --- .github/workflows/prerelease.yml | 17 +++++++++++++++-- BUILD | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 9c45cb4..02279da 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -4,6 +4,7 @@ on: push: branches: - main + pull: permissions: contents: read @@ -32,8 +33,16 @@ jobs: strategy: fail-fast: true matrix: - os: [ubuntu-24.04, macos-13, macos-14] python-version: ['3.10', '3.11', '3.12'] + include: + - os: ubuntu-20.04 + EXTRACT_GLIBC_VERSION: "yes" + - os: ubuntu-24.04 + EXTRACT_GLIBC_VERSION: "yes" + - os: macos-13 + EXTRACT_GLIBC_VERSION: "no" + - os: macos-14 + EXTRACT_GLIBC_VERSION: "no" steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Set up Python @@ -63,8 +72,12 @@ jobs: - name: Build package env: TARGET_PYTHON: ${{ matrix.python-version }} + EXTRACT_GLIBC_VERSION: ${{ matrix.EXTRACT_GLIBC_VERSION }} run: | - bazel build --define TARGET_VERSION="$(python -c "print(\"py${TARGET_PYTHON}\".replace(\".\", \"\"))")" --define VERSION="$(cat version/version.txt)" :tesseract_decoder_wheel + GLIBC_VERSION='' + if [[ "$EXTRACT_GLIBC_VERSION"=='x' ]]; then s=$(ldd --version | awk '/ldd/{print $NF}'); GLIBC_VERSION=${s//./_}" fi + echo $GLIBC_VERSION + bazel build --define GLIBC_VERSION="$GLIBC_VERSION" --define TARGET_VERSION="$(python -c "print(\"py${TARGET_PYTHON}\".replace(\".\", \"\"))")" --define VERSION="$(cat version/version.txt)" :tesseract_decoder_wheel - uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4 with: diff --git a/BUILD b/BUILD index e70fec5..f355aa8 100644 --- a/BUILD +++ b/BUILD @@ -29,7 +29,7 @@ py_wheel( ":macos_arm": "macosx_11_0_arm64", ":macos_x86": "macosx_10_13_x86_64", "@platforms//os:windows": "win32", - "@platforms//os:linux": "manylinux_2_17_x86_64.manylinux2014_x86_64", + "@platforms//os:linux": "manylinux_$(GLIBC_VERSION)_x86_64.manylinux2014_x86_64", }), strip_path_prefixes = ["src"], description_file=":package_description", From 8f1e996939485e00a6603fa17d11b51edea75a56 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Thu, 31 Jul 2025 16:00:39 -0700 Subject: [PATCH 02/15] add test trigger --- .github/workflows/prerelease.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 02279da..cf06e5f 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -4,7 +4,9 @@ on: push: branches: - main - pull: + pull_request: + branches: + - main permissions: contents: read From ebb185a6e9101697739784830ead0e6b8e59c542 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Thu, 31 Jul 2025 16:08:52 -0700 Subject: [PATCH 03/15] nit --- .github/workflows/prerelease.yml | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index cf06e5f..3400674 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -30,21 +30,18 @@ jobs: path: version build_wheels: - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.os_dist.os }} needs: [create_version] strategy: fail-fast: true matrix: python-version: ['3.10', '3.11', '3.12'] - include: - - os: ubuntu-20.04 - EXTRACT_GLIBC_VERSION: "yes" - - os: ubuntu-24.04 - EXTRACT_GLIBC_VERSION: "yes" - - os: macos-13 - EXTRACT_GLIBC_VERSION: "no" - - os: macos-14 - EXTRACT_GLIBC_VERSION: "no" + os_dist: [ + {os: ubuntu-20.04, EXTRACT_GLIBC_VERSION: "yes"}, + {os: ubuntu-24.04, EXTRACT_GLIBC_VERSION: "yes"}, + {os: macos-13, EXTRACT_GLIBC_VERSION: "no"}, + {os: macos-14, EXTRACT_GLIBC_VERSION: "no"}, + ] steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Set up Python @@ -74,16 +71,16 @@ jobs: - name: Build package env: TARGET_PYTHON: ${{ matrix.python-version }} - EXTRACT_GLIBC_VERSION: ${{ matrix.EXTRACT_GLIBC_VERSION }} + EXTRACT_GLIBC_VERSION: ${{ matrix.os_dist.EXTRACT_GLIBC_VERSION }} run: | - GLIBC_VERSION='' - if [[ "$EXTRACT_GLIBC_VERSION"=='x' ]]; then s=$(ldd --version | awk '/ldd/{print $NF}'); GLIBC_VERSION=${s//./_}" fi + export GLIBC_VERSION='' + if [[ "$EXTRACT_GLIBC_VERSION"=='x' ]]; then s=$(ldd --version | awk '/ldd/{print $NF}'); export GLIBC_VERSION="${s//./_}"; fi echo $GLIBC_VERSION bazel build --define GLIBC_VERSION="$GLIBC_VERSION" --define TARGET_VERSION="$(python -c "print(\"py${TARGET_PYTHON}\".replace(\".\", \"\"))")" --define VERSION="$(cat version/version.txt)" :tesseract_decoder_wheel - uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4 with: - name: python-wheels-${{ matrix.os }}-${{ matrix.python-version }} + name: python-wheels-${{ matrix.os_dist.os }}-${{ matrix.python-version }} path: ./bazel-bin/*.whl release-wheels: From 2d6002635ad595fd561390bacf60b58043822050 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Thu, 31 Jul 2025 16:15:37 -0700 Subject: [PATCH 04/15] change os --- .github/workflows/prerelease.yml | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 3400674..5e31e45 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -4,9 +4,6 @@ on: push: branches: - main - pull_request: - branches: - - main permissions: contents: read @@ -30,18 +27,13 @@ jobs: path: version build_wheels: - runs-on: ${{ matrix.os_dist.os }} + runs-on: ${{ matrix.os }} needs: [create_version] strategy: fail-fast: true matrix: + os: [ubuntu-22.04, ubuntu-24.04, macos-13, macos-14] python-version: ['3.10', '3.11', '3.12'] - os_dist: [ - {os: ubuntu-20.04, EXTRACT_GLIBC_VERSION: "yes"}, - {os: ubuntu-24.04, EXTRACT_GLIBC_VERSION: "yes"}, - {os: macos-13, EXTRACT_GLIBC_VERSION: "no"}, - {os: macos-14, EXTRACT_GLIBC_VERSION: "no"}, - ] steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Set up Python @@ -71,16 +63,16 @@ jobs: - name: Build package env: TARGET_PYTHON: ${{ matrix.python-version }} - EXTRACT_GLIBC_VERSION: ${{ matrix.os_dist.EXTRACT_GLIBC_VERSION }} run: | - export GLIBC_VERSION='' - if [[ "$EXTRACT_GLIBC_VERSION"=='x' ]]; then s=$(ldd --version | awk '/ldd/{print $NF}'); export GLIBC_VERSION="${s//./_}"; fi + ldd --version + glibc_version=$(ldd --version | awk '/ldd/{print $NF}') + export GLIBC_VERSION="${glibc_version//./_}" echo $GLIBC_VERSION bazel build --define GLIBC_VERSION="$GLIBC_VERSION" --define TARGET_VERSION="$(python -c "print(\"py${TARGET_PYTHON}\".replace(\".\", \"\"))")" --define VERSION="$(cat version/version.txt)" :tesseract_decoder_wheel - uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4 with: - name: python-wheels-${{ matrix.os_dist.os }}-${{ matrix.python-version }} + name: python-wheels-${{ matrix.os }}-${{ matrix.python-version }} path: ./bazel-bin/*.whl release-wheels: From 7997700550b6e07b1d8a7f7be5fc4ef5692f677b Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Thu, 31 Jul 2025 16:16:35 -0700 Subject: [PATCH 05/15] trigger build --- .github/workflows/prerelease.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 5e31e45..b320684 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -4,6 +4,9 @@ on: push: branches: - main + pull_request: + branches: + - main permissions: contents: read From 717ecb989e5d5086c8a7c6545bdb783f315d535f Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Thu, 31 Jul 2025 16:18:36 -0700 Subject: [PATCH 06/15] nit --- .github/workflows/prerelease.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index b320684..143d169 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -34,8 +34,8 @@ jobs: needs: [create_version] strategy: fail-fast: true - matrix: - os: [ubuntu-22.04, ubuntu-24.04, macos-13, macos-14] + matrix: # ubuntu-22.04, + os: [ubuntu-24.04, macos-13, macos-14] python-version: ['3.10', '3.11', '3.12'] steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 From f094c06ac21daf35dffc734998db07feb445b1da Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Thu, 31 Jul 2025 16:19:52 -0700 Subject: [PATCH 07/15] nit --- .github/workflows/prerelease.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 143d169..c4e6eec 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -34,8 +34,8 @@ jobs: needs: [create_version] strategy: fail-fast: true - matrix: # ubuntu-22.04, - os: [ubuntu-24.04, macos-13, macos-14] + matrix: + os: [ubuntu-22.04, ubuntu-24.04, macos-13, macos-14] python-version: ['3.10', '3.11', '3.12'] steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 @@ -67,7 +67,7 @@ jobs: env: TARGET_PYTHON: ${{ matrix.python-version }} run: | - ldd --version + ldd --version || 0 glibc_version=$(ldd --version | awk '/ldd/{print $NF}') export GLIBC_VERSION="${glibc_version//./_}" echo $GLIBC_VERSION From 6ef5281fcc977db3b83cb3adf38a1dc61c786cc6 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Thu, 31 Jul 2025 16:23:01 -0700 Subject: [PATCH 08/15] nit --- .github/workflows/prerelease.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index c4e6eec..e291b12 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -67,7 +67,7 @@ jobs: env: TARGET_PYTHON: ${{ matrix.python-version }} run: | - ldd --version || 0 + ldd --version || true glibc_version=$(ldd --version | awk '/ldd/{print $NF}') export GLIBC_VERSION="${glibc_version//./_}" echo $GLIBC_VERSION From c5252f4c658fdeead01c03796c354787e8269d0d Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Thu, 31 Jul 2025 16:28:04 -0700 Subject: [PATCH 09/15] update stable workflow --- .github/workflows/prerelease.yml | 4 ---- .github/workflows/stable-release-workflow.yml | 7 +++++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index e291b12..cc38ca5 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -4,9 +4,6 @@ on: push: branches: - main - pull_request: - branches: - - main permissions: contents: read @@ -67,7 +64,6 @@ jobs: env: TARGET_PYTHON: ${{ matrix.python-version }} run: | - ldd --version || true glibc_version=$(ldd --version | awk '/ldd/{print $NF}') export GLIBC_VERSION="${glibc_version//./_}" echo $GLIBC_VERSION diff --git a/.github/workflows/stable-release-workflow.yml b/.github/workflows/stable-release-workflow.yml index 456a6ca..8e94344 100644 --- a/.github/workflows/stable-release-workflow.yml +++ b/.github/workflows/stable-release-workflow.yml @@ -31,7 +31,7 @@ jobs: strategy: fail-fast: true matrix: - os: [ubuntu-24.04, macos-13, macos-14] + os: [ubuntu-22.04, ubuntu-24.04, macos-13, macos-14] python-version: ['3.10', '3.11', '3.12'] steps: @@ -64,7 +64,10 @@ jobs: env: TARGET_PYTHON: ${{ matrix.python-version }} run: | - bazel build --define TARGET_VERSION="$(python -c "print(\"py${TARGET_PYTHON}\".replace(\".\", \"\"))")" --define VERSION="$(cat version/version.txt)" :tesseract_decoder_wheel + glibc_version=$(ldd --version | awk '/ldd/{print $NF}') + export GLIBC_VERSION="${glibc_version//./_}" + echo $GLIBC_VERSION + bazel build --define GLIBC_VERSION="$GLIBC_VERSION" --define TARGET_VERSION="$(python -c "print(\"py${TARGET_PYTHON}\".replace(\".\", \"\"))")" --define VERSION="$(cat version/version.txt)" :tesseract_decoder_wheel - uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4 with: From 38ac3656ea0a2d2466937a2fd2821b8a0f369d37 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Thu, 31 Jul 2025 16:32:27 -0700 Subject: [PATCH 10/15] add trigger --- .github/workflows/stable-release-workflow.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/stable-release-workflow.yml b/.github/workflows/stable-release-workflow.yml index 8e94344..79c2303 100644 --- a/.github/workflows/stable-release-workflow.yml +++ b/.github/workflows/stable-release-workflow.yml @@ -3,7 +3,9 @@ name: Stable-release Tesseract on: release: types: [published] - + pull_request: + branches: + - main permissions: contents: read From 3c2ad6c4c9072eb80de564d0fd0f66efbbf26d62 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Thu, 31 Jul 2025 16:35:22 -0700 Subject: [PATCH 11/15] nit --- .github/workflows/prerelease.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index cc38ca5..99ffc6d 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -67,7 +67,7 @@ jobs: glibc_version=$(ldd --version | awk '/ldd/{print $NF}') export GLIBC_VERSION="${glibc_version//./_}" echo $GLIBC_VERSION - bazel build --define GLIBC_VERSION="$GLIBC_VERSION" --define TARGET_VERSION="$(python -c "print(\"py${TARGET_PYTHON}\".replace(\".\", \"\"))")" --define VERSION="$(cat version/version.txt)" :tesseract_decoder_wheel + bazel build --define GLIBC_VERSION=$GLIBC_VERSION --define TARGET_VERSION="$(python -c "print(\"py${TARGET_PYTHON}\".replace(\".\", \"\"))")" --define VERSION="$(cat version/version.txt)" :tesseract_decoder_wheel - uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4 with: From 9182994479b80753a6489aac96b6c66ab628c584 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Thu, 31 Jul 2025 16:36:22 -0700 Subject: [PATCH 12/15] nit --- .github/workflows/prerelease.yml | 3 +++ .github/workflows/stable-release-workflow.yml | 6 ++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 99ffc6d..35f6594 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -4,6 +4,9 @@ on: push: branches: - main + pull_request: + branches: + - main permissions: contents: read diff --git a/.github/workflows/stable-release-workflow.yml b/.github/workflows/stable-release-workflow.yml index 79c2303..de55e04 100644 --- a/.github/workflows/stable-release-workflow.yml +++ b/.github/workflows/stable-release-workflow.yml @@ -3,9 +3,7 @@ name: Stable-release Tesseract on: release: types: [published] - pull_request: - branches: - - main + permissions: contents: read @@ -69,7 +67,7 @@ jobs: glibc_version=$(ldd --version | awk '/ldd/{print $NF}') export GLIBC_VERSION="${glibc_version//./_}" echo $GLIBC_VERSION - bazel build --define GLIBC_VERSION="$GLIBC_VERSION" --define TARGET_VERSION="$(python -c "print(\"py${TARGET_PYTHON}\".replace(\".\", \"\"))")" --define VERSION="$(cat version/version.txt)" :tesseract_decoder_wheel + bazel build --define GLIBC_VERSION=$GLIBC_VERSION --define TARGET_VERSION="$(python -c "print(\"py${TARGET_PYTHON}\".replace(\".\", \"\"))")" --define VERSION="$(cat version/version.txt)" :tesseract_decoder_wheel - uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4 with: From e161e27007b6d94f585f52dee5679aac8e948bc0 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Thu, 31 Jul 2025 16:55:16 -0700 Subject: [PATCH 13/15] nit --- BUILD | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/BUILD b/BUILD index f355aa8..384a92f 100644 --- a/BUILD +++ b/BUILD @@ -13,6 +13,8 @@ filegroup( visibility = ["//visibility:public"], ) +MANYLINUX_VERSION="manylinux_2_17_x86_64.manylinux2014_x86_64" + py_wheel( name="tesseract_decoder_wheel", distribution = "tesseract_decoder", @@ -29,7 +31,7 @@ py_wheel( ":macos_arm": "macosx_11_0_arm64", ":macos_x86": "macosx_10_13_x86_64", "@platforms//os:windows": "win32", - "@platforms//os:linux": "manylinux_$(GLIBC_VERSION)_x86_64.manylinux2014_x86_64", + "@platforms//os:linux": MANYLINUX_VERSION, }), strip_path_prefixes = ["src"], description_file=":package_description", From 894514a8d090cd9aea99fd47d92fb8c47188114e Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Thu, 31 Jul 2025 17:03:22 -0700 Subject: [PATCH 14/15] change version replacement --- .github/workflows/prerelease.yml | 1 + .github/workflows/stable-release-workflow.yml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 35f6594..325393c 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -70,6 +70,7 @@ jobs: glibc_version=$(ldd --version | awk '/ldd/{print $NF}') export GLIBC_VERSION="${glibc_version//./_}" echo $GLIBC_VERSION + sed "s/^MANYLINUX_VERSION.*/MANYLINUX_VERSION=\"manylinux_${GLIBC_VERSION}_x86_64.manylinux2014_x86_64\"/" BUILD -i || true bazel build --define GLIBC_VERSION=$GLIBC_VERSION --define TARGET_VERSION="$(python -c "print(\"py${TARGET_PYTHON}\".replace(\".\", \"\"))")" --define VERSION="$(cat version/version.txt)" :tesseract_decoder_wheel - uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4 diff --git a/.github/workflows/stable-release-workflow.yml b/.github/workflows/stable-release-workflow.yml index de55e04..a6384a3 100644 --- a/.github/workflows/stable-release-workflow.yml +++ b/.github/workflows/stable-release-workflow.yml @@ -67,7 +67,8 @@ jobs: glibc_version=$(ldd --version | awk '/ldd/{print $NF}') export GLIBC_VERSION="${glibc_version//./_}" echo $GLIBC_VERSION - bazel build --define GLIBC_VERSION=$GLIBC_VERSION --define TARGET_VERSION="$(python -c "print(\"py${TARGET_PYTHON}\".replace(\".\", \"\"))")" --define VERSION="$(cat version/version.txt)" :tesseract_decoder_wheel + sed "s/^MANYLINUX_VERSION.*/MANYLINUX_VERSION=\"manylinux_${GLIBC_VERSION}_x86_64.manylinux2014_x86_64\"/" BUILD -i || true + bazel build --define TARGET_VERSION="$(python -c "print(\"py${TARGET_PYTHON}\".replace(\".\", \"\"))")" --define VERSION="$(cat version/version.txt)" :tesseract_decoder_wheel - uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4 with: From eacf69c71ad97f98385327c9f4775595c79cd288 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Thu, 31 Jul 2025 17:10:01 -0700 Subject: [PATCH 15/15] remove trigger --- .github/workflows/prerelease.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 325393c..65eae50 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -4,9 +4,6 @@ on: push: branches: - main - pull_request: - branches: - - main permissions: contents: read