docker / docker-credential-helpers

Programs to keep Docker login credentials safe by storing in platform keystores
MIT License
1.08k stars 170 forks source link

[chore] update osxkeychain implementation to account for deprecated SDK functions #280

Open thaJeztah opened 1 year ago

thaJeztah commented 1 year ago

Links:

Noticed that running the tests locally, I got deprecation warnings:

GOROOT=/opt/homebrew/Cellar/go/1.20.3/libexec #gosetup
GOPATH=/Users/thajeztah/go #gosetup
/opt/homebrew/Cellar/go/1.20.3/libexec/bin/go test -c -o /private/var/folders/6f/tz5jf4nn1_n5jb0ctrrw5p2w0000gn/T/GoLand/___go_test_github_com_docker_docker_credential_helpers_osxkeychain.test github.com/docker/docker-credential-helpers/osxkeychain #gosetup
# github.com/docker/docker-credential-helpers/osxkeychain [github.com/docker/docker-credential-helpers/osxkeychain.test]
osxkeychain_darwin.c:20:21: warning: 'SecKeychainAddInternetPassword' is deprecated: first deprecated in macOS 10.10 - SecKeychain is deprecated [-Wdeprecated-declarations]
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:567:10: note: 'SecKeychainAddInternetPassword' has been explicitly marked deprecated here
osxkeychain_darwin.c:45:12: warning: 'SecKeychainItemModifyContent' is deprecated: first deprecated in macOS 10.10 - SecKeychain is deprecated [-Wdeprecated-declarations]
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychainItem.h:196:10: note: 'SecKeychainItemModifyContent' has been explicitly marked deprecated here
osxkeychain_darwin.c:58:21: warning: 'SecKeychainFindInternetPassword' is deprecated: first deprecated in macOS 10.10 - SecKeychain is deprecated [-Wdeprecated-declarations]
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:592:10: note: 'SecKeychainFindInternetPassword' has been explicitly marked deprecated here
osxkeychain_darwin.c:75:3: warning: 'SecKeychainItemFreeContent' is deprecated: first deprecated in macOS 10.10 - SecKeychain is deprecated [-Wdeprecated-declarations]
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychainItem.h:220:10: note: 'SecKeychainItemFreeContent' has been explicitly marked deprecated here
osxkeychain_darwin.c:84:12: warning: 'SecKeychainItemCopyContent' is deprecated: first deprecated in macOS 10.10 - SecKeychain is deprecated [-Wdeprecated-declarations]
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychainItem.h:210:10: note: 'SecKeychainItemCopyContent' has been explicitly marked deprecated here
osxkeychain_darwin.c:91:3: warning: 'SecKeychainItemFreeContent' is deprecated: first deprecated in macOS 10.10 - SecKeychain is deprecated [-Wdeprecated-declarations]
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychainItem.h:220:10: note: 'SecKeychainItemFreeContent' has been explicitly marked deprecated here
osxkeychain_darwin.c:99:21: warning: 'SecKeychainFindInternetPassword' is deprecated: first deprecated in macOS 10.10 - SecKeychain is deprecated [-Wdeprecated-declarations]
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:592:10: note: 'SecKeychainFindInternetPassword' has been explicitly marked deprecated here
osxkeychain_darwin.c:115:12: warning: 'SecKeychainItemDelete' is deprecated: first deprecated in macOS 10.10 - SecKeychain is deprecated [-Wdeprecated-declarations]
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychainItem.h:257:10: note: 'SecKeychainItemDelete' has been explicitly marked deprecated here

Also seeing warnings about non-matching macOS / sdk versions;

# github.com/docker/docker-credential-helpers/osxkeychain.test
ld: warning: object file (/var/folders/6f/tz5jf4nn1_n5jb0ctrrw5p2w0000gn/T/go-link-3904589638/000004.o) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/var/folders/6f/tz5jf4nn1_n5jb0ctrrw5p2w0000gn/T/go-link-3904589638/000003.o) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/var/folders/6f/tz5jf4nn1_n5jb0ctrrw5p2w0000gn/T/go-link-3904589638/000006.o) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/var/folders/6f/tz5jf4nn1_n5jb0ctrrw5p2w0000gn/T/go-link-3904589638/000009.o) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: ld: warning: object file (/var/folders/6f/tz5jf4nn1_n5jb0ctrrw5p2w0000gn/T/go-link-3904589638/000005.o) was built for newer macOS version (12.0) than being linked (11.0)
object file (/var/folders/6f/tz5jf4nn1_n5jb0ctrrw5p2w0000gn/T/go-link-3904589638/000007.o) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/var/folders/6f/tz5jf4nn1_n5jb0ctrrw5p2w0000gn/T/go-link-3904589638/000010.o) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/var/folders/6f/tz5jf4nn1_n5jb0ctrrw5p2w0000gn/T/go-link-3904589638/000011.o) was built for newer macOS version (12.0) than being linked (11.0)
ld: warning: object file (/var/folders/6f/tz5jf4nn1_n5jb0ctrrw5p2w0000gn/T/go-link-3904589638/000008.o) was built for newer macOS version (12.0) than being linked (11.0)
/opt/homebrew/Cellar/go/1.20.3/libexec/bin/go tool test2json -t /private/var/folders/6f/tz5jf4nn1_n5jb0ctrrw5p2w0000gn/T/GoLand/___go_test_github_com_docker_docker_credential_helpers_osxkeychain.test -test.v -test.paniconexit0
crazy-max commented 1 year ago

Also seeing warnings about non-matching macOS / sdk versions;

This one is expected when running tests on your machine or GH runners: https://github.com/docker/docker-credential-helpers/actions/runs/5099948633/jobs/9167949348#step:7:44 but should not occur during build. #283 should solve this issue.

Noticed that running the tests locally, I got deprecation warnings:

Can you test with https://github.com/docker/docker-credential-helpers/pull/282?

crazy-max commented 1 year ago

This one is expected when running tests on your machine or GH runners: https://github.com/docker/docker-credential-helpers/actions/runs/5099948633/jobs/9167949348#step:7:44

Fixed in #283 for tests.