Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

3mbe
Copy link
Contributor

@3mbe 3mbe commented Aug 14, 2025

Hey guys, first off, I want to say I really appreciate the solution this project provides, and I definitely want to contribute to it further.

As a starting point, I’ve made a small but meaningful enhancement to improve local development reliability.

  • Updated Makefile to explicitly use bash with -eo pipefail for multi-line recipes
    • By default, GNU Make uses /bin/sh, which often lacks pipefail. This means in multi-line recipes (like the release loop), a failing command in a pipeline may not cause the recipe to fail, leading to silent errors.
    • Our PLATFORMS list is static, but a local build can still fail (e.g., due to a changed third-party dependency). Setting bash -eo pipefail ensures each command in the loop fails fast, preventing partial or misleading build results.

Example:

.PHONY: release
release: clean ## Build for all platforms
	@echo "==> Building for all platforms..."
	@mkdir -p dist
	@for platform in $(PLATFORMS); do \
		GOOS=$$(echo $$platform | cut -d'/' -f1); \
		GOARCH=$$(echo $$platform | cut -d'/' -f2); \
		output_name=$(BINARY_NAME)-$$GOOS-$$GOARCH; \
		if [ "$$GOOS" = "windows" ]; then \
			output_name="$$output_name.exe"; \
		fi; \
		echo "Building for $$GOOS/$$GOARCH..."; \
		# bash -eo pipefail ensures a single platform build failure stops the loop
		CGO_ENABLED=$(CGO_ENABLED) GOOS=$$GOOS GOARCH=$$GOARCH \
			go build $(BUILD_FLAGS) $(LDFLAGS) -o dist/$$output_name $(MAIN_PATH); \
	done
  • Update README to document development dependencies and note shell behavior

@3mbe
Copy link
Contributor Author

3mbe commented Aug 14, 2025

@3mbe please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree

@gossion gossion requested a review from Copilot August 15, 2025 01:12
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the development experience by ensuring consistent and reliable build behavior across different environments. The changes address potential silent failures in multi-line Makefile recipes by enforcing bash with fail-fast options.

  • Configures Makefile to use bash with -eo pipefail flags for all multi-line recipes
  • Documents development prerequisites and shell behavior in README
  • Adds shell information to the info target for debugging purposes

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
Makefile Adds explicit bash shell configuration with fail-fast options and shell info display
README.md Documents development prerequisites including Go, bash, and Make requirements

Copy link
Member

@gossion gossion left a comment

Choose a reason for hiding this comment

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

thanks for the change.

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@14e1d51). Learn more about missing BASE report.
⚠️ Report is 73 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #158   +/-   ##
=======================================
  Coverage        ?   34.74%           
=======================================
  Files           ?       59           
  Lines           ?     5943           
  Branches        ?        0           
=======================================
  Hits            ?     2065           
  Misses          ?     3795           
  Partials        ?       83           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gossion gossion merged commit 22b6d97 into Azure:main Aug 15, 2025
9 checks passed
@3mbe 3mbe deleted the makefile-shell-enhancement branch August 21, 2025 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants