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

DAOS-17287 build: Remove separate rpm build for raft #16094

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
7 changes: 6 additions & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
daos (2.7.101-6) unstable; urgency=medium
daos (2.7.101-7) unstable; urgency=medium
[ Jeff Olivier ]
* Remove raft as an external dependence

-- Jeff Olivier <jeffolivier@google.com> Tue, 18 Mar 2025 19:31:00 +0000

daos (2.7.101-6) unstable; urgency=medium
* Remove server build from Ubuntu packaging
* Fix client only build

Expand Down
8 changes: 3 additions & 5 deletions utils/rpms/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ include packaging/Makefile_packaging.mk

PACKAGING_CHECK_DIR ?= ../../../rpm/packaging

$(NAME)-$(VERSION).tar.gz: $(shell git ls-files :/:)
$(NAME)-$(VERSION).tar.gz: $(shell git ls-files --recurse-submodules :/:)
echo Creating $@
echo $(basename $@)
cd ../../ && \
git archive --format tar --prefix $(NAME)-$(VERSION)/ \
-o $$OLDPWD/$(basename $@) HEAD ./
rm -f $@
gzip $(basename $@)
cd ../../ && utils/rpms/archive.sh utils/rpms $(NAME) $(VERSION) tar
gzip $(NAME)-$(VERSION).tar

tarball: $(NAME)-$(VERSION).tar.gz
46 changes: 46 additions & 0 deletions utils/rpms/archive.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash
#
# Usage: archive.sh <dir> <name> <version> <extension>
#
# Create an archive of the HEAD commit of a local Git repository, including
# submodules.
#
# - Must run at the root of the Git repository.
# - Must have all submodules recursively initialized and updated.
# - Whitespaces are prohibited in any of the parameters.
#
# For example,
#
# archive.sh /a/b/c daos 1.2.3 tar
#
# produces /a/b/c/daos-1.2.3.tar.
#

set -e

dir=$1
name=$2
version=$3
ext=$4

# Use a temporary directory for all intermediate files.
unset tmp
trap 'if [ -n "${tmp}" ]; then rm -rf "${tmp}"; fi' EXIT
tmp=$(mktemp -d)

file_extless="${name}-${version}"
file="${file_extless}.${ext}"
sm_file_prefix="${file_extless}-submodule"

# Create an archive, which doesn't include any submodule.
git archive --prefix "${name}-${version}/" -o "${tmp}/${file}" HEAD

# Add all submodules to the archive.
# shellcheck disable=SC2086,SC2016
git submodule --quiet foreach --recursive \
'tarfile='${tmp}/${sm_file_prefix}'-$name.'${ext}' && \
git archive --prefix '${name}-${version}'/$displaypath/ -o ${tarfile} $sha1 && \
Copy link
Contributor

@liw liw Mar 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think sm_path is more correct than displaypath, though if we are at the root of daos they are the same. For example, if we are in src, then

    sm_path=src/rdb/raft
displaypath=rdb/raft

while we always want the prefix to be name-version/src/rdb/raft.

Copy link
Contributor Author

@jolivier23 jolivier23 Mar 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liw sm_path didn't work for recursive submodules (follow-on spdk patch) and the comment at the top says it has to be run from root.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Then let's go with displaypath.

tar -Af '"${tmp}/${file}"' ${tarfile}'

# Publish the archive.
mv "${tmp}/${file}" "${dir}/${file}"
8 changes: 4 additions & 4 deletions utils/rpms/daos.spec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

Name: daos
Version: 2.7.101
Release: 6%{?relval}%{?dist}
Release: 7%{?relval}%{?dist}
Summary: DAOS Storage Engine

License: BSD-2-Clause-Patent
Expand Down Expand Up @@ -82,9 +82,6 @@ BuildRequires: libisa-l_crypto-devel
BuildRequires: libisal-devel
BuildRequires: libisal_crypto-devel
%endif
%if %{with server}
BuildRequires: daos-raft-devel = 0.11.0-1.416.g12dbc15%{?dist}
%endif
BuildRequires: openssl-devel
BuildRequires: libevent-devel
BuildRequires: libyaml-devel
Expand Down Expand Up @@ -632,6 +629,9 @@ getent passwd daos_agent >/dev/null || useradd -s /sbin/nologin -r -g daos_agent
# No files in a shim package

%changelog
* Tue Mar 18 2025 Jeff Olivier <jeffolivier@google.com> 2.7.101-7
- Remove raft as external dependency

* Mon Mar 10 2025 Jeff Olivier <jeffolivie@google.com> 2.7.101-6
- Remove server from Ubuntu packaging and fix client only build

Expand Down
Loading