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

fixes go build on windows #4858

Merged
merged 4 commits into from
Mar 7, 2024
Merged

fixes go build on windows #4858

merged 4 commits into from
Mar 7, 2024

Conversation

hilmarf
Copy link
Member

@hilmarf hilmarf commented Mar 5, 2024

Currently the go build fails on windows machines with the following error:

cmd\cnbBuild.go:589:3: unknown field Credential in struct literal of type "syscall".SysProcAttr
cmd\cnbBuild.go:589:24: undefined: syscall.Credential

Because on Windows the exec_windows.go contains the struct like this:

type SysProcAttr struct {
	HideWindow                 bool
	CmdLine                    string // used if non-empty, else the windows command line is built by escaping the arguments passed to StartProcess
	CreationFlags              uint32
	Token                      Token               // if set, runs new process in the security context represented by the token
	ProcessAttributes          *SecurityAttributes // if set, applies these security attributes as the descriptor for the new process
	ThreadAttributes           *SecurityAttributes // if set, applies these security attributes as the descriptor for the main thread of the new process
	NoInheritHandles           bool                // if set, no handles are inherited by the new process, not even the standard handles, contained in ProcAttr.Files, nor the ones contained in AdditionalInheritedHandles
	AdditionalInheritedHandles []Handle            // a list of additional handles, already marked as inheritable, that will be inherited by the new process
	ParentProcess              Handle              // if non-zero, the new process regards the process given by this handle as its parent process, and AdditionalInheritedHandles, if set, should exist in this parent process
}

Which obviously doesn't have Credential

cmd\cnbBuild.go:589:3: unknown field Credential in struct literal of
type "syscall".SysProcAttr
cmd\cnbBuild.go:589:24: undefined: syscall.Credential
@hilmarf hilmarf requested a review from a team as a code owner March 5, 2024 15:33
Copy link

sonarcloud bot commented Mar 5, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@hilmarf
Copy link
Member Author

hilmarf commented Mar 5, 2024

@pbusko / @kulhadia / @modulo11 - may I ask you to take a look at this PR and maybe approve?

It makes local development and testing/debugging on Windows a lot easier. Thanks!

🖖 live long and prosper
Hilmar

@tiloKo
Copy link
Member

tiloKo commented Mar 5, 2024

highly appreciated - these errors drive me crazy

Copy link
Member

@tiloKo tiloKo left a comment

Choose a reason for hiding this comment

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

lgtm

@tiloKo
Copy link
Member

tiloKo commented Mar 7, 2024

/it

@hilmarf
Copy link
Member Author

hilmarf commented Mar 7, 2024

@tiloKo thanks for the approval and the trigger of the integration tests... any idea why they are failing? The error message is a bit short and I can't see a relationship to my changes :-(

@tiloKo
Copy link
Member

tiloKo commented Mar 7, 2024

@tiloKo thanks for the approval and the trigger of the integration tests... any idea why they are failing? The error message is a bit short and I can't see a relationship to my changes :-(

honestly for my PRs I ignore the consumer tests as they seem to never work. the normal integration tests contain tests for this step and they were successful. The consumer tests seem to test other steps, e.g. mtabuild and tmsupload so I would vote for just ignoring them

@hilmarf
Copy link
Member Author

hilmarf commented Mar 7, 2024

honestly for my PRs I ignore the consumer tests as they seem to never work. the normal integration tests contain tests for this step and they were successful. The consumer tests seem to test other steps, e.g. mtabuild and tmsupload so I would vote for just ignoring them

fine with me :-)

@tiloKo do you have write permissions? Because I don't... who can now merge it?

@tiloKo tiloKo merged commit 09cd271 into SAP:master Mar 7, 2024
12 of 13 checks passed
maxatsap pushed a commit to maxatsap/jenkins-library that referenced this pull request Jul 23, 2024
* fixes `go build` on windows
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.

2 participants