Skip to content

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

Open
SteveYuOWO wants to merge 1 commit intoVistara-Labs:mainfrom
SteveYuOWO:bump-package
Open

Update gopsutil to v3.21.12 for Deprecated Function Warning Fix#6
SteveYuOWO wants to merge 1 commit intoVistara-Labs:mainfrom
SteveYuOWO:bump-package

Conversation

@SteveYuOWO
Copy link
Copy Markdown

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