Skip to content
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

Add windows servers to smoke test #83

Merged
merged 1 commit into from
Sep 26, 2023
Merged

Add windows servers to smoke test #83

merged 1 commit into from
Sep 26, 2023

Conversation

yosifkit
Copy link
Member

Disable cgo to fix build failure on GHA windows-2022

Example failure from PRs to official-images:

go: downloading github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
# github.com/docker-library/bashbrew/cmd/bashbrew
C:\hostedtoolcache\windows\go\1.18.10\x64\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\RUNNER~1\AppData\Local\Temp\go-link-3224421645\000008.o: in function `_cgo_preinit_init':
\\_\_\runtime\cgo/gcc_libinit_windows.c:30: undefined reference to `__imp___iob_func'
C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\RUNNER~1\AppData\Local\Temp\go-link-3224421645\000008.o: in function `x_cgo_sys_thread_create':
\\_\_\runtime\cgo/gcc_libinit_windows.c:60: undefined reference to `__imp___iob_func'
C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\RUNNER~1\AppData\Local\Temp\go-link-3224421645\000008.o: in function `x_cgo_notify_runtime_init_done':
\\_\_\runtime\cgo/gcc_libinit_windows.c:101: undefined reference to `__imp___iob_func'
C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\RUNNER~1\AppData\Local\Temp\go-link-3224421645\000009.o: in function `x_cgo_thread_start':
\\_\_\runtime\cgo/gcc_util.c:18: undefined reference to `__imp___iob_func'
C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\RUNNER~1\AppData\Local\Temp\go-link-3224421645\000010.o: in function `_cgo_sys_thread_start':
\\_\_\runtime\cgo/gcc_windows_amd64.c:31: undefined reference to `__imp___iob_func'
collect2.exe: error: ld returned 1 exit status

@codecov-commenter
Copy link

Codecov Report

Merging #83 (5eb555b) into master (6334a4f) will not change coverage.
The diff coverage is n/a.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@           Coverage Diff           @@
##           master      #83   +/-   ##
=======================================
  Coverage   73.10%   73.10%           
=======================================
  Files           7        7           
  Lines         714      714           
=======================================
  Hits          522      522           
  Misses        162      162           
  Partials       30       30           

action.yml Outdated
@@ -11,6 +11,8 @@ runs:
- uses: actions/setup-go@v3
with:
go-version-file: '${{ github.action_path }}/go.mod'
env:
CGO_ENABLED: 0
Copy link
Member

Choose a reason for hiding this comment

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

Should we instead add this to

export GO111MODULE=on
?

(with : "${CGO_ENABLED:=0}")

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I think that makes sense.

$ git grep -i cgo
Dockerfile:RUN CGO_ENABLED=0 ./bashbrew.sh --version; \
Dockerfile.release:ENV CGO_ENABLED 0
action.yml:        CGO_ENABLED: 0

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, now moved to bashbrew.sh. We could drop it from the Dockerfile but it seems fine to be explicit there and in the Dockerfile.release.

$ git grep -i cgo
Dockerfile:RUN CGO_ENABLED=0 ./bashbrew.sh --version; \
Dockerfile.release:ENV CGO_ENABLED 0
bashbrew.sh:: "${CGO_ENABLED:=0}"
bashbrew.sh:export GO111MODULE=on CGO_ENABLED

Disable cgo to fix build failure on GHA windows-2022
@tianon tianon merged commit a226be9 into master Sep 26, 2023
12 checks passed
@tianon tianon deleted the windows-workflow branch September 26, 2023 01:12
@whalelines
Copy link

Is there a reason to disable for all rather than just for windows?

@yosifkit
Copy link
Member Author

Just for consistency across OS, architecture, and build pipeline. It was already disabled for the builds using Dockerfile or Dockerfile.release, just not the script directly on a host like GitHub Actions.

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.

5 participants