Skip to content

Commit eac5841

Browse files
committed
fix(Makefile): remove outdated comments and update Trivy version for security scanning
Signed-off-by: Adilhusain Shaikh <[email protected]>
1 parent 3bfc00a commit eac5841

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

Makefile

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# ==============================================================================
22
# Project: Python Build System (Containerized & Secured)
3-
# Description: Multi-stage build system with caching and security gates.
43
# ==============================================================================
54

65
# --- Configuration & Defaults -------------------------------------------------
@@ -14,24 +13,21 @@ else
1413
Q :=
1514
endif
1615

17-
# --- Versioning ---------------------------------------------------------------
16+
# Versioning
1817
PYTHON_VERSION ?= 3.13.3
1918
ACTIONS_PYTHON_VERSIONS ?= 3.13.3-14344076652
2019
POWERSHELL_VERSION ?= v7.5.2
2120
POWERSHELL_NATIVE_VERSION ?= v7.4.0
2221
UBUNTU_VERSION ?= 24.04
2322

24-
# --- Security Scanning --------------------------------------------------------
25-
# Latest Trivy version (Dec 2025)
26-
TRIVY_VERSION ?= v0.68.2
27-
28-
# Gates: 0 = Log Only, 1 = Fail Build
23+
# Security Scanning & Gates
24+
TRIVY_VERSION ?= v0.58.1
2925
FAIL_ON_CRITICAL ?= 1
3026
FAIL_ON_HIGH ?= 1
3127
FAIL_ON_MEDIUM ?= 0
3228
FAIL_ON_SECRET ?= 1
3329

34-
# --- System Architecture ------------------------------------------------------
30+
# Architecture
3531
ARCH_RAW := $(shell uname -m)
3632
ifeq ($(ARCH_RAW),x86_64)
3733
ARCH := amd64
@@ -41,22 +37,20 @@ else
4137
ARCH := $(ARCH_RAW)
4238
endif
4339

44-
# --- Container Engine ---------------------------------------------------------
40+
# Container Engine
4541
CONTAINER_ENGINE := $(shell command -v podman 2>/dev/null || command -v docker)
4642
ifeq ($(strip $(CONTAINER_ENGINE)),)
4743
$(error No container runtime found. Please install `docker` or `podman`)
4844
endif
4945

5046
# --- Internal Variables -------------------------------------------------------
5147

52-
# The base image tag used internally between stages
5348
BASE_IMAGE := powershell:ubuntu-$(UBUNTU_VERSION)
5449

5550
OUTPUT_DIR := python-versions/output
5651
IMAGE_NAME := python:$(PYTHON_VERSION)-ubuntu-$(UBUNTU_VERSION)-$(ARCH)
5752
TEMP_CONTAINER_NAME := python-build-$(PYTHON_VERSION)-$(ARCH)-tmp
5853

59-
# Artifact filenames
6054
INTERNAL_ARTIFACT_NAME := python-$(PYTHON_VERSION)-linux-$(ARCH).tar.gz
6155
HOST_ARTIFACT_NAME := python-$(PYTHON_VERSION)-linux-$(UBUNTU_VERSION)-$(ARCH).tar.gz
6256

@@ -69,13 +63,13 @@ PS_PREREQS := \
6963

7064
# --- Build Strategy Logic -----------------------------------------------------
7165

72-
# Default: Standard local build (Works for local dev)
66+
# Default: Standard local build
7367
BUILD_CMD := $(CONTAINER_ENGINE) build
7468
BUILD_OPTS :=
7569

7670
# GHA Override: Use Buildx with Caching
77-
# Critical Fix: We use '--load' to ensure the built image is exported
78-
# from the isolated BuildKit container to the local Docker daemon.
71+
# [CRITICAL FIX] We utilize specific scopes per target in the recipes below
72+
# and rely on '--load' to export the image to the local daemon.
7973
ifeq ($(USE_GHA_CACHE),1)
8074
BUILDX_BUILDER ?= gha-builder
8175
BUILD_CMD := $(CONTAINER_ENGINE) buildx build
@@ -89,7 +83,6 @@ endif
8983
all: $(OUTPUT_DIR)/$(HOST_ARTIFACT_NAME) verify-gate
9084

9185
# 1. Build the Python Artifact (Stage 2)
92-
# Depends on 'powershell' target being run first to create the BASE_IMAGE
9386
$(OUTPUT_DIR)/$(HOST_ARTIFACT_NAME): powershell | $(OUTPUT_DIR)
9487
@echo "--- Building Python $(PYTHON_VERSION) Image ($(ARCH)) ---"
9588
@echo " Security Gate: CRIT=$(FAIL_ON_CRITICAL) HIGH=$(FAIL_ON_HIGH) SECRET=$(FAIL_ON_SECRET)"
@@ -143,7 +136,7 @@ verify-gate:
143136
fi
144137

145138
# 3. Build Base PowerShell Image (Stage 1)
146-
# Uses separate cache scope to prevent overwriting the Python cache
139+
# [CRITICAL] This forces the build to load into local Docker so Stage 2 can see it
147140
powershell: $(PS_PREREQS)
148141
@echo "--- Building PowerShell Base Image ---"
149142
$(Q)cd $(PS_DIR) && $(BUILD_CMD) $(BUILD_OPTS) \

0 commit comments

Comments
 (0)