From 1e82a6dafeba9227839de58cd4eaf3b87121168a Mon Sep 17 00:00:00 2001 From: Bhaskar Brahma Date: Mon, 27 Oct 2025 11:46:21 -0700 Subject: [PATCH 1/7] CGO_ENABLED=0 forces static linking --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e141351..fda63b7 100644 --- a/Makefile +++ b/Makefile @@ -15,10 +15,12 @@ binary: clean echo "GOPATH is not set"; \ exit 1; \ fi - GOOS=linux GOARCH=amd64 govvv build -v \ + GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -v \ # CGO_ENABLED=0 forces static linking + -tags "netgo,osusergo" \ #-tags netgo,osusergo make the intent explicit and ensure the pure-Go implementations are selected even if cgo is enabled elsewhere (for other packages). -ldflags "-X main.Version=`grep -E -m 1 -o '(.*)' misc/manifest.xml | awk -F">" '{print $$2}' | awk -F"<" '{print $$1}'`" \ -o $(BINDIR)/$(BIN) ./main - GOOS=linux GOARCH=arm64 govvv build -v \ + GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -v \ # CGO_ENABLED=0 forces static linking + -tags "netgo,osusergo" \ #-tags netgo,osusergo make the intent explicit and ensure the pure-Go implementations are selected even if cgo is enabled elsewhere (for other packages). -ldflags "-X main.Version=`grep -E -m 1 -o '(.*)' misc/manifest.xml | awk -F">" '{print $$2}' | awk -F"<" '{print $$1}'`" \ -o $(BINDIR)/$(BIN_ARM64) ./main cp ./misc/custom-script-shim ./$(BINDIR) From 299598c73b0b2ca6629a26654a4a56700216cfca Mon Sep 17 00:00:00 2001 From: Bhaskar Brahma Date: Mon, 27 Oct 2025 12:12:57 -0700 Subject: [PATCH 2/7] Fixed comment spacing --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index fda63b7..715a2c6 100644 --- a/Makefile +++ b/Makefile @@ -16,11 +16,11 @@ binary: clean exit 1; \ fi GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -v \ # CGO_ENABLED=0 forces static linking - -tags "netgo,osusergo" \ #-tags netgo,osusergo make the intent explicit and ensure the pure-Go implementations are selected even if cgo is enabled elsewhere (for other packages). + -tags "netgo,osusergo" \ # -tags netgo,osusergo make the intent explicit and ensure the pure-Go implementations are selected even if cgo is enabled elsewhere (for other packages). -ldflags "-X main.Version=`grep -E -m 1 -o '(.*)' misc/manifest.xml | awk -F">" '{print $$2}' | awk -F"<" '{print $$1}'`" \ -o $(BINDIR)/$(BIN) ./main GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -v \ # CGO_ENABLED=0 forces static linking - -tags "netgo,osusergo" \ #-tags netgo,osusergo make the intent explicit and ensure the pure-Go implementations are selected even if cgo is enabled elsewhere (for other packages). + -tags "netgo,osusergo" \ # -tags netgo,osusergo make the intent explicit and ensure the pure-Go implementations are selected even if cgo is enabled elsewhere (for other packages). -ldflags "-X main.Version=`grep -E -m 1 -o '(.*)' misc/manifest.xml | awk -F">" '{print $$2}' | awk -F"<" '{print $$1}'`" \ -o $(BINDIR)/$(BIN_ARM64) ./main cp ./misc/custom-script-shim ./$(BINDIR) From 073f4cf3df847d3c5ea41fab372df8c3ff27dc46 Mon Sep 17 00:00:00 2001 From: Bhaskar Brahma Date: Mon, 27 Oct 2025 13:36:30 -0700 Subject: [PATCH 3/7] made tags space separated instead of comma separated --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 715a2c6..3f50312 100644 --- a/Makefile +++ b/Makefile @@ -16,11 +16,11 @@ binary: clean exit 1; \ fi GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -v \ # CGO_ENABLED=0 forces static linking - -tags "netgo,osusergo" \ # -tags netgo,osusergo make the intent explicit and ensure the pure-Go implementations are selected even if cgo is enabled elsewhere (for other packages). + -tags "netgo osusergo" \ # -tags netgo,osusergo make the intent explicit and ensure the pure-Go implementations are selected even if cgo is enabled elsewhere (for other packages). -ldflags "-X main.Version=`grep -E -m 1 -o '(.*)' misc/manifest.xml | awk -F">" '{print $$2}' | awk -F"<" '{print $$1}'`" \ -o $(BINDIR)/$(BIN) ./main GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -v \ # CGO_ENABLED=0 forces static linking - -tags "netgo,osusergo" \ # -tags netgo,osusergo make the intent explicit and ensure the pure-Go implementations are selected even if cgo is enabled elsewhere (for other packages). + -tags "netgo osusergo" \ # -tags netgo,osusergo make the intent explicit and ensure the pure-Go implementations are selected even if cgo is enabled elsewhere (for other packages). -ldflags "-X main.Version=`grep -E -m 1 -o '(.*)' misc/manifest.xml | awk -F">" '{print $$2}' | awk -F"<" '{print $$1}'`" \ -o $(BINDIR)/$(BIN_ARM64) ./main cp ./misc/custom-script-shim ./$(BINDIR) From 15325e2c84fd3182084f1fc83161b7cf1ffdfffe Mon Sep 17 00:00:00 2001 From: bhaskar brahma Date: Mon, 27 Oct 2025 14:55:41 -0700 Subject: [PATCH 4/7] Updated line endings and comments --- .gitattributes | 6 ++++++ Makefile | 12 ++++++------ pkg/preprocess/testdata/dos_with_bom.py | 2 +- pkg/preprocess/testdata/dos_with_bom.sh | 4 ++-- pkg/preprocess/testdata/dos_without_bom.py | 2 +- pkg/preprocess/testdata/dos_without_bom.sh | 4 ++-- 6 files changed, 18 insertions(+), 12 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..e5b0745 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +# Set the default behavior, in case people don't have core.autocrlf set. +* text=auto + +Declare files that will always have CRLF line endings on checkout. +Makefile text eol=lf + diff --git a/Makefile b/Makefile index 3f50312..549f755 100644 --- a/Makefile +++ b/Makefile @@ -15,16 +15,16 @@ binary: clean echo "GOPATH is not set"; \ exit 1; \ fi - GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -v \ # CGO_ENABLED=0 forces static linking - -tags "netgo osusergo" \ # -tags netgo,osusergo make the intent explicit and ensure the pure-Go implementations are selected even if cgo is enabled elsewhere (for other packages). + GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -v \ + -tags "netgo osusergo" \ -ldflags "-X main.Version=`grep -E -m 1 -o '(.*)' misc/manifest.xml | awk -F">" '{print $$2}' | awk -F"<" '{print $$1}'`" \ - -o $(BINDIR)/$(BIN) ./main - GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -v \ # CGO_ENABLED=0 forces static linking - -tags "netgo osusergo" \ # -tags netgo,osusergo make the intent explicit and ensure the pure-Go implementations are selected even if cgo is enabled elsewhere (for other packages). + -o $(BINDIR)/$(BIN) ./main + GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -v \ + -tags "netgo osusergo" \ -ldflags "-X main.Version=`grep -E -m 1 -o '(.*)' misc/manifest.xml | awk -F">" '{print $$2}' | awk -F"<" '{print $$1}'`" \ -o $(BINDIR)/$(BIN_ARM64) ./main cp ./misc/custom-script-shim ./$(BINDIR) clean: rm -rf "$(BINDIR)" "$(BUNDLEDIR)" - .PHONY: clean binary + diff --git a/pkg/preprocess/testdata/dos_with_bom.py b/pkg/preprocess/testdata/dos_with_bom.py index 11cacdf..ce4ba6d 100644 --- a/pkg/preprocess/testdata/dos_with_bom.py +++ b/pkg/preprocess/testdata/dos_with_bom.py @@ -1,2 +1,2 @@ -#!/usr/bin/env python +#!/usr/bin/env python print "hello" \ No newline at end of file diff --git a/pkg/preprocess/testdata/dos_with_bom.sh b/pkg/preprocess/testdata/dos_with_bom.sh index 44c3077..4b55e1d 100644 --- a/pkg/preprocess/testdata/dos_with_bom.sh +++ b/pkg/preprocess/testdata/dos_with_bom.sh @@ -1,2 +1,2 @@ -#!/bin/bash -echo "hello" +#!/bin/bash +echo "hello" diff --git a/pkg/preprocess/testdata/dos_without_bom.py b/pkg/preprocess/testdata/dos_without_bom.py index 778c558..6d7eb0d 100644 --- a/pkg/preprocess/testdata/dos_without_bom.py +++ b/pkg/preprocess/testdata/dos_without_bom.py @@ -1,2 +1,2 @@ -#!/usr/bin/env python +#!/usr/bin/env python print "hello" \ No newline at end of file diff --git a/pkg/preprocess/testdata/dos_without_bom.sh b/pkg/preprocess/testdata/dos_without_bom.sh index f94a3a1..af7c9ad 100644 --- a/pkg/preprocess/testdata/dos_without_bom.sh +++ b/pkg/preprocess/testdata/dos_without_bom.sh @@ -1,2 +1,2 @@ -#!/bin/bash -echo "hello" +#!/bin/bash +echo "hello" From b5a2ae43c94c95d737c7b6c29e8f554705fbcc24 Mon Sep 17 00:00:00 2001 From: Bhaskar Brahma Date: Mon, 27 Oct 2025 14:57:16 -0700 Subject: [PATCH 5/7] fixed .gitattributes --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index e5b0745..9377325 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,6 @@ # Set the default behavior, in case people don't have core.autocrlf set. * text=auto -Declare files that will always have CRLF line endings on checkout. +# Declare files that will always have LF line endings on checkout. Makefile text eol=lf From 79b8e890800b0d8f9cb29cf2d35e38b3a36c9aab Mon Sep 17 00:00:00 2001 From: bhaskar brahma Date: Mon, 27 Oct 2025 15:01:35 -0700 Subject: [PATCH 6/7] removed unnecessary changes --- pkg/preprocess/testdata/dos_with_bom.py | 2 +- pkg/preprocess/testdata/dos_with_bom.sh | 4 ++-- pkg/preprocess/testdata/dos_without_bom.py | 2 +- pkg/preprocess/testdata/dos_without_bom.sh | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/preprocess/testdata/dos_with_bom.py b/pkg/preprocess/testdata/dos_with_bom.py index ce4ba6d..11cacdf 100644 --- a/pkg/preprocess/testdata/dos_with_bom.py +++ b/pkg/preprocess/testdata/dos_with_bom.py @@ -1,2 +1,2 @@ -#!/usr/bin/env python +#!/usr/bin/env python print "hello" \ No newline at end of file diff --git a/pkg/preprocess/testdata/dos_with_bom.sh b/pkg/preprocess/testdata/dos_with_bom.sh index 4b55e1d..44c3077 100644 --- a/pkg/preprocess/testdata/dos_with_bom.sh +++ b/pkg/preprocess/testdata/dos_with_bom.sh @@ -1,2 +1,2 @@ -#!/bin/bash -echo "hello" +#!/bin/bash +echo "hello" diff --git a/pkg/preprocess/testdata/dos_without_bom.py b/pkg/preprocess/testdata/dos_without_bom.py index 6d7eb0d..778c558 100644 --- a/pkg/preprocess/testdata/dos_without_bom.py +++ b/pkg/preprocess/testdata/dos_without_bom.py @@ -1,2 +1,2 @@ -#!/usr/bin/env python +#!/usr/bin/env python print "hello" \ No newline at end of file diff --git a/pkg/preprocess/testdata/dos_without_bom.sh b/pkg/preprocess/testdata/dos_without_bom.sh index af7c9ad..f94a3a1 100644 --- a/pkg/preprocess/testdata/dos_without_bom.sh +++ b/pkg/preprocess/testdata/dos_without_bom.sh @@ -1,2 +1,2 @@ -#!/bin/bash -echo "hello" +#!/bin/bash +echo "hello" From ba5e7d11d5ec0df6cf1d1ec86ae8ba305b1a146a Mon Sep 17 00:00:00 2001 From: Bhaskar Brahma Date: Mon, 27 Oct 2025 15:09:58 -0700 Subject: [PATCH 7/7] added linebreaks to Makefile --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 549f755..7c0afc0 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,9 @@ binary: clean -ldflags "-X main.Version=`grep -E -m 1 -o '(.*)' misc/manifest.xml | awk -F">" '{print $$2}' | awk -F"<" '{print $$1}'`" \ -o $(BINDIR)/$(BIN_ARM64) ./main cp ./misc/custom-script-shim ./$(BINDIR) + clean: rm -rf "$(BINDIR)" "$(BUNDLEDIR)" + .PHONY: clean binary