Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 196abb7
Author: Jose <[email protected]>
Date:   Sat Feb 8 11:24:27 2025 +0100

    RPM build fixes

commit 8a735d9
Author: Jose <[email protected]>
Date:   Sat Feb 8 01:23:40 2025 +0100

    Ensure slice2js executable bit is set (#3522)

commit 33a5d64
Author: Bernard Normier <[email protected]>
Date:   Fri Feb 7 14:59:41 2025 -0500

    Rework printTarget to show non-IP transport (#3517)
  • Loading branch information
pepone committed Feb 8, 2025
1 parent 25dcfa1 commit d2accea
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 61 deletions.
23 changes: 8 additions & 15 deletions .github/actions/build-rpm-package/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ inputs:
os:
description: "The target OS (e.g., rhel9, rhel9-arm64, rhel9-x86)"
required: true
build_arch:
description: "The build architecture for cross multillib builds (e.g., i686)"
required: false
default: ""
target_arch:
description: "The target build architecture uses as a parameter for rpmbuild --target"
required: true
dockerfile_path:
description: "Path to the Dockerfile"
required: true
Expand All @@ -24,17 +23,11 @@ runs:

- name: Run Package Build with Mounted Source
run: |
if [[ -n "${{ inputs.build_arch }}" ]]; then
docker run --rm \
-v "$GITHUB_WORKSPACE:/workspace" \
-e ICE_VERSION="${{ inputs.ice_version }}" \
ice-rpm-package-builder bash -c "setarch ${{ inputs.build_arch }} /workspace/ice/packaging/rpm/build-package.sh"
else
docker run --rm \
-v "$GITHUB_WORKSPACE:/workspace" \
-e ICE_VERSION="${{ inputs.ice_version }}" \
ice-rpm-package-builder /workspace/ice/packaging/rpm/build-package.sh
fi
docker run --rm \
-v "$GITHUB_WORKSPACE:/workspace" \
-e ICE_VERSION="${{ inputs.ice_version }}" \
-e TARGET_ARCH="${{ inputs.target_arch }}" \
ice-rpm-package-builder /workspace/ice/packaging/rpm/build-package.sh
shell: bash

- name: Upload Artifacts
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/build-rpm-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ jobs:
include:
- os: rhel9
runner: ubuntu-24.04
target_arch: x86_64
dockerfile_path: ice/packaging/rpm/docker/rhel9/Dockerfile

- os: rhel9-i686
runner: ubuntu-24.04
build_arch: i686
target_arch: i686
dockerfile_path: ice/packaging/rpm/docker/rhel9/Dockerfile

- os: rhel9-arm64
runner: ubuntu-24.04-arm
target_arch: aarch64
dockerfile_path: ice/packaging/rpm/docker/rhel9/Dockerfile

steps:
Expand All @@ -40,4 +42,4 @@ jobs:
ice_version: ${{ inputs.ice_version }}
os: ${{ matrix.os }}
dockerfile_path: ${{ matrix.dockerfile_path }}
build_arch: ${{ matrix.build_arch }}
target_arch: ${{ matrix.target_arch }}
27 changes: 19 additions & 8 deletions cpp/src/Ice/LoggerMiddleware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,29 @@ LoggerMiddleware::printTarget(LoggerOutputBase& out, const Current& current) con
{
out << " -f " << escapeString(current.facet, "", _toStringMode);
}
out << " over ";

if (current.con)
{
for (ConnectionInfoPtr connInfo = current.con->getInfo(); connInfo; connInfo = connInfo->underlying)
ConnectionInfoPtr connInfo = current.con->getInfo();
while (connInfo->underlying)
{
auto ipConnInfo = dynamic_pointer_cast<IPConnectionInfo>(connInfo);
if (ipConnInfo)
{
out << " over " << ipConnInfo->localAddress << ':' << ipConnInfo->localPort << "<->"
<< ipConnInfo->remoteAddress << ':' << ipConnInfo->remotePort;
break;
}
connInfo = connInfo->underlying;
}

if (auto ipConnInfo = dynamic_pointer_cast<IPConnectionInfo>(connInfo))
{
out << ipConnInfo->localAddress << ':' << ipConnInfo->localPort << "<->" << ipConnInfo->remoteAddress << ':'
<< ipConnInfo->remotePort;
}
else
{
// Connection::toString returns a multiline string, so we just use type() here for bt and similar.
out << current.con->type();
}
}
else
{
out << "colloc";
}
}
40 changes: 23 additions & 17 deletions csharp/src/Ice/Internal/LoggerMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,29 +122,35 @@ private void printTarget(StringBuilder sb, Current current)
sb.Append(Ice.UtilInternal.StringUtil.escapeString(current.facet, "", _toStringMode));
}

sb.Append(" over ");

if (current.con is not null)
{
try
ConnectionInfo connInfo = current.con.getInfo();
while (connInfo.underlying is not null)
{
for (ConnectionInfo? p = current.con.getInfo(); p is not null; p = p.underlying)
{
if (p is IPConnectionInfo ipInfo)
{
sb.Append(" over ");
sb.Append(ipInfo.localAddress);
sb.Append(':');
sb.Append(ipInfo.localPort);
sb.Append("<->");
sb.Append(ipInfo.remoteAddress);
sb.Append(':');
sb.Append(ipInfo.remotePort);
break;
}
}
connInfo = connInfo.underlying;
}

if (connInfo is IPConnectionInfo ipConnInfo)
{
sb.Append(ipConnInfo.localAddress);
sb.Append(':');
sb.Append(ipConnInfo.localPort);
sb.Append("<->");
sb.Append(ipConnInfo.remoteAddress);
sb.Append(':');
sb.Append(ipConnInfo.remotePort);
}
catch (LocalException)
else
{
// Connection.ToString() returns a multiline string, so we just use type here for bt and similar.
sb.Append(current.con.type());
}
}
else
{
sb.Append("colloc");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,23 +119,27 @@ private void printTarget(OutputBase out, Current current) {
out.print(" -f ");
out.print(StringUtil.escapeString(current.facet, "", _toStringMode));
}
out.print(" over ");

if (current.con != null) {
try {
for (ConnectionInfo connInfo = current.con.getInfo();
connInfo != null;
connInfo = connInfo.underlying) {
if (connInfo instanceof IPConnectionInfo ipConnInfo) {
out.print(" over ");
out.print(ipConnInfo.localAddress);
out.print(":" + ipConnInfo.localPort);
out.print("<->");
out.print(ipConnInfo.remoteAddress);
out.print(":" + ipConnInfo.remotePort);
}
}
} catch (LocalException exc) {
// Ignore.
ConnectionInfo connInfo = current.con.getInfo();
while (connInfo.underlying != null) {
connInfo = connInfo.underlying;
}

if (connInfo instanceof IPConnectionInfo ipConnInfo) {
out.print(ipConnInfo.localAddress);
out.print(":" + ipConnInfo.localPort);
out.print("<->");
out.print(ipConnInfo.remoteAddress);
out.print(":" + ipConnInfo.remotePort);
} else {
// Connection.toString() returns a multiline string, so we just use type() here
// for bt and similar.
out.print(current.con.type());
}
} else {
out.print("colloc");
}
}
}
18 changes: 15 additions & 3 deletions packaging/rpm/build-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,22 @@ ICE_SPEC_DEST="$RPM_BUILD_ROOT/SPECS/ice.spec"

cp "$ICE_SPEC_SRC" "$ICE_SPEC_DEST"

# Validate TARGET_ARCH
VALID_ARCHS=("x86_64" "i686" "aarch64")
if [[ -z "${TARGET_ARCH:-}" || ! " ${VALID_ARCHS[@]} " =~ " ${TARGET_ARCH} " ]]; then
echo "Error: TARGET_ARCH is not set or invalid. Use one of: ${VALID_ARCHS[*]}"
exit 1
fi

# Define common RPM macros
RPM_MACROS="-D '_topdir $RPM_BUILD_ROOT' -D 'vendor ZeroC, Inc.'"

# Download sources
cd "$RPM_BUILD_ROOT/SOURCES"
spectool -g "$ICE_SPEC_DEST" || { echo "Error: Failed to download sources."; exit 1; }

# Build source and binary RPMs
rpmbuild -bs "$ICE_SPEC_DEST" -D "_topdir $RPM_BUILD_ROOT"
rpmbuild -bb "$ICE_SPEC_DEST" -D "_topdir $RPM_BUILD_ROOT"
# Build source RPM
rpmbuild -bs "$ICE_SPEC_DEST" $RPM_MACROS --target="$TARGET_ARCH"

# Build binary RPM
rpmbuild -bb "$ICE_SPEC_DEST" $RPM_MACROS --target="$TARGET_ARCH"
4 changes: 3 additions & 1 deletion packaging/rpm/ice.spec
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ Source0: https://github.com/zeroc-ice/ice/archive/%{archive_tag}.tar.gz#/%{name
# It's necessary to specify glibc-devel and libstdc++-devel here because gcc/gcc-c++ no longer install
# the 32-bits versions by default on Rhel8 (see https://bugzilla.redhat.com/show_bug.cgi?id=1779597)
BuildRequires: glibc-devel, libstdc++-devel
BuildRequires: pkgconfig(expat), pkgconfig(libedit), pkgconfig(lmdb), pkgconfig(mcpp), pkgconfig(openssl), %{bzip2devel}
BuildRequires: pkgconfig(expat), pkgconfig(libedit), pkgconfig(openssl), %{bzip2devel}
# Use lmdb-devel and mcpp-devel packages instead of pkgconfig as a workaround for https://github.com/zeroc-ice/dist-utils/issues/257
BuildRequires: lmdb-devel, mcpp-devel
BuildRequires: pkgconfig(libsystemd)
BuildRequires: java-17-openjdk-devel, java-17-openjdk-jmods

Expand Down

0 comments on commit d2accea

Please sign in to comment.