Skip to content

fix win executable crashing (add manifest to the executable during compile) #565

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 2 commits into from
Nov 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ jobs:

- name: Build the Agent
run: task build
if: matrix.operating-system != 'windows-latest'

- name: Build the Agent for win
run: task build-win
if: matrix.operating-system == 'windows-latest'

- name: Run unit tests
run: task test-unit
Expand Down
15 changes: 14 additions & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ tasks:
cmds:
- go build -v -i {{.LDFLAGS}}

build-win:
desc: Build the project for win
cmds:
- go get github.com/akavel/rsrc
- rsrc -arch=386 -manifest=manifest.xml
- go build -v -i {{.WIN_LDFLAGS}}
- rm rsrc.syso

test:
desc: Run the full testsuite, `legacy` will be skipped
cmds:
Expand Down Expand Up @@ -39,13 +47,18 @@ vars:
DEFAULT_TARGETS:
sh: echo `go list ./... | grep -v 'arduino-create-agent/gen/' | tr '\n' ' '`
# build vars
WIN_FLAGS: -H=windowsgui
COMMIT:
sh: echo ${TRAVIS_COMMIT:-`git log -n 1 --format=%h`}
TAG:
sh: echo `git describe --tags --abbrev=0`
LDFLAGS: >
-ldflags '-X main.version={{.TAG}}
-X main.git_revision={{.COMMIT}}'
WIN_LDFLAGS: >
-ldflags '-X main.version={{.TAG}}
-X main.git_revision={{.COMMIT}}
{{.WIN_FLAGS}}'
# test vars
GOFLAGS: "-timeout 10m -v -coverpkg=./... -covermode=atomic"
TEST_VERSIONSTRING: "0.0.0-alpha"
Expand All @@ -61,4 +74,4 @@ vars:
# DOCS_VERSION: dev
# DOCS_ALIAS: ""
# DOCS_REMOTE: "origin"
PRETTIER: [email protected]
PRETTIER: [email protected]
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module github.com/arduino/arduino-create-agent
go 1.14

require (
github.com/akavel/rsrc v0.9.0 // indirect
github.com/blang/semver v3.5.1+incompatible
github.com/codeclysm/extract v2.0.0+incompatible
github.com/creack/goselect v0.0.0-20180501195510-58854f77ee8d
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
github.com/akavel/rsrc v0.9.0 h1:HwUDC0+tMFWqN4D5G+o5siGD4oVsC3jn6zM8ocjc3nY=
github.com/akavel/rsrc v0.9.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c=
github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/codeclysm/extract v2.0.0+incompatible h1:+b4WsD7YuZ5u3iW5T5TWbO764zUyEpQZSH5tZbjAxXQ=
Expand Down