conan-1.6-utilities/dev.sh
Ole-Morten Duesund a11e9fb34e Add conandeps: dependency, binary-availability and override report for Conan 1.66
conandeps.py lists direct and indirect dependencies of a conanfile.py,
checks whether Release/Debug/RelWithDebInfo binaries exist on a remote for
the exact profile, and reports explicit (override=True) and implicit
requirement overrides both as a list and on the edges of the dependency
tree. Text output by default, optional self-contained HTML via --html.

The graph is built once per build type through Conan's own info API and
each node's binary status is read back, so package_id modes and options
are honoured like a real install. Overrides are parsed from Conan's WARN
output since 1.x does not record them on the graph.

Development runs inside a pinned podman container (Containerfile, dev.sh)
with Conan 1.66 on Python 3.11. Tests start a throw-away conan_server and
verify missing-binary and override detection end to end.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYNdaGDrpaqDyT8QtrTQbM
2026-08-25 14:48:28 +02:00

21 lines
901 B
Bash
Executable file

#!/usr/bin/env bash
# Run a command inside the pinned Conan 1.66 dev container.
# ./dev.sh build build the image
# ./dev.sh <cmd...> run <cmd> in the container with this dir mounted at /work
# ./dev.sh interactive shell
set -euo pipefail
here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
image="conan-utils-dev"
if [[ "${1:-}" == "build" ]]; then
rev="$(git -C "$here" describe --always --dirty 2>/dev/null || echo unknown)"
BUILDAH_FORMAT=docker podman build \
--build-arg BUILD_DATE="$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
--build-arg GIT_REVISION="$rev" \
-t "$image" "$here"
exit 0
fi
# --userns=keep-id maps the host uid onto the container's 'dev' user (uid 1000).
tty_flags=(); [[ -t 0 && -t 1 ]] && tty_flags=(-it)
podman run --rm "${tty_flags[@]}" --userns=keep-id -v "$here:/work:Z" -w /work "$image" "${@:-bash}"