Skip to content

Commit

Permalink
Merge pull request #817 from serokell/krendelhoff/chore-fix-fedora-40
Browse files Browse the repository at this point in the history
[Chore] Fix fedora 40 builds
  • Loading branch information
krendelhoff2 authored Jul 19, 2024
2 parents c550db3 + b339824 commit 86bdd6f
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 21 deletions.
1 change: 1 addition & 0 deletions docker/package/Dockerfile-fedora
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ RUN python3 fetch_tezos_sources.py
WORKDIR /tezos-packaging/docker
COPY meta.json /tezos-packaging/meta.json
COPY protocols.json /tezos-packaging/protocols.json
COPY docker/supported_versions.json /tezos-packaging/docker/supported_versions.json
COPY docker/package/*.py /tezos-packaging/docker/package/
COPY docker/package/defaults /tezos-packaging/docker/package/defaults
COPY docker/package/scripts /tezos-packaging/docker/package/scripts
Expand Down
1 change: 1 addition & 0 deletions docker/package/Dockerfile-ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ RUN python3 fetch_tezos_sources.py
WORKDIR /tezos-packaging/docker
COPY meta.json /tezos-packaging/meta.json
COPY protocols.json /tezos-packaging/protocols.json
COPY docker/supported_versions.json /tezos-packaging/docker/supported_versions.json
COPY docker/package/*.py /tezos-packaging/docker/package/
COPY docker/package/defaults /tezos-packaging/docker/package/defaults
COPY docker/package/scripts /tezos-packaging/docker/package/scripts
Expand Down
48 changes: 29 additions & 19 deletions docker/package/package_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import os
import sys
import json
import shutil
import argparse
import urllib.request
Expand Down Expand Up @@ -218,25 +219,34 @@ def build_ubuntu(args):
"tezos-rc" if "rc" in version or "beta" in version else "tezos"
)
name = package.name.lower()
# distributions list is always unempty at this point
# and sources archive is the same for all distributions
dist = distributions[0]
url = f"https://launchpad.net/~serokell/+archive/ubuntu/{repo}/+sourcefiles/{name}/2:{version}-0ubuntu1~{dist}/{name}_{version}.orig.tar.gz"
source_archive = f"{name}_{package.meta.version}.orig.tar.gz"
try:
urllib.request.urlretrieve(
url,
source_archive,
lambda count, block_size, total_size: print(
f"{package.name} source is downloading: "
+ str(round(count * block_size / total_size * 100, 2))
+ "%",
end="\r",
),
)
print(f"{package.name} source was downloaded successfully")
package.source_archive = os.path.realpath(source_archive)
except (urllib.error.URLError, ValueError):

with open("supported_versions.json", "r") as f:
distributions = json.loads(f.read())["ubuntu"]

success = False
for dist in distributions:
source_archive = f"{name}_{package.meta.version}.orig.tar.gz"
url = f"https://launchpad.net/~serokell/+archive/ubuntu/{repo}/+sourcefiles/{name}/2:{version}-0ubuntu1~{dist}/{name}_{version}.orig.tar.gz"
try:
urllib.request.urlretrieve(
url,
source_archive,
lambda count, block_size, total_size: print(
f"{package.name} source is downloading: "
+ str(
round(count * block_size / total_size * 100, 2)
)
+ "%",
end="\r",
),
)
print(f"{package.name} source was downloaded successfully")
package.source_archive = os.path.realpath(source_archive)
success = True
break
except (urllib.error.URLError, ValueError):
continue
if not success:
errors.append(
f"ERROR: source archive for {package.name} is not available"
)
Expand Down
2 changes: 1 addition & 1 deletion docker/package/scripts/build-binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ eval "$(opam env)"
OPAMASSUMEDEPEXTS=true opam install conf-rust conf-rust-2021

export CFLAGS="-fPIC ${CFLAGS:-}"
opam install opam/virtual/octez-deps.opam --deps-only --criteria="-notuptodate,-changed,-removed"
OPAMASSUMEDEPEXTS=true opam install opam/virtual/octez-deps.opam --deps-only --criteria="-notuptodate,-changed,-removed"

eval "$(opam env)"
dune build "$dune_filepath"
Expand Down
2 changes: 1 addition & 1 deletion meta.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"release": "1",
"release": "2",
"maintainer": "Serokell <[email protected]>",
"tezos_ref": "octez-v20.2"
}

0 comments on commit 86bdd6f

Please sign in to comment.