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

Update gopsutil to v3.21.12 for Deprecated Function Warning Fix #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SteveYuOWO
Copy link

This PR updates the gopsutil dependency from v3.21.11+incompatible to v3.21.12 in our project. This update is necessary to address a deprecation warning that arises when running make build and make test on macOS.

Issue:

While executing these commands, the following warning appears:

# github.com/shirou/gopsutil/disk
iostat_darwin.c:28:2: warning: 'IOMasterPort' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:143:1: note: 'IOMasterPort' has been explicitly marked deprecated here

Cause:

This warning is due to the deprecation of the IOMasterPort function in macOS 12.0. The recommended solution is to use kIOMainPortDefault as an alternative. However, kIOMainPortDefault is not available in macOS versions prior to 12.0. Therefore, a conditional compilation approach is needed for compatibility with both older and newer versions of macOS.

Solution:

By updating gopsutil to v3.21.12, this warning is resolved. The new version of gopsutil likely includes the necessary conditional compilation to maintain compatibility across different macOS versions.

Testing:

Ensure to run make build and make test to verify that the warning no longer appears and that everything functions as expected.

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.

1 participant