Skip to content

fix: use the windows api function equivalent to rusage #1470

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

j-dubb-dev
Copy link

@j-dubb-dev j-dubb-dev commented Apr 23, 2025

Description of changes:

Building for GOOS=windows fails because /aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Time_/externs.go is using syscall.Rusage which doesn't exist in the syscall package for windows builds.

The proposed change moves the offending function GetProcessCpuTimeMillis to another file externs_linux_and_darwin.go which has a //go:build !windows compiler directive so this version of the function is use on non-windows systems. A second file, externs_windows.go with the //go:build windows compiler directive was added and the same function signature was specified, but it uses GetProcessTimes from the windows API to get the same process time information returned by getrusage.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@j-dubb-dev j-dubb-dev requested a review from a team as a code owner April 23, 2025 16:03
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