Skip to content

Fix invalid tester build version prefix #121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 6, 2021
Merged

Fix invalid tester build version prefix #121

merged 1 commit into from
Aug 6, 2021

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Aug 6, 2021

Previously, the workflow name value was used as a component of the "PACKAGE_NAME_PREFIX" used to add identifying information to the version output and file names of tester builds. That happened to work when used with the "test" name
of the source workflow. However, due to a lack of quoting in the build commands, once the tester build operation was moved to a dedicated workflow with a more descriptive name, it broke the build.

Example:

task: [dist:Windows_32bit] docker run -v `pwd`/..:/home/build -w /home/build \
-e CGO_ENABLED=1 \
docker.elastic.co/beats-dev/golang-crossbuild:1.16.4-main \
--build-cmd "go build -o dist/arduino-lint_windows_386/arduino-lint.exe -ldflags ' -X github.com/arduino/arduino-lint/internal/configuration.Version=Publish Tester Build-fd29502e32d5386607787a5e82e058dffda5a63a-git-snapshot -X github.com/arduino/arduino-lint/internal/configuration.Commit=fd29502 -X github.com/arduino/arduino-lint/internal/configuration.Timestamp=2021-08-05T22:23:50Z '" \
-p "windows/386"

zip arduino-lint_Publish Tester Build-fd29502e32d5386607787a5e82e058dffda5a63a-git-snapshot_Windows_32bit.zip arduino-lint_windows_386/arduino-lint.exe ../LICENSE.txt -j
sha256sum arduino-lint_Publish Tester Build-fd29502e32d5386607787a5e82e058dffda5a63a-git-snapshot_Windows_32bit.zip >> Publish Tester Build-fd29502e32d5386607787a5e82e058dffda5a63a-git-snapshot-checksums.txt

Although it could be supported with appropriate quoting, the use of the workflow name doesn't really make sense in this application. The sole use of the workflow name should be to identify the workflow to humans. It's not really suitable for
machine consumption such as file names. So the best fix for this specific bug is to hard code the identifier in the prefix, retaining the original "test" for consistency.

Previously, the workflow name value was used as a component of the "PACKAGE_NAME_PREFIX" used to add identifying
information to the version output and file names of tester builds. That happened to work when used with the "test" name
of the source workflow. However, due to a lack of quoting in the build commands, once the tester build operation was
moved to a dedicated workflow with a more descriptive name, it broke the build. Example:

task: [dist:Windows_32bit] docker run -v `pwd`/..:/home/build -w /home/build \
-e CGO_ENABLED=1 \
docker.elastic.co/beats-dev/golang-crossbuild:1.16.4-main \
--build-cmd "go build -o dist/arduino-lint_windows_386/arduino-lint.exe -ldflags ' -X github.com/arduino/arduino-lint/internal/configuration.Version=Publish Tester Build-fd29502e32d5386607787a5e82e058dffda5a63a-git-snapshot -X github.com/arduino/arduino-lint/internal/configuration.Commit=fd29502 -X github.com/arduino/arduino-lint/internal/configuration.Timestamp=2021-08-05T22:23:50Z '" \
-p "windows/386"

zip arduino-lint_Publish Tester Build-fd29502e32d5386607787a5e82e058dffda5a63a-git-snapshot_Windows_32bit.zip arduino-lint_windows_386/arduino-lint.exe ../LICENSE.txt -j
sha256sum arduino-lint_Publish Tester Build-fd29502e32d5386607787a5e82e058dffda5a63a-git-snapshot_Windows_32bit.zip >> Publish Tester Build-fd29502e32d5386607787a5e82e058dffda5a63a-git-snapshot-checksums.txt

Although it could be supported with appropriate quoting, the use of the workflow name doesn't really make sense in this
application. The sole use of the workflow name should be to identify the workflow to humans. It's not really suitable for
machine consumption such as file names. So the best fix for this specific bug is to hard code the identifier in the
prefix, retaining the original "test" for consistency.
@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: code Related to content of the project itself labels Aug 6, 2021
@per1234 per1234 requested review from silvanocerza and umbynos August 6, 2021 07:00
@per1234 per1234 merged commit e029391 into arduino:main Aug 6, 2021
@per1234 per1234 deleted the package-name-prefix branch August 6, 2021 08:43
@per1234 per1234 self-assigned this Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants