diff --git a/Dockerfile b/Dockerfile index 14a5c65d..c5833b63 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ # syntax=docker/dockerfile:1 -FROM ubuntu:23.10 AS build -ARG SOURCE_DATE_EPOCH +FROM ubuntu:24.04 AS build RUN apt-get install -Uy --no-install-recommends \ dpkg-dev \ @@ -18,11 +17,11 @@ RUN apt-get install -Uy --no-install-recommends \ libssl-dev \ pkgconf \ python3 \ - # use 'apt-get distclean' when we upgrade to ubuntu:24.04 - && rm -rf /var/lib/apt/lists/* + && apt-get distclean ARG JOBS -RUN --mount=type=bind,rw,target=/src < ndn-cxx EOF -FROM ubuntu:23.10 AS runtime -ARG SOURCE_DATE_EPOCH -RUN --mount=type=bind,from=build,source=/deps,target=/deps \ +FROM ubuntu:24.04 AS runtime + +RUN --mount=from=build,source=/deps,target=/deps \ apt-get install -Uy --no-install-recommends $(cat /deps/ndn-cxx) \ - && rm -rf /var/lib/apt/lists/* + && apt-get distclean -RUN --mount=type=bind,from=build,source=/usr,target=/build \ +RUN --mount=from=build,source=/usr,target=/build \ cp -av /build/lib/libndn-cxx.so.* /usr/lib/ \ && cp -av /build/bin/ndnsec* /usr/bin/ diff --git a/wscript b/wscript index 732b5165..0f0ea01c 100644 --- a/wscript +++ b/wscript @@ -374,10 +374,12 @@ def version(ctx): cmd = ['git', 'describe', '--abbrev=8', '--always', '--match', f'{GIT_TAG_PREFIX}*'] version_from_git = subprocess.run(cmd, capture_output=True, check=True, text=True).stdout.strip() if version_from_git: - if version_from_git.startswith(GIT_TAG_PREFIX): - Context.g_module.VERSION = version_from_git.lstrip(GIT_TAG_PREFIX) + if GIT_TAG_PREFIX and version_from_git.startswith(GIT_TAG_PREFIX): + Context.g_module.VERSION = version_from_git[len(GIT_TAG_PREFIX):] + elif not GIT_TAG_PREFIX and ('.' in version_from_git or '-' in version_from_git): + Context.g_module.VERSION = version_from_git else: - # no tags matched + # no tags matched (or we are in a shallow clone) Context.g_module.VERSION = f'{VERSION_BASE}+git.{version_from_git}' except (OSError, subprocess.SubprocessError): pass