Skip to content

Commit 75865e6

Browse files
authored
fix win executable crashing (add manifest to the executable during compile) (#565)
1 parent 806f60b commit 75865e6

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

Diff for: .github/workflows/test.yml

+5
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ jobs:
4747

4848
- name: Build the Agent
4949
run: task build
50+
if: matrix.operating-system != 'windows-latest'
51+
52+
- name: Build the Agent for win
53+
run: task build-win
54+
if: matrix.operating-system == 'windows-latest'
5055

5156
- name: Run unit tests
5257
run: task test-unit

Diff for: Taskfile.yml

+14-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ tasks:
77
cmds:
88
- go build -v -i {{.LDFLAGS}}
99

10+
build-win:
11+
desc: Build the project for win
12+
cmds:
13+
- go get github.com/akavel/rsrc
14+
- rsrc -arch=386 -manifest=manifest.xml
15+
- go build -v -i {{.WIN_LDFLAGS}}
16+
- rm rsrc.syso
17+
1018
test:
1119
desc: Run the full testsuite, `legacy` will be skipped
1220
cmds:
@@ -39,13 +47,18 @@ vars:
3947
DEFAULT_TARGETS:
4048
sh: echo `go list ./... | grep -v 'arduino-create-agent/gen/' | tr '\n' ' '`
4149
# build vars
50+
WIN_FLAGS: -H=windowsgui
4251
COMMIT:
4352
sh: echo ${TRAVIS_COMMIT:-`git log -n 1 --format=%h`}
4453
TAG:
4554
sh: echo `git describe --tags --abbrev=0`
4655
LDFLAGS: >
4756
-ldflags '-X main.version={{.TAG}}
4857
-X main.git_revision={{.COMMIT}}'
58+
WIN_LDFLAGS: >
59+
-ldflags '-X main.version={{.TAG}}
60+
-X main.git_revision={{.COMMIT}}
61+
{{.WIN_FLAGS}}'
4962
# test vars
5063
GOFLAGS: "-timeout 10m -v -coverpkg=./... -covermode=atomic"
5164
TEST_VERSIONSTRING: "0.0.0-alpha"
@@ -61,4 +74,4 @@ vars:
6174
# DOCS_VERSION: dev
6275
# DOCS_ALIAS: ""
6376
# DOCS_REMOTE: "origin"
64-
77+

Diff for: go.mod

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module github.com/arduino/arduino-create-agent
33
go 1.14
44

55
require (
6+
github.com/akavel/rsrc v0.9.0 // indirect
67
github.com/blang/semver v3.5.1+incompatible
78
github.com/codeclysm/extract v2.0.0+incompatible
89
github.com/creack/goselect v0.0.0-20180501195510-58854f77ee8d

Diff for: go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
github.com/akavel/rsrc v0.9.0 h1:HwUDC0+tMFWqN4D5G+o5siGD4oVsC3jn6zM8ocjc3nY=
2+
github.com/akavel/rsrc v0.9.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c=
13
github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=
24
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
35
github.com/codeclysm/extract v2.0.0+incompatible h1:+b4WsD7YuZ5u3iW5T5TWbO764zUyEpQZSH5tZbjAxXQ=

0 commit comments

Comments
 (0)