From 7c4aaa0a19d924012b2c683d000fcb9bdd56d8c9 Mon Sep 17 00:00:00 2001 From: LaszloP <7979773+lpusok@users.noreply.github.com> Date: Mon, 7 Apr 2025 12:33:57 +0200 Subject: [PATCH 01/11] dep update --- go.mod | 4 +- go.sum | 8 ++-- .../exportoptions/appstore_options.go | 21 ++++++++- .../go-xcode/exportoptions/properties.go | 44 +++++++++++++++++-- .../exportoptionsgenerator.go | 12 +++-- vendor/modules.txt | 4 +- 6 files changed, 75 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index 40892792..04498ab5 100644 --- a/go.mod +++ b/go.mod @@ -8,8 +8,8 @@ require ( github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.23 github.com/bitrise-io/go-utils v1.0.12 github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.23 - github.com/bitrise-io/go-xcode v1.2.0 - github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.54 + github.com/bitrise-io/go-xcode v1.2.1-0.20250407100337-8b18b3fc5b8d + github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.54.0.20250407101546-6284334f9994 github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 github.com/stretchr/testify v1.10.0 gopkg.in/yaml.v3 v3.0.1 diff --git a/go.sum b/go.sum index 5c423c8c..6d88b26a 100644 --- a/go.sum +++ b/go.sum @@ -11,10 +11,10 @@ github.com/bitrise-io/go-utils v1.0.12 h1:iJV1ZpyvSA0NCte/N6x+aIQ9TrNr5sIBlcJBf0 github.com/bitrise-io/go-utils v1.0.12/go.mod h1:ZY1DI+fEpZuFpO9szgDeICM4QbqoWVt0RSY3tRI1heY= github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.23 h1:Dfh4nyZPuEtilBisidejqxBrkx9cWvbOUrpq8VEION0= github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.23/go.mod h1:3XUplo0dOWc3DqT2XA2SeHToDSg7+j1y1HTHibT2H68= -github.com/bitrise-io/go-xcode v1.2.0 h1:rbyeM7y1CcGD+udmODEPcVN6ek4HjuP9DQ/FHNY3JPE= -github.com/bitrise-io/go-xcode v1.2.0/go.mod h1:9OwsvrhZ4A2JxHVoEY7CPcABAKA+OE7FQqFfBfvbFuY= -github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.54 h1:xTIh8AbSVWfSpkhyHj0uOO0I9BPjz5yJcIIPVy3TbGg= -github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.54/go.mod h1:T4rhWQljdgH5As4Dq/RQWuazdScY0YB7uZAMuBUnxeY= +github.com/bitrise-io/go-xcode v1.2.1-0.20250407100337-8b18b3fc5b8d h1:etvh09pPVy95jyGIRWwyL6oMn7i26IexIO91glHleJA= +github.com/bitrise-io/go-xcode v1.2.1-0.20250407100337-8b18b3fc5b8d/go.mod h1:9OwsvrhZ4A2JxHVoEY7CPcABAKA+OE7FQqFfBfvbFuY= +github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.54.0.20250407101546-6284334f9994 h1:IhKW6iBAzuTIDivkY3qp1Xxg06SvCbK2bdcBvpJEGuY= +github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.54.0.20250407101546-6284334f9994/go.mod h1:7c9QVlPJuv323WGVPc4Y/BuTQhnKwxEMbb2CrJ86xUM= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= diff --git a/vendor/github.com/bitrise-io/go-xcode/exportoptions/appstore_options.go b/vendor/github.com/bitrise-io/go-xcode/exportoptions/appstore_options.go index 9eebcdd3..99fc38b1 100644 --- a/vendor/github.com/bitrise-io/go-xcode/exportoptions/appstore_options.go +++ b/vendor/github.com/bitrise-io/go-xcode/exportoptions/appstore_options.go @@ -8,6 +8,7 @@ import ( // AppStoreOptionsModel ... type AppStoreOptionsModel struct { + Method Method TeamID string BundleIDProvisioningProfileMapping map[string]string SigningCertificate string @@ -26,9 +27,25 @@ type AppStoreOptionsModel struct { TestFlightInternalTestingOnly bool } -// NewAppStoreOptions ... +// NewAppStoreOptions sets "app-store" as the export method +// deprecated: use NewAppStoreConnectOptions instead func NewAppStoreOptions() AppStoreOptionsModel { return AppStoreOptionsModel{ + Method: MethodAppStore, + UploadBitcode: UploadBitcodeDefault, + UploadSymbols: UploadSymbolsDefault, + ManageAppVersion: manageAppVersionDefault, + TestFlightInternalTestingOnly: TestFlightInternalTestingOnlyDefault, + } +} + +// NewAppStoreConnectOptions sets either "app-store" or "app-store-connect" as the export method +func NewAppStoreConnectOptions(method Method) AppStoreOptionsModel { + if !method.IsAppStore() { + panic("non app-store method passed to NewAppStoreConnectOptions") + } + return AppStoreOptionsModel{ + Method: method, UploadBitcode: UploadBitcodeDefault, UploadSymbols: UploadSymbolsDefault, ManageAppVersion: manageAppVersionDefault, @@ -39,7 +56,7 @@ func NewAppStoreOptions() AppStoreOptionsModel { // Hash ... func (options AppStoreOptionsModel) Hash() map[string]interface{} { hash := map[string]interface{}{} - hash[MethodKey] = MethodAppStore + hash[MethodKey] = options.Method if options.TeamID != "" { hash[TeamIDKey] = options.TeamID } diff --git a/vendor/github.com/bitrise-io/go-xcode/exportoptions/properties.go b/vendor/github.com/bitrise-io/go-xcode/exportoptions/properties.go index 84f8d194..b8cb9317 100644 --- a/vendor/github.com/bitrise-io/go-xcode/exportoptions/properties.go +++ b/vendor/github.com/bitrise-io/go-xcode/exportoptions/properties.go @@ -83,23 +83,45 @@ const MethodKey = "method" type Method string const ( - // MethodAppStore ... + // MethodAppStore is deprecated since Xcode 15.3, its new name is MethodAppStoreConnect MethodAppStore Method = "app-store" - // MethodAdHoc ... + // MethodAdHoc is deprecated since Xcode 15.3, its new name is MethodReleaseTesting MethodAdHoc Method = "ad-hoc" // MethodPackage ... MethodPackage Method = "package" // MethodEnterprise ... MethodEnterprise Method = "enterprise" - // MethodDevelopment ... + // MethodDevelopment is deprecated since Xcode 15.3, its new name is MethodDebugging MethodDevelopment Method = "development" // MethodDeveloperID ... MethodDeveloperID Method = "developer-id" + // MethodDebugging is the new name for MethodDevelopment since Xcode 15.3 + MethodDebugging Method = "debugging" + // MethodAppStoreConnect is the new name for MethodAppStore since Xcode 15.3 + MethodAppStoreConnect Method = "app-store-connect" + // MethodReleaseTesting is the new name for MethodAdHoc since Xcode 15.3 + MethodReleaseTesting Method = "release-testing" // MethodDefault ... MethodDefault Method = MethodDevelopment ) -// ParseMethod ... +func (m Method) IsAppStore() bool { + return m == MethodAppStore || m == MethodAppStoreConnect +} + +func (m Method) IsAdHoc() bool { + return m == MethodAdHoc || m == MethodReleaseTesting +} + +func (m Method) IsDevelopment() bool { + return m == MethodDevelopment || m == MethodDebugging +} + +func (m Method) IsEnterprise() bool { + return m == MethodEnterprise +} + +// ParseMethod parses Step input and returns the corresponding Method. func ParseMethod(method string) (Method, error) { switch method { case "app-store": @@ -119,6 +141,20 @@ func ParseMethod(method string) (Method, error) { } } +// UpgradeExportMethod replaces the legacy export method strings with the ones available in Xcode 15.3 and later. +func UpgradeExportMethod(method Method) Method { + switch method { + case MethodAppStore: + return MethodAppStoreConnect + case MethodAdHoc: + return MethodReleaseTesting + case MethodDevelopment: + return MethodDebugging + } + + return method +} + // OnDemandResourcesAssetPacksBaseURLKey .... const OnDemandResourcesAssetPacksBaseURLKey = "onDemandResourcesAssetPacksBaseURL" diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/exportoptionsgenerator.go b/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/exportoptionsgenerator.go index 32ff1828..22d93268 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/exportoptionsgenerator.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/exportoptionsgenerator.go @@ -68,7 +68,7 @@ func (g ExportOptionsGenerator) GenerateApplicationExportOptions( return nil, err } - exportOpts := generateBaseExportOptions(exportMethod, uploadBitcode, compileBitcode, iCloudContainerEnvironment) + exportOpts := generateBaseExportOptions(exportMethod, xcodeMajorVersion, uploadBitcode, compileBitcode, iCloudContainerEnvironment) if xcodeMajorVersion >= 12 { exportOpts = addDistributionBundleIdentifierFromXcode12(exportOpts, mainTargetBundleID) @@ -332,9 +332,13 @@ func projectUsesCloudKit(bundleIDEntitlementsMap map[string]plistutil.PlistData) } // generateBaseExportOptions creates a default exportOptions introduced in Xcode 7. -func generateBaseExportOptions(exportMethod exportoptions.Method, cfgUploadBitcode, cfgCompileBitcode bool, iCloudContainerEnvironment string) exportoptions.ExportOptions { - if exportMethod == exportoptions.MethodAppStore { - appStoreOptions := exportoptions.NewAppStoreOptions() +func generateBaseExportOptions(exportMethod exportoptions.Method, xcodeMajorVersion int64, cfgUploadBitcode, cfgCompileBitcode bool, iCloudContainerEnvironment string) exportoptions.ExportOptions { + if xcodeMajorVersion >= 16 { + exportMethod = exportoptions.UpgradeExportMethod(exportMethod) + } + + if exportMethod.IsAppStore() { + appStoreOptions := exportoptions.NewAppStoreConnectOptions(exportMethod) appStoreOptions.UploadBitcode = cfgUploadBitcode if iCloudContainerEnvironment != "" { appStoreOptions.ICloudContainerEnvironment = exportoptions.ICloudContainerEnvironment(iCloudContainerEnvironment) diff --git a/vendor/modules.txt b/vendor/modules.txt index 1db21fbb..673d22e9 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -40,7 +40,7 @@ github.com/bitrise-io/go-utils/v2/log github.com/bitrise-io/go-utils/v2/log/colorstring github.com/bitrise-io/go-utils/v2/pathutil github.com/bitrise-io/go-utils/v2/retryhttp -# github.com/bitrise-io/go-xcode v1.2.0 +# github.com/bitrise-io/go-xcode v1.2.1-0.20250407100337-8b18b3fc5b8d ## explicit; go 1.20 github.com/bitrise-io/go-xcode/certificateutil github.com/bitrise-io/go-xcode/export @@ -57,7 +57,7 @@ github.com/bitrise-io/go-xcode/xcodeproject/serialized github.com/bitrise-io/go-xcode/xcodeproject/xcodeproj github.com/bitrise-io/go-xcode/xcodeproject/xcscheme github.com/bitrise-io/go-xcode/xcodeproject/xcworkspace -# github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.54 +# github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.54.0.20250407101546-6284334f9994 ## explicit; go 1.22 github.com/bitrise-io/go-xcode/v2/autocodesign github.com/bitrise-io/go-xcode/v2/autocodesign/certdownloader From 5ed1595bf5047d732c5d9f23a598d78688838412 Mon Sep 17 00:00:00 2001 From: LaszloP <7979773+lpusok@users.noreply.github.com> Date: Tue, 8 Apr 2025 11:26:16 +0200 Subject: [PATCH 02/11] Use v2 XcodeVersionReaeder --- go.mod | 4 +- go.sum | 8 +-- main.go | 8 ++- mocks/XcodeVersionReader.go | 55 +++++++++++++++++++ step/step.go | 40 +++++++------- step/step_test.go | 5 +- step/xcode_version_provider.go | 22 -------- .../bitrise-io/go-xcode/export/mac.go | 2 +- .../exportoptions/appstore_options.go | 8 +-- .../go-xcode/exportoptions/properties.go | 8 +-- .../exportoptionsgenerator.go | 40 ++++++++------ .../v2/exportoptionsgenerator/targets.go | 3 +- .../go-xcode/v2/xcodeversion/utility.go | 45 +++++++++++++++ .../go-xcode/v2/xcodeversion/xcodeversion.go | 54 ++++++++++++++++++ vendor/modules.txt | 5 +- 15 files changed, 222 insertions(+), 85 deletions(-) create mode 100644 mocks/XcodeVersionReader.go delete mode 100644 step/xcode_version_provider.go create mode 100644 vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/utility.go create mode 100644 vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/xcodeversion.go diff --git a/go.mod b/go.mod index 04498ab5..7d3f1224 100644 --- a/go.mod +++ b/go.mod @@ -8,8 +8,8 @@ require ( github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.23 github.com/bitrise-io/go-utils v1.0.12 github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.23 - github.com/bitrise-io/go-xcode v1.2.1-0.20250407100337-8b18b3fc5b8d - github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.54.0.20250407101546-6284334f9994 + github.com/bitrise-io/go-xcode v1.3.0 + github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.54.0.20250408090343-29b4bb8f70c5 github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 github.com/stretchr/testify v1.10.0 gopkg.in/yaml.v3 v3.0.1 diff --git a/go.sum b/go.sum index 6d88b26a..72ff1663 100644 --- a/go.sum +++ b/go.sum @@ -11,10 +11,10 @@ github.com/bitrise-io/go-utils v1.0.12 h1:iJV1ZpyvSA0NCte/N6x+aIQ9TrNr5sIBlcJBf0 github.com/bitrise-io/go-utils v1.0.12/go.mod h1:ZY1DI+fEpZuFpO9szgDeICM4QbqoWVt0RSY3tRI1heY= github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.23 h1:Dfh4nyZPuEtilBisidejqxBrkx9cWvbOUrpq8VEION0= github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.23/go.mod h1:3XUplo0dOWc3DqT2XA2SeHToDSg7+j1y1HTHibT2H68= -github.com/bitrise-io/go-xcode v1.2.1-0.20250407100337-8b18b3fc5b8d h1:etvh09pPVy95jyGIRWwyL6oMn7i26IexIO91glHleJA= -github.com/bitrise-io/go-xcode v1.2.1-0.20250407100337-8b18b3fc5b8d/go.mod h1:9OwsvrhZ4A2JxHVoEY7CPcABAKA+OE7FQqFfBfvbFuY= -github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.54.0.20250407101546-6284334f9994 h1:IhKW6iBAzuTIDivkY3qp1Xxg06SvCbK2bdcBvpJEGuY= -github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.54.0.20250407101546-6284334f9994/go.mod h1:7c9QVlPJuv323WGVPc4Y/BuTQhnKwxEMbb2CrJ86xUM= +github.com/bitrise-io/go-xcode v1.3.0 h1:QB8Vyr2oZQro/ocs9DJai80rlYL1hU1kwjHqdGslFLo= +github.com/bitrise-io/go-xcode v1.3.0/go.mod h1:9OwsvrhZ4A2JxHVoEY7CPcABAKA+OE7FQqFfBfvbFuY= +github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.54.0.20250408090343-29b4bb8f70c5 h1:C5cF3Id0nhmZWOSSii1y63I/NHHT+QLDUsSWC/fQWLE= +github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.54.0.20250408090343-29b4bb8f70c5/go.mod h1:zoLzT5fJE8V2SeYq0D0Z+ZN2FAzERjV3uiqDg5H8Bug= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= diff --git a/main.go b/main.go index 20e794e1..f8dc2952 100644 --- a/main.go +++ b/main.go @@ -13,6 +13,7 @@ import ( "github.com/bitrise-io/go-utils/v2/log" "github.com/bitrise-io/go-utils/v2/pathutil" "github.com/bitrise-io/go-xcode/v2/xcodecommand" + "github.com/bitrise-io/go-xcode/v2/xcodeversion" "github.com/bitrise-steplib/steps-xcode-archive/step" ) @@ -58,11 +59,11 @@ func run() int { func createConfigParser(logger log.Logger) step.XcodebuildArchiveConfigParser { envRepository := env.NewRepository() inputParser := stepconf.NewInputParser(envRepository) - xcodeVersionProvider := step.NewXcodebuildXcodeVersionProvider() fileManager := fileutil.NewFileManager() cmdFactory := command.NewFactory(envRepository) + xcodeVersionReader := xcodeversion.NewXcodeVersionProvider(cmdFactory) - return step.NewXcodeArchiveConfigParser(inputParser, xcodeVersionProvider, fileManager, cmdFactory, logger) + return step.NewXcodeArchiveConfigParser(inputParser, xcodeVersionReader, fileManager, cmdFactory, logger) } func createXcodebuildArchiver(logger log.Logger, logFormatter string) (step.XcodebuildArchiver, error) { @@ -72,6 +73,7 @@ func createXcodebuildArchiver(logger log.Logger, logFormatter string) (step.Xcod pathModifier := pathutil.NewPathModifier() fileManager := fileutil.NewFileManager() cmdFactory := command.NewFactory(envRepository) + xcodeVersionReader := xcodeversion.NewXcodeVersionProvider(cmdFactory) xcodeCommandRunner := xcodecommand.Runner(nil) switch logFormatter { @@ -92,7 +94,7 @@ func createXcodebuildArchiver(logger log.Logger, logFormatter string) (step.Xcod panic(fmt.Sprintf("Unknown log formatter: %s", logFormatter)) } - return step.NewXcodebuildArchiver(xcodeCommandRunner, logFormatter, pathProvider, pathChecker, pathModifier, fileManager, cmdFactory, logger), nil + return step.NewXcodebuildArchiver(xcodeCommandRunner, logFormatter, xcodeVersionReader, pathProvider, pathChecker, pathModifier, fileManager, cmdFactory, logger), nil } func createRunOptions(config step.Config) step.RunOpts { diff --git a/mocks/XcodeVersionReader.go b/mocks/XcodeVersionReader.go new file mode 100644 index 00000000..156c0970 --- /dev/null +++ b/mocks/XcodeVersionReader.go @@ -0,0 +1,55 @@ +// Code generated by mockery v2.53.3. DO NOT EDIT. + +package mocks + +import ( + xcodeversion "github.com/bitrise-io/go-xcode/v2/xcodeversion" + mock "github.com/stretchr/testify/mock" +) + +// Reader is an autogenerated mock type for the Reader type +type Reader struct { + mock.Mock +} + +// GetVersion provides a mock function with no fields +func (_m *Reader) GetVersion() (xcodeversion.Version, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetVersion") + } + + var r0 xcodeversion.Version + var r1 error + if rf, ok := ret.Get(0).(func() (xcodeversion.Version, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() xcodeversion.Version); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(xcodeversion.Version) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NewXcodeVersionReader creates a new instance of Reader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewXcodeVersionReader(t interface { + mock.TestingT + Cleanup(func()) +}) *Reader { + mock := &Reader{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/step/step.go b/step/step.go index a6783c93..7e20f940 100644 --- a/step/step.go +++ b/step/step.go @@ -32,6 +32,7 @@ import ( "github.com/bitrise-io/go-xcode/v2/xcconfig" cache "github.com/bitrise-io/go-xcode/v2/xcodecache" "github.com/bitrise-io/go-xcode/v2/xcodecommand" + "github.com/bitrise-io/go-xcode/v2/xcodeversion" "github.com/bitrise-io/go-xcode/xcarchive" "github.com/bitrise-io/go-xcode/xcodebuild" "github.com/kballard/go-shellquote" @@ -134,17 +135,18 @@ type Config struct { } type XcodebuildArchiveConfigParser struct { - stepInputParser stepconf.InputParser - xcodeVersionProvider XcodeVersionProvider - fileManager fileutil.FileManager - cmdFactory command.Factory - logger log.Logger + stepInputParser stepconf.InputParser + xcodeVersionReader xcodeversion.Reader + fileManager fileutil.FileManager + cmdFactory command.Factory + logger log.Logger } // XcodebuildArchiver ... type XcodebuildArchiver struct { xcodeCommandRunner xcodecommand.Runner logFormatter string + xcodeVersionReader xcodeversion.Reader pathProvider pathutil.PathProvider pathChecker pathutil.PathChecker pathModifier pathutil.PathModifier @@ -153,21 +155,22 @@ type XcodebuildArchiver struct { cmdFactory command.Factory } -func NewXcodeArchiveConfigParser(stepInputParser stepconf.InputParser, xcodeVersionProvider XcodeVersionProvider, fileManager fileutil.FileManager, cmdFactory command.Factory, logger log.Logger) XcodebuildArchiveConfigParser { +func NewXcodeArchiveConfigParser(stepInputParser stepconf.InputParser, xcodeVersionReader xcodeversion.Reader, fileManager fileutil.FileManager, cmdFactory command.Factory, logger log.Logger) XcodebuildArchiveConfigParser { return XcodebuildArchiveConfigParser{ - stepInputParser: stepInputParser, - xcodeVersionProvider: xcodeVersionProvider, - fileManager: fileManager, - cmdFactory: cmdFactory, - logger: logger, + stepInputParser: stepInputParser, + xcodeVersionReader: xcodeVersionReader, + fileManager: fileManager, + cmdFactory: cmdFactory, + logger: logger, } } // NewXcodebuildArchiver ... -func NewXcodebuildArchiver(xcodecommandRunner xcodecommand.Runner, logFormatter string, pathProvider pathutil.PathProvider, pathChecker pathutil.PathChecker, pathModifier pathutil.PathModifier, fileManager fileutil.FileManager, cmdFactory command.Factory, logger log.Logger) XcodebuildArchiver { +func NewXcodebuildArchiver(xcodecommandRunner xcodecommand.Runner, logFormatter string, xcodeVersionReader xcodeversion.Reader, pathProvider pathutil.PathProvider, pathChecker pathutil.PathChecker, pathModifier pathutil.PathModifier, fileManager fileutil.FileManager, cmdFactory command.Factory, logger log.Logger) XcodebuildArchiver { return XcodebuildArchiver{ xcodeCommandRunner: xcodecommandRunner, logFormatter: logFormatter, + xcodeVersionReader: xcodeVersionReader, pathProvider: pathProvider, pathChecker: pathChecker, pathModifier: pathModifier, @@ -222,17 +225,16 @@ func (s XcodebuildArchiveConfigParser) ProcessInputs() (Config, error) { s.logger.Infof("Xcode version:") // Detect Xcode major version - xcodebuildVersion, err := s.xcodeVersionProvider.GetXcodeVersion() + xcodebuildVersion, err := s.xcodeVersionReader.GetVersion() if err != nil { return Config{}, fmt.Errorf("failed to determine xcode version, error: %s", err) } s.logger.Printf("%s (%s)", xcodebuildVersion.Version, xcodebuildVersion.BuildVersion) - xcodeMajorVersion := xcodebuildVersion.MajorVersion - if xcodeMajorVersion < minSupportedXcodeMajorVersion { - return Config{}, fmt.Errorf("invalid xcode major version (%d), should not be less then min supported: %d", xcodeMajorVersion, minSupportedXcodeMajorVersion) + if xcodebuildVersion.Major < minSupportedXcodeMajorVersion { + return Config{}, fmt.Errorf("invalid xcode major version (%d), should not be less then min supported: %d", xcodebuildVersion.Major, minSupportedXcodeMajorVersion) } - config.XcodeMajorVersion = int(xcodeMajorVersion) + config.XcodeMajorVersion = int(xcodebuildVersion.Major) // Validation ExportOptionsPlistContent exportOptionsPlistContent := strings.TrimSpace(config.ExportOptionsPlistContent) @@ -1003,9 +1005,9 @@ func (s XcodebuildArchiver) xcodeIPAExport(opts xcodeIPAExportOpts) (xcodeIPAExp signingStyle = exportoptions.SigningStyleAutomatic } - generator := exportoptionsgenerator.New(xcodeProj, scheme, configuration, s.logger) + generator := exportoptionsgenerator.New(xcodeProj, scheme, configuration, s.xcodeVersionReader, s.logger) exportOptions, err := generator.GenerateApplicationExportOptions(exportMethod, opts.ICloudContainerEnvironment, opts.ExportDevelopmentTeam, - opts.UploadBitcode, opts.CompileBitcode, archiveCodeSignIsXcodeManaged, signingStyle, int64(opts.XcodeMajorVersion), opts.TestFlightInternalTestingOnly) + opts.UploadBitcode, opts.CompileBitcode, archiveCodeSignIsXcodeManaged, signingStyle, opts.TestFlightInternalTestingOnly) if err != nil { return out, err } diff --git a/step/step_test.go b/step/step_test.go index dae0b7d0..1659f1ac 100644 --- a/step/step_test.go +++ b/step/step_test.go @@ -36,9 +36,8 @@ func TestXcodeArchiveStep_ProcessInputs(t *testing.T) { t.Run(tt.name, func(t *testing.T) { envRepository := MockEnvRepository{envs: tt.envs} s := XcodebuildArchiveConfigParser{ - xcodeVersionProvider: NewMockXcodeVersionProvider(models.XcodebuildVersionModel{MajorVersion: 11}), - stepInputParser: stepconf.NewInputParser(envRepository), - logger: log.NewLogger(), + stepInputParser: stepconf.NewInputParser(envRepository), + logger: log.NewLogger(), } config, err := s.ProcessInputs() diff --git a/step/xcode_version_provider.go b/step/xcode_version_provider.go deleted file mode 100644 index dd0c65dd..00000000 --- a/step/xcode_version_provider.go +++ /dev/null @@ -1,22 +0,0 @@ -package step - -import ( - "github.com/bitrise-io/go-xcode/models" - "github.com/bitrise-io/go-xcode/utility" -) - -type XcodeVersionProvider interface { - GetXcodeVersion() (models.XcodebuildVersionModel, error) -} - -type xcodebuildXcodeVersionProvider struct { -} - -func NewXcodebuildXcodeVersionProvider() XcodeVersionProvider { - return xcodebuildXcodeVersionProvider{} -} - -// GetXcodeVersion ... -func (p xcodebuildXcodeVersionProvider) GetXcodeVersion() (models.XcodebuildVersionModel, error) { - return utility.GetXcodeVersion() -} diff --git a/vendor/github.com/bitrise-io/go-xcode/export/mac.go b/vendor/github.com/bitrise-io/go-xcode/export/mac.go index 1706d76d..e3fcd42d 100644 --- a/vendor/github.com/bitrise-io/go-xcode/export/mac.go +++ b/vendor/github.com/bitrise-io/go-xcode/export/mac.go @@ -44,7 +44,7 @@ func CreateMacCodeSignGroup(selectableGroups []SelectableCodeSignGroup, installe iosCodesignGroups := CreateIosCodeSignGroups(selectableGroups) for _, group := range iosCodesignGroups { - if exportMethod == exportoptions.MethodAppStore { + if exportMethod.IsAppStore() { installerCertificates := []certificateutil.CertificateInfoModel{} for _, installerCertificate := range installedInstallerCertificates { diff --git a/vendor/github.com/bitrise-io/go-xcode/exportoptions/appstore_options.go b/vendor/github.com/bitrise-io/go-xcode/exportoptions/appstore_options.go index 99fc38b1..94ecda26 100644 --- a/vendor/github.com/bitrise-io/go-xcode/exportoptions/appstore_options.go +++ b/vendor/github.com/bitrise-io/go-xcode/exportoptions/appstore_options.go @@ -30,13 +30,7 @@ type AppStoreOptionsModel struct { // NewAppStoreOptions sets "app-store" as the export method // deprecated: use NewAppStoreConnectOptions instead func NewAppStoreOptions() AppStoreOptionsModel { - return AppStoreOptionsModel{ - Method: MethodAppStore, - UploadBitcode: UploadBitcodeDefault, - UploadSymbols: UploadSymbolsDefault, - ManageAppVersion: manageAppVersionDefault, - TestFlightInternalTestingOnly: TestFlightInternalTestingOnlyDefault, - } + return NewAppStoreConnectOptions(MethodAppStore) } // NewAppStoreConnectOptions sets either "app-store" or "app-store-connect" as the export method diff --git a/vendor/github.com/bitrise-io/go-xcode/exportoptions/properties.go b/vendor/github.com/bitrise-io/go-xcode/exportoptions/properties.go index b8cb9317..86aaa72c 100644 --- a/vendor/github.com/bitrise-io/go-xcode/exportoptions/properties.go +++ b/vendor/github.com/bitrise-io/go-xcode/exportoptions/properties.go @@ -141,8 +141,8 @@ func ParseMethod(method string) (Method, error) { } } -// UpgradeExportMethod replaces the legacy export method strings with the ones available in Xcode 15.3 and later. -func UpgradeExportMethod(method Method) Method { +// UpgradeToXcode15_3MethodName replaces the legacy export method strings with the ones available in Xcode 15.3 and later. +func UpgradeToXcode15_3MethodName(method Method) Method { switch method { case MethodAppStore: return MethodAppStoreConnect @@ -150,9 +150,9 @@ func UpgradeExportMethod(method Method) Method { return MethodReleaseTesting case MethodDevelopment: return MethodDebugging + default: + return method } - - return method } // OnDemandResourcesAssetPacksBaseURLKey .... diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/exportoptionsgenerator.go b/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/exportoptionsgenerator.go index 22d93268..312fbb6b 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/exportoptionsgenerator.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/exportoptionsgenerator.go @@ -10,6 +10,7 @@ import ( "github.com/bitrise-io/go-xcode/exportoptions" "github.com/bitrise-io/go-xcode/plistutil" "github.com/bitrise-io/go-xcode/profileutil" + "github.com/bitrise-io/go-xcode/v2/xcodeversion" "github.com/bitrise-io/go-xcode/xcodeproject/serialized" "github.com/bitrise-io/go-xcode/xcodeproject/xcodeproj" "github.com/bitrise-io/go-xcode/xcodeproject/xcscheme" @@ -26,6 +27,7 @@ type ExportOptionsGenerator struct { scheme *xcscheme.Scheme configuration string + xcodeVersionReader xcodeversion.Reader certificateProvider CodesignIdentityProvider profileProvider ProvisioningProfileProvider targetInfoProvider TargetInfoProvider @@ -33,11 +35,12 @@ type ExportOptionsGenerator struct { } // New constructs a new ExportOptionsGenerator. -func New(xcodeProj *xcodeproj.XcodeProj, scheme *xcscheme.Scheme, configuration string, logger log.Logger) ExportOptionsGenerator { +func New(xcodeProj *xcodeproj.XcodeProj, scheme *xcscheme.Scheme, configuration string, xcodeVersionReader xcodeversion.Reader, logger log.Logger) ExportOptionsGenerator { g := ExportOptionsGenerator{ - xcodeProj: xcodeProj, - scheme: scheme, - configuration: configuration, + xcodeProj: xcodeProj, + scheme: scheme, + configuration: configuration, + xcodeVersionReader: xcodeVersionReader, } g.certificateProvider = LocalCodesignIdentityProvider{} g.profileProvider = LocalProvisioningProfileProvider{} @@ -55,26 +58,33 @@ func (g ExportOptionsGenerator) GenerateApplicationExportOptions( compileBitcode bool, archivedWithXcodeManagedProfiles bool, codeSigningStyle exportoptions.SigningStyle, - xcodeMajorVersion int64, testFlightInternalTestingOnly bool, ) (exportoptions.ExportOptions, error) { + xcodeVersion, err := g.xcodeVersionReader.GetVersion() + if err != nil { + return nil, fmt.Errorf("failed to get Xcode version: %w", err) + } + mainTargetBundleID, entitlementsByBundleID, err := g.applicationTargetsAndEntitlements(exportMethod) if err != nil { return nil, err } - iCloudContainerEnvironment, err := determineIcloudContainerEnvironment(containerEnvironment, entitlementsByBundleID, exportMethod, xcodeMajorVersion) + iCloudContainerEnvironment, err := determineIcloudContainerEnvironment(containerEnvironment, entitlementsByBundleID, exportMethod, xcodeVersion.Major) if err != nil { return nil, err } - exportOpts := generateBaseExportOptions(exportMethod, xcodeMajorVersion, uploadBitcode, compileBitcode, iCloudContainerEnvironment) + if xcodeVersion.IsGreaterThanOrEqualTo(15, 3) { + exportMethod = exportoptions.UpgradeToXcode15_3MethodName(exportMethod) + } + exportOpts := generateBaseExportOptions(exportMethod, uploadBitcode, compileBitcode, iCloudContainerEnvironment) - if xcodeMajorVersion >= 12 { + if xcodeVersion.Major >= 12 { exportOpts = addDistributionBundleIdentifierFromXcode12(exportOpts, mainTargetBundleID) } - if xcodeMajorVersion >= 13 { + if xcodeVersion.Major >= 13 { exportOpts = disableManagedBuildNumberFromXcode13(exportOpts) } @@ -92,7 +102,7 @@ func (g ExportOptionsGenerator) GenerateApplicationExportOptions( exportOpts = addManualSigningFields(exportOpts, codeSignGroup, archivedWithXcodeManagedProfiles, g.logger) } - if xcodeMajorVersion >= 15 { + if xcodeVersion.Major >= 15 { if testFlightInternalTestingOnly { exportOpts = addTestFlightInternalTestingOnly(exportOpts, testFlightInternalTestingOnly) } @@ -292,11 +302,11 @@ func determineIcloudContainerEnvironment(desiredIcloudContainerEnvironment strin } // From Xcode 9 iCloudContainerEnvironment is required for every export method, before that version only for non app-store exports. - if xcodeMajorVersion < 9 && exportMethod == exportoptions.MethodAppStore { + if xcodeMajorVersion < 9 && exportMethod.IsAppStore() { return "", nil } - if exportMethod == exportoptions.MethodAppStore { + if exportMethod.IsAppStore() { return "Production", nil } @@ -332,11 +342,7 @@ func projectUsesCloudKit(bundleIDEntitlementsMap map[string]plistutil.PlistData) } // generateBaseExportOptions creates a default exportOptions introduced in Xcode 7. -func generateBaseExportOptions(exportMethod exportoptions.Method, xcodeMajorVersion int64, cfgUploadBitcode, cfgCompileBitcode bool, iCloudContainerEnvironment string) exportoptions.ExportOptions { - if xcodeMajorVersion >= 16 { - exportMethod = exportoptions.UpgradeExportMethod(exportMethod) - } - +func generateBaseExportOptions(exportMethod exportoptions.Method, cfgUploadBitcode, cfgCompileBitcode bool, iCloudContainerEnvironment string) exportoptions.ExportOptions { if exportMethod.IsAppStore() { appStoreOptions := exportoptions.NewAppStoreConnectOptions(exportMethod) appStoreOptions.UploadBitcode = cfgUploadBitcode diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/targets.go b/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/targets.go index fa2d9042..b503f9a5 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/targets.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/targets.go @@ -2,6 +2,7 @@ package exportoptionsgenerator import ( "fmt" + "github.com/bitrise-io/go-xcode/exportoptions" "github.com/bitrise-io/go-xcode/xcodeproject/serialized" "github.com/bitrise-io/go-xcode/xcodeproject/xcodeproj" @@ -62,7 +63,7 @@ func filterApplicationBundleTargets(targets []xcodeproj.Target, exportMethod exp // Development App Clip Profile // // .., - if exportMethod != exportoptions.MethodAppStore && target.IsAppClipProduct() { + if !exportMethod.IsAppStore() && target.IsAppClipProduct() { continue } diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/utility.go b/vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/utility.go new file mode 100644 index 00000000..c58ff7c1 --- /dev/null +++ b/vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/utility.go @@ -0,0 +1,45 @@ +package xcodeversion + +import ( + "fmt" + "regexp" + "strconv" +) + +func getXcodeVersionFromXcodebuildOutput(outStr string) (Version, error) { + versionRegexp := regexp.MustCompile(`(?m)^Xcode.* (\d+)(\.(\d+))?.*$`) + buildVersionRegexp := regexp.MustCompile(`(?m)^Build version.* (\w.*)$`) + + xcodeVersionMatch := versionRegexp.FindStringSubmatch(outStr) + if len(xcodeVersionMatch) < 4 { + return Version{}, fmt.Errorf("couldn't find Xcode version in output: (%s)", outStr) + } + + xcodebuildVersion := xcodeVersionMatch[0] + majorVersionStr := xcodeVersionMatch[1] + majorVersion, err := strconv.Atoi(majorVersionStr) + if err != nil { + return Version{}, fmt.Errorf("failed to parse xcodebuild major version (output %s): %w", outStr, err) + } + + minorVersion := int(0) + minorVersionStr := xcodeVersionMatch[3] + if minorVersionStr != "" { + if minorVersion, err = strconv.Atoi(minorVersionStr); err != nil { + return Version{}, fmt.Errorf("failed to parse xcodebuild minor version (output %s): %w", outStr, err) + } + } + + buildVersionMatch := buildVersionRegexp.FindStringSubmatch(outStr) + buildVersion := "unknown" + if len(buildVersionMatch) >= 2 { + buildVersion = buildVersionMatch[1] + } + + return Version{ + Version: xcodebuildVersion, + BuildVersion: buildVersion, + Major: int64(majorVersion), + Minor: int64(minorVersion), + }, nil +} diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/xcodeversion.go b/vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/xcodeversion.go new file mode 100644 index 00000000..aef6d33f --- /dev/null +++ b/vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/xcodeversion.go @@ -0,0 +1,54 @@ +package xcodeversion + +import ( + "fmt" + + "github.com/bitrise-io/go-utils/v2/command" +) + +// Version ... +type Version struct { + Version string + BuildVersion string + Major int64 + Minor int64 +} + +// Reader ... +type Reader interface { + GetVersion() (Version, error) +} + +type reader struct { + commandFactory command.Factory +} + +// NewXcodeVersionProvider ... +func NewXcodeVersionProvider(commandFactory command.Factory) Reader { + return &reader{ + commandFactory: commandFactory, + } +} + +// GetVersion ... +func (b *reader) GetVersion() (Version, error) { + cmd := b.commandFactory.Create("xcodebuild", []string{"-version"}, &command.Opts{}) + + outStr, err := cmd.RunAndReturnTrimmedOutput() + if err != nil { + return Version{}, fmt.Errorf("xcodebuild -version failed: %s, output: %s", err, outStr) + } + + return getXcodeVersionFromXcodebuildOutput(outStr) +} + +// IsGreaterThanOrEqualTo checks if the Xcode version is greater than or equal to the given major and minor version. +func (v Version) IsGreaterThanOrEqualTo(major, minor int64) bool { + if v.Major > major { + return true + } + if v.Major == major && v.Minor >= minor { + return true + } + return false +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 673d22e9..58a9d3fc 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -40,7 +40,7 @@ github.com/bitrise-io/go-utils/v2/log github.com/bitrise-io/go-utils/v2/log/colorstring github.com/bitrise-io/go-utils/v2/pathutil github.com/bitrise-io/go-utils/v2/retryhttp -# github.com/bitrise-io/go-xcode v1.2.1-0.20250407100337-8b18b3fc5b8d +# github.com/bitrise-io/go-xcode v1.3.0 ## explicit; go 1.20 github.com/bitrise-io/go-xcode/certificateutil github.com/bitrise-io/go-xcode/export @@ -57,7 +57,7 @@ github.com/bitrise-io/go-xcode/xcodeproject/serialized github.com/bitrise-io/go-xcode/xcodeproject/xcodeproj github.com/bitrise-io/go-xcode/xcodeproject/xcscheme github.com/bitrise-io/go-xcode/xcodeproject/xcworkspace -# github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.54.0.20250407101546-6284334f9994 +# github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.54.0.20250408090343-29b4bb8f70c5 ## explicit; go 1.22 github.com/bitrise-io/go-xcode/v2/autocodesign github.com/bitrise-io/go-xcode/v2/autocodesign/certdownloader @@ -79,6 +79,7 @@ github.com/bitrise-io/go-xcode/v2/xcarchive github.com/bitrise-io/go-xcode/v2/xcconfig github.com/bitrise-io/go-xcode/v2/xcodecache github.com/bitrise-io/go-xcode/v2/xcodecommand +github.com/bitrise-io/go-xcode/v2/xcodeversion # github.com/davecgh/go-spew v1.1.1 ## explicit github.com/davecgh/go-spew/spew From e295766948f035c676cc8522faf1d3c9d3ec7961 Mon Sep 17 00:00:00 2001 From: LaszloP <7979773+lpusok@users.noreply.github.com> Date: Tue, 8 Apr 2025 11:35:13 +0200 Subject: [PATCH 03/11] Updated description --- README.md | 2 +- step.yml | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 40d2219a..4ee75d17 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ Build a development IPA with custom xcconfig file path: | --- | --- | --- | --- | | `project_path` | Xcode Project (`.xcodeproj`) or Workspace (`.xcworkspace`) path. The input value sets xcodebuild's `-project` or `-workspace` option. | required | `$BITRISE_PROJECT_PATH` | | `scheme` | Xcode Scheme name. The input value sets xcodebuild's `-scheme` option. | required | `$BITRISE_SCHEME` | -| `distribution_method` | Describes how Xcode should export the archive. | required | `development` | +| `distribution_method` | Describes how Xcode should export the archive. The input value sets the method in the export options plist content. From Xcode 15.3 onwards, updated methods are used: - `debugging`, when `development` is selected - `app-store-connect`, when `app-store` is selected - `release-testing`, when `ad-hoc` is selected - `enterprise` is unchanged | required | `development` | | `configuration` | Xcode Build Configuration. If not specified, the default Build Configuration will be used. The input value sets xcodebuild's `-configuration` option. | | | | `xcconfig_content` | Build settings to override the project's build settings, using xcodebuild's `-xcconfig` option. You can't define `-xcconfig` option in `Additional options for the xcodebuild command` if this input is set. If empty, no setting is changed. When set it can be either: 1. Existing `.xcconfig` file path. Example: `./ios-sample/ios-sample/Configurations/Dev.xcconfig` 2. The contents of a newly created temporary `.xcconfig` file. (This is the default.) Build settings must be separated by newline character (`\n`). Example: ``` COMPILER_INDEX_STORE_ENABLE = NO ONLY_ACTIVE_ARCH[config=Debug][sdk=*][arch=*] = YES ``` | | `COMPILER_INDEX_STORE_ENABLE = NO` | | `perform_clean_action` | If this input is set, `clean` xcodebuild action will be performed besides the `archive` action. | required | `no` | diff --git a/step.yml b/step.yml index d909f397..8cd9b77b 100644 --- a/step.yml +++ b/step.yml @@ -94,6 +94,16 @@ inputs: opts: title: Distribution method summary: Describes how Xcode should export the archive. + description: |- + Describes how Xcode should export the archive. + + The input value sets the method in the export options plist content. + + From Xcode 15.3 onwards, updated methods are used: + - `debugging`, when `development` is selected + - `app-store-connect`, when `app-store` is selected + - `release-testing`, when `ad-hoc` is selected + - `enterprise` is unchanged value_options: - development - app-store From 23e06b690ffe65637f3ef480b18dae0004259613 Mon Sep 17 00:00:00 2001 From: LaszloP <7979773+lpusok@users.noreply.github.com> Date: Tue, 8 Apr 2025 12:50:44 +0200 Subject: [PATCH 04/11] update dep --- go.mod | 2 +- go.sum | 4 ++-- .../exportoptionsgenerator/exportoptionsgenerator.go | 11 ++++++----- vendor/modules.txt | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 7d3f1224..2dbcd621 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/bitrise-io/go-utils v1.0.12 github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.23 github.com/bitrise-io/go-xcode v1.3.0 - github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.54.0.20250408090343-29b4bb8f70c5 + github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.54.0.20250408104939-27c790ba5555 github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 github.com/stretchr/testify v1.10.0 gopkg.in/yaml.v3 v3.0.1 diff --git a/go.sum b/go.sum index 72ff1663..97f9343a 100644 --- a/go.sum +++ b/go.sum @@ -13,8 +13,8 @@ github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.23 h1:Dfh4nyZPuEtilBisidejqxBrkx9 github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.23/go.mod h1:3XUplo0dOWc3DqT2XA2SeHToDSg7+j1y1HTHibT2H68= github.com/bitrise-io/go-xcode v1.3.0 h1:QB8Vyr2oZQro/ocs9DJai80rlYL1hU1kwjHqdGslFLo= github.com/bitrise-io/go-xcode v1.3.0/go.mod h1:9OwsvrhZ4A2JxHVoEY7CPcABAKA+OE7FQqFfBfvbFuY= -github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.54.0.20250408090343-29b4bb8f70c5 h1:C5cF3Id0nhmZWOSSii1y63I/NHHT+QLDUsSWC/fQWLE= -github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.54.0.20250408090343-29b4bb8f70c5/go.mod h1:zoLzT5fJE8V2SeYq0D0Z+ZN2FAzERjV3uiqDg5H8Bug= +github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.54.0.20250408104939-27c790ba5555 h1:O5u4CkafY9pOXKSoWNMoZmLGml5yVTiBuXnhZYvThAQ= +github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.54.0.20250408104939-27c790ba5555/go.mod h1:zoLzT5fJE8V2SeYq0D0Z+ZN2FAzERjV3uiqDg5H8Bug= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/exportoptionsgenerator.go b/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/exportoptionsgenerator.go index 312fbb6b..6eff3b9c 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/exportoptionsgenerator.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/exportoptionsgenerator.go @@ -75,10 +75,7 @@ func (g ExportOptionsGenerator) GenerateApplicationExportOptions( return nil, err } - if xcodeVersion.IsGreaterThanOrEqualTo(15, 3) { - exportMethod = exportoptions.UpgradeToXcode15_3MethodName(exportMethod) - } - exportOpts := generateBaseExportOptions(exportMethod, uploadBitcode, compileBitcode, iCloudContainerEnvironment) + exportOpts := generateBaseExportOptions(exportMethod, xcodeVersion, uploadBitcode, compileBitcode, iCloudContainerEnvironment) if xcodeVersion.Major >= 12 { exportOpts = addDistributionBundleIdentifierFromXcode12(exportOpts, mainTargetBundleID) @@ -342,7 +339,11 @@ func projectUsesCloudKit(bundleIDEntitlementsMap map[string]plistutil.PlistData) } // generateBaseExportOptions creates a default exportOptions introduced in Xcode 7. -func generateBaseExportOptions(exportMethod exportoptions.Method, cfgUploadBitcode, cfgCompileBitcode bool, iCloudContainerEnvironment string) exportoptions.ExportOptions { +func generateBaseExportOptions(exportMethod exportoptions.Method, xcodeVersion xcodeversion.Version, cfgUploadBitcode, cfgCompileBitcode bool, iCloudContainerEnvironment string) exportoptions.ExportOptions { + if xcodeVersion.IsGreaterThanOrEqualTo(15, 3) { + exportMethod = exportoptions.UpgradeToXcode15_3MethodName(exportMethod) + } + if exportMethod.IsAppStore() { appStoreOptions := exportoptions.NewAppStoreConnectOptions(exportMethod) appStoreOptions.UploadBitcode = cfgUploadBitcode diff --git a/vendor/modules.txt b/vendor/modules.txt index 58a9d3fc..59fa3d32 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -57,7 +57,7 @@ github.com/bitrise-io/go-xcode/xcodeproject/serialized github.com/bitrise-io/go-xcode/xcodeproject/xcodeproj github.com/bitrise-io/go-xcode/xcodeproject/xcscheme github.com/bitrise-io/go-xcode/xcodeproject/xcworkspace -# github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.54.0.20250408090343-29b4bb8f70c5 +# github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.54.0.20250408104939-27c790ba5555 ## explicit; go 1.22 github.com/bitrise-io/go-xcode/v2/autocodesign github.com/bitrise-io/go-xcode/v2/autocodesign/certdownloader From d3bdeeda9f4e270514d75f35d1e0b1297c00efd3 Mon Sep 17 00:00:00 2001 From: LaszloP <7979773+lpusok@users.noreply.github.com> Date: Tue, 8 Apr 2025 16:38:22 +0200 Subject: [PATCH 05/11] dep update --- go.mod | 22 +-- go.sum | 40 ++--- .../github.com/bitrise-io/go-pkcs12/pkcs12.go | 42 +++-- .../go-steputils/v2/stepconf/stepconf.go | 6 + .../appstoreconnect/appstoreconnect.go | 11 ++ .../devportalclient/appstoreconnect/error.go | 16 ++ .../exportoptionsgenerator.go | 41 ++--- .../v2/exportoptionsgenerator/targets.go | 3 +- .../go-xcode/v2/xcodeversion/utility.go | 60 ++++--- .../go-xcode/v2/xcodeversion/xcodeversion.go | 16 +- vendor/github.com/golang-jwt/jwt/v4/parser.go | 77 ++++++--- .../hashicorp/go-version/CHANGELOG.md | 19 +++ .../github.com/hashicorp/go-version/LICENSE | 2 + .../github.com/hashicorp/go-version/README.md | 2 +- .../hashicorp/go-version/constraint.go | 6 +- .../hashicorp/go-version/version.go | 46 +++++- .../go-version/version_collection.go | 3 + vendor/golang.org/x/sys/unix/auxv.go | 36 +++++ .../golang.org/x/sys/unix/auxv_unsupported.go | 13 ++ .../golang.org/x/sys/unix/syscall_darwin.go | 149 +++++++++++++++++- .../x/sys/unix/syscall_dragonfly.go | 12 ++ vendor/golang.org/x/sys/unix/syscall_linux.go | 42 ++--- .../golang.org/x/sys/unix/syscall_solaris.go | 87 ++++++++++ vendor/golang.org/x/sys/unix/zerrors_linux.go | 20 ++- .../x/sys/unix/zerrors_linux_386.go | 3 + .../x/sys/unix/zerrors_linux_amd64.go | 3 + .../x/sys/unix/zerrors_linux_arm.go | 3 + .../x/sys/unix/zerrors_linux_arm64.go | 4 + .../x/sys/unix/zerrors_linux_loong64.go | 3 + .../x/sys/unix/zerrors_linux_mips.go | 3 + .../x/sys/unix/zerrors_linux_mips64.go | 3 + .../x/sys/unix/zerrors_linux_mips64le.go | 3 + .../x/sys/unix/zerrors_linux_mipsle.go | 3 + .../x/sys/unix/zerrors_linux_ppc.go | 3 + .../x/sys/unix/zerrors_linux_ppc64.go | 3 + .../x/sys/unix/zerrors_linux_ppc64le.go | 3 + .../x/sys/unix/zerrors_linux_riscv64.go | 3 + .../x/sys/unix/zerrors_linux_s390x.go | 3 + .../x/sys/unix/zerrors_linux_sparc64.go | 3 + .../x/sys/unix/zsyscall_darwin_amd64.go | 84 ++++++++++ .../x/sys/unix/zsyscall_darwin_amd64.s | 20 +++ .../x/sys/unix/zsyscall_darwin_arm64.go | 84 ++++++++++ .../x/sys/unix/zsyscall_darwin_arm64.s | 20 +++ .../x/sys/unix/zsyscall_solaris_amd64.go | 114 ++++++++++++++ .../x/sys/unix/zsysnum_linux_386.go | 4 + .../x/sys/unix/zsysnum_linux_amd64.go | 4 + .../x/sys/unix/zsysnum_linux_arm.go | 4 + .../x/sys/unix/zsysnum_linux_arm64.go | 4 + .../x/sys/unix/zsysnum_linux_loong64.go | 4 + .../x/sys/unix/zsysnum_linux_mips.go | 4 + .../x/sys/unix/zsysnum_linux_mips64.go | 4 + .../x/sys/unix/zsysnum_linux_mips64le.go | 4 + .../x/sys/unix/zsysnum_linux_mipsle.go | 4 + .../x/sys/unix/zsysnum_linux_ppc.go | 4 + .../x/sys/unix/zsysnum_linux_ppc64.go | 4 + .../x/sys/unix/zsysnum_linux_ppc64le.go | 4 + .../x/sys/unix/zsysnum_linux_riscv64.go | 4 + .../x/sys/unix/zsysnum_linux_s390x.go | 4 + .../x/sys/unix/zsysnum_linux_sparc64.go | 4 + vendor/golang.org/x/sys/unix/ztypes_linux.go | 6 +- .../golang.org/x/sys/windows/dll_windows.go | 11 +- .../golang.org/x/sys/windows/types_windows.go | 27 ++++ vendor/golang.org/x/term/terminal.go | 9 ++ vendor/modules.txt | 28 ++-- 64 files changed, 1079 insertions(+), 201 deletions(-) create mode 100644 vendor/golang.org/x/sys/unix/auxv.go create mode 100644 vendor/golang.org/x/sys/unix/auxv_unsupported.go diff --git a/go.mod b/go.mod index 2dbcd621..300194ed 100644 --- a/go.mod +++ b/go.mod @@ -1,15 +1,15 @@ module github.com/bitrise-steplib/steps-xcode-archive -go 1.22 +go 1.23.0 toolchain go1.23.4 require ( - github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.23 - github.com/bitrise-io/go-utils v1.0.12 + github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.37 + github.com/bitrise-io/go-utils v1.0.14 github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.23 github.com/bitrise-io/go-xcode v1.3.0 - github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.54.0.20250408104939-27c790ba5555 + github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.55 github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 github.com/stretchr/testify v1.10.0 gopkg.in/yaml.v3 v3.0.1 @@ -17,25 +17,25 @@ require ( ) require ( - github.com/bitrise-io/go-pkcs12 v0.0.0-20230913085202-b40653eb06c7 // indirect + github.com/bitrise-io/go-pkcs12 v0.1.0 // indirect github.com/bitrise-io/go-plist v0.0.0-20210301100253-4b1a112ccd10 // indirect github.com/bitrise-io/go-steputils v1.0.6 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect + github.com/golang-jwt/jwt/v4 v4.5.2 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-retryablehttp v0.7.7 // indirect - github.com/hashicorp/go-version v1.6.0 // indirect + github.com/hashicorp/go-version v1.7.0 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rogpeppe/go-internal v1.10.0 // indirect github.com/ryanuber/go-glob v1.0.0 // indirect github.com/stretchr/objx v0.5.2 // indirect - golang.org/x/crypto v0.31.0 // indirect - golang.org/x/sys v0.28.0 // indirect - golang.org/x/term v0.27.0 // indirect - golang.org/x/text v0.21.0 // indirect + golang.org/x/crypto v0.37.0 // indirect + golang.org/x/sys v0.32.0 // indirect + golang.org/x/term v0.31.0 // indirect + golang.org/x/text v0.24.0 // indirect ) diff --git a/go.sum b/go.sum index 97f9343a..4a65b910 100644 --- a/go.sum +++ b/go.sum @@ -1,20 +1,20 @@ -github.com/bitrise-io/go-pkcs12 v0.0.0-20230913085202-b40653eb06c7 h1:UgbAP2//OniQV9K5tHg7jnPfSYAy5ujXyH6E7L7CTBQ= -github.com/bitrise-io/go-pkcs12 v0.0.0-20230913085202-b40653eb06c7/go.mod h1:fly5xmzjteedkhq4NJiEFbtC6KjvFdNeFxaTw2yF//k= +github.com/bitrise-io/go-pkcs12 v0.1.0 h1:J8mViCXJVRdav5ZSPp47Esz7XP1wW3T3BFz+NgdJsq8= +github.com/bitrise-io/go-pkcs12 v0.1.0/go.mod h1:fly5xmzjteedkhq4NJiEFbtC6KjvFdNeFxaTw2yF//k= github.com/bitrise-io/go-plist v0.0.0-20210301100253-4b1a112ccd10 h1:/2OyBFI7GjYKexBPcfTPvKFz8Ks7qYzkkz2SQ8aiJgc= github.com/bitrise-io/go-plist v0.0.0-20210301100253-4b1a112ccd10/go.mod h1:pARutiL3kEuRLV3JvswidvfCj+9Y3qMZtji2BDqLFsA= github.com/bitrise-io/go-steputils v1.0.6 h1:eBRL70DWwEd7DWYGd5Ds7OSIY5HElzhoDOI6UuITKQg= github.com/bitrise-io/go-steputils v1.0.6/go.mod h1:YIUaQnIAyK4pCvQG0hYHVkSzKNT9uL2FWmkFNW4mfNI= -github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.23 h1:ddZRxEWlDX85sCAjv5U5BvhjUvGc05xsFyyAfhuITLo= -github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.23/go.mod h1:R9HD1kg1Ay4zX+y7E+NfifzR/ZaP7DHDZsxKX/3IdpE= +github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.37 h1:2ovetrqRLDcs/i4PZEVbEkQhV6w/GHWpCXtLVwpAgu8= +github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.37/go.mod h1:ofknYj6lj4hDtg7lV/veUQ1DJWDEFctjhYoIC8m70Os= github.com/bitrise-io/go-utils v1.0.1/go.mod h1:ZY1DI+fEpZuFpO9szgDeICM4QbqoWVt0RSY3tRI1heY= -github.com/bitrise-io/go-utils v1.0.12 h1:iJV1ZpyvSA0NCte/N6x+aIQ9TrNr5sIBlcJBf0dn1dE= -github.com/bitrise-io/go-utils v1.0.12/go.mod h1:ZY1DI+fEpZuFpO9szgDeICM4QbqoWVt0RSY3tRI1heY= +github.com/bitrise-io/go-utils v1.0.14 h1:hrBriQh47qvy4p3pLkc7gEw9qCWEJYESTJ19ggHRpYs= +github.com/bitrise-io/go-utils v1.0.14/go.mod h1:ZY1DI+fEpZuFpO9szgDeICM4QbqoWVt0RSY3tRI1heY= github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.23 h1:Dfh4nyZPuEtilBisidejqxBrkx9cWvbOUrpq8VEION0= github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.23/go.mod h1:3XUplo0dOWc3DqT2XA2SeHToDSg7+j1y1HTHibT2H68= github.com/bitrise-io/go-xcode v1.3.0 h1:QB8Vyr2oZQro/ocs9DJai80rlYL1hU1kwjHqdGslFLo= github.com/bitrise-io/go-xcode v1.3.0/go.mod h1:9OwsvrhZ4A2JxHVoEY7CPcABAKA+OE7FQqFfBfvbFuY= -github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.54.0.20250408104939-27c790ba5555 h1:O5u4CkafY9pOXKSoWNMoZmLGml5yVTiBuXnhZYvThAQ= -github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.54.0.20250408104939-27c790ba5555/go.mod h1:zoLzT5fJE8V2SeYq0D0Z+ZN2FAzERjV3uiqDg5H8Bug= +github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.55 h1:hLLVWstKv0KZZexCWE9so1mDB4MnDZK2TrX5jz2AYpI= +github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.55/go.mod h1:T4rhWQljdgH5As4Dq/RQWuazdScY0YB7uZAMuBUnxeY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -23,8 +23,8 @@ github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa h1:RDBNVkRviHZtvDvId8XSGPu3rmpmSe+wKRcEWNgsfWU= github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXeUI= +github.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -39,8 +39,8 @@ github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVH github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU= github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk= -github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= -github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= +github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= @@ -75,22 +75,22 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= golang.org/x/crypto v0.0.0-20211202192323-5770296d904e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= +golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= +golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= -golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= +golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o= +golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= -golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= +golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/vendor/github.com/bitrise-io/go-pkcs12/pkcs12.go b/vendor/github.com/bitrise-io/go-pkcs12/pkcs12.go index 4d3f2b20..a5d72dac 100644 --- a/vendor/github.com/bitrise-io/go-pkcs12/pkcs12.go +++ b/vendor/github.com/bitrise-io/go-pkcs12/pkcs12.go @@ -29,6 +29,7 @@ import ( "errors" "fmt" "io" + "strings" ) // DefaultPassword is the string "changeit", a commonly-used password for @@ -403,7 +404,7 @@ func DecodeTrustStore(pfxData []byte, password string) (certs []*x509.Certificat return } -var IncorrectAliasError = errors.New("pkcs12: incorrect key alias") +var IncorrectAliasError = errors.New("pkcs12: keypair not found with alias") var IncorrectKeystorePasswordError = errors.New("pkcs12: incorrect keystore password") var IncorrectKeyPasswordError = errors.New("pkcs12: incorrect key password") @@ -418,30 +419,26 @@ func DecodeKeystore(pfxData []byte, storepass, alias, keypass string) (privateKe return nil, nil, err } - expectedNumberOfBags := 2 - bags, encodedPassword, err := getSafeContents(pfxData, encodedPassword, expectedNumberOfBags) + bags, encodedPassword, err := getSafeContents(pfxData, encodedPassword, -1) if err != nil { - if err == ErrIncorrectPassword { + if errors.Is(err, ErrIncorrectPassword) { return nil, nil, IncorrectKeystorePasswordError } return nil, nil, err } - if len(bags) != expectedNumberOfBags { - return nil, nil, fmt.Errorf("unexpected number of bags (%d), expected: %d", len(bags), expectedNumberOfBags) - } - - certAlias := "" - privateKeyAlias := "" - for _, bag := range bags { switch { case bag.Id.Equal(oidCertBag): - certAlias, err = getAlias(bag) + certAlias, err := getAlias(bag) if err != nil { return nil, nil, fmt.Errorf("pkcs12: failed to get alias for the cert bag: %s", err) } + if strings.ToLower(certAlias) != strings.ToLower(alias) { + continue + } + certsData, err := decodeCertBag(bag.Value.Bytes) if err != nil { return nil, nil, err @@ -453,11 +450,15 @@ func DecodeKeystore(pfxData []byte, storepass, alias, keypass string) (privateKe certificate = cert case bag.Id.Equal(oidPKCS8ShroundedKeyBag): - privateKeyAlias, err = getAlias(bag) + privateKeyAlias, err := getAlias(bag) if err != nil { return nil, nil, fmt.Errorf("pkcs12: failed to get alias for the key bag: %s", err) } + if strings.ToLower(privateKeyAlias) != strings.ToLower(alias) { + continue + } + key, err := decodePkcs8ShroudedKeyBag(bag.Value.Bytes, encodedPrivateKeyPassword) if err != nil { if err.Error() == "pkcs12: error decrypting PKCS#8 shrouded key bag: pkcs12: decryption error, incorrect padding" { @@ -470,17 +471,14 @@ func DecodeKeystore(pfxData []byte, storepass, alias, keypass string) (privateKe } } + if certificate == nil && privateKey == nil { + return nil, nil, IncorrectAliasError + } if certificate == nil { - return nil, nil, errors.New("pkcs12: expected a certificate in the keystore") + return nil, nil, errors.New("pkcs12: certificate not found with alias") } if privateKey == nil { - return nil, nil, errors.New("pkcs12: expected a private key in the keystore") - } - if certAlias != privateKeyAlias { - return nil, nil, errors.New("pkcs12: expected same alias for the certificate and private key") - } - if certAlias != alias { - return nil, nil, IncorrectAliasError + return nil, nil, errors.New("pkcs12: private key not found with alias") } return @@ -560,7 +558,7 @@ func getSafeContents(p12Data, password []byte, expectedItems int) (bags []safeBa return nil, nil, err } - if len(authenticatedSafe) != expectedItems { + if expectedItems > -1 && len(authenticatedSafe) != expectedItems { return nil, nil, NotImplementedError(fmt.Sprintf("expected exactly %d items in the authenticated safe", expectedItems)) } diff --git a/vendor/github.com/bitrise-io/go-steputils/v2/stepconf/stepconf.go b/vendor/github.com/bitrise-io/go-steputils/v2/stepconf/stepconf.go index 8fb7e906..37145932 100644 --- a/vendor/github.com/bitrise-io/go-steputils/v2/stepconf/stepconf.go +++ b/vendor/github.com/bitrise-io/go-steputils/v2/stepconf/stepconf.go @@ -100,6 +100,12 @@ func setField(field reflect.Value, value, constraint string) error { return errors.New("can't convert to int") } field.SetInt(n) + case reflect.Int64: + n, err := strconv.ParseInt(value, 10, 64) + if err != nil { + return errors.New("can't convert to int64") + } + field.SetInt(n) case reflect.Float64: value = strings.TrimSpace(value) f, err := strconv.ParseFloat(value, 64) diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/appstoreconnect/appstoreconnect.go b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/appstoreconnect/appstoreconnect.go index 415e31ea..0c1a608c 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/appstoreconnect/appstoreconnect.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/appstoreconnect/appstoreconnect.go @@ -7,6 +7,7 @@ import ( "bytes" "context" "encoding/json" + "errors" "fmt" "io" "net/http" @@ -78,6 +79,16 @@ func NewRetryableHTTPClient() *http.Client { return true, nil } + if resp != nil && resp.StatusCode == http.StatusForbidden { + var apiError *ErrorResponse + if ok := errors.As(checkResponse(resp), &apiError); ok { + if apiError.IsRequiredAgreementMissingOrExpired() { + log.Warnf("Received error FORBIDDEN.REQUIRED_AGREEMENTS_MISSING_OR_EXPIRED (status 403), retrying request...") + return true, nil + } + } + } + if resp != nil && resp.StatusCode == http.StatusTooManyRequests { message := "Received HTTP 429 Too Many Requests" if rateLimit := resp.Header.Get("X-Rate-Limit"); rateLimit != "" { diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/appstoreconnect/error.go b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/appstoreconnect/error.go index 3c511051..4c434c63 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/appstoreconnect/error.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/autocodesign/devportalclient/appstoreconnect/error.go @@ -49,6 +49,22 @@ func (r ErrorResponse) IsCursorInvalid() bool { return false } +// IsRequiredAgreementMissingOrExpired ... +func (r ErrorResponse) IsRequiredAgreementMissingOrExpired() bool { + // status code: 403 + // code: FORBIDDEN.REQUIRED_AGREEMENTS_MISSING_OR_EXPIRED + // title: A required agreement is missing or has expired. + // detail: This request requires an in-effect agreement that has not been signed or has expired. + + for _, err := range r.Errors { + if err.Code == "FORBIDDEN.REQUIRED_AGREEMENTS_MISSING_OR_EXPIRED" { + return true + } + } + + return false +} + // DeviceRegistrationError ... type DeviceRegistrationError struct { Reason string diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/exportoptionsgenerator.go b/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/exportoptionsgenerator.go index 6eff3b9c..32ff1828 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/exportoptionsgenerator.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/exportoptionsgenerator.go @@ -10,7 +10,6 @@ import ( "github.com/bitrise-io/go-xcode/exportoptions" "github.com/bitrise-io/go-xcode/plistutil" "github.com/bitrise-io/go-xcode/profileutil" - "github.com/bitrise-io/go-xcode/v2/xcodeversion" "github.com/bitrise-io/go-xcode/xcodeproject/serialized" "github.com/bitrise-io/go-xcode/xcodeproject/xcodeproj" "github.com/bitrise-io/go-xcode/xcodeproject/xcscheme" @@ -27,7 +26,6 @@ type ExportOptionsGenerator struct { scheme *xcscheme.Scheme configuration string - xcodeVersionReader xcodeversion.Reader certificateProvider CodesignIdentityProvider profileProvider ProvisioningProfileProvider targetInfoProvider TargetInfoProvider @@ -35,12 +33,11 @@ type ExportOptionsGenerator struct { } // New constructs a new ExportOptionsGenerator. -func New(xcodeProj *xcodeproj.XcodeProj, scheme *xcscheme.Scheme, configuration string, xcodeVersionReader xcodeversion.Reader, logger log.Logger) ExportOptionsGenerator { +func New(xcodeProj *xcodeproj.XcodeProj, scheme *xcscheme.Scheme, configuration string, logger log.Logger) ExportOptionsGenerator { g := ExportOptionsGenerator{ - xcodeProj: xcodeProj, - scheme: scheme, - configuration: configuration, - xcodeVersionReader: xcodeVersionReader, + xcodeProj: xcodeProj, + scheme: scheme, + configuration: configuration, } g.certificateProvider = LocalCodesignIdentityProvider{} g.profileProvider = LocalProvisioningProfileProvider{} @@ -58,30 +55,26 @@ func (g ExportOptionsGenerator) GenerateApplicationExportOptions( compileBitcode bool, archivedWithXcodeManagedProfiles bool, codeSigningStyle exportoptions.SigningStyle, + xcodeMajorVersion int64, testFlightInternalTestingOnly bool, ) (exportoptions.ExportOptions, error) { - xcodeVersion, err := g.xcodeVersionReader.GetVersion() - if err != nil { - return nil, fmt.Errorf("failed to get Xcode version: %w", err) - } - mainTargetBundleID, entitlementsByBundleID, err := g.applicationTargetsAndEntitlements(exportMethod) if err != nil { return nil, err } - iCloudContainerEnvironment, err := determineIcloudContainerEnvironment(containerEnvironment, entitlementsByBundleID, exportMethod, xcodeVersion.Major) + iCloudContainerEnvironment, err := determineIcloudContainerEnvironment(containerEnvironment, entitlementsByBundleID, exportMethod, xcodeMajorVersion) if err != nil { return nil, err } - exportOpts := generateBaseExportOptions(exportMethod, xcodeVersion, uploadBitcode, compileBitcode, iCloudContainerEnvironment) + exportOpts := generateBaseExportOptions(exportMethod, uploadBitcode, compileBitcode, iCloudContainerEnvironment) - if xcodeVersion.Major >= 12 { + if xcodeMajorVersion >= 12 { exportOpts = addDistributionBundleIdentifierFromXcode12(exportOpts, mainTargetBundleID) } - if xcodeVersion.Major >= 13 { + if xcodeMajorVersion >= 13 { exportOpts = disableManagedBuildNumberFromXcode13(exportOpts) } @@ -99,7 +92,7 @@ func (g ExportOptionsGenerator) GenerateApplicationExportOptions( exportOpts = addManualSigningFields(exportOpts, codeSignGroup, archivedWithXcodeManagedProfiles, g.logger) } - if xcodeVersion.Major >= 15 { + if xcodeMajorVersion >= 15 { if testFlightInternalTestingOnly { exportOpts = addTestFlightInternalTestingOnly(exportOpts, testFlightInternalTestingOnly) } @@ -299,11 +292,11 @@ func determineIcloudContainerEnvironment(desiredIcloudContainerEnvironment strin } // From Xcode 9 iCloudContainerEnvironment is required for every export method, before that version only for non app-store exports. - if xcodeMajorVersion < 9 && exportMethod.IsAppStore() { + if xcodeMajorVersion < 9 && exportMethod == exportoptions.MethodAppStore { return "", nil } - if exportMethod.IsAppStore() { + if exportMethod == exportoptions.MethodAppStore { return "Production", nil } @@ -339,13 +332,9 @@ func projectUsesCloudKit(bundleIDEntitlementsMap map[string]plistutil.PlistData) } // generateBaseExportOptions creates a default exportOptions introduced in Xcode 7. -func generateBaseExportOptions(exportMethod exportoptions.Method, xcodeVersion xcodeversion.Version, cfgUploadBitcode, cfgCompileBitcode bool, iCloudContainerEnvironment string) exportoptions.ExportOptions { - if xcodeVersion.IsGreaterThanOrEqualTo(15, 3) { - exportMethod = exportoptions.UpgradeToXcode15_3MethodName(exportMethod) - } - - if exportMethod.IsAppStore() { - appStoreOptions := exportoptions.NewAppStoreConnectOptions(exportMethod) +func generateBaseExportOptions(exportMethod exportoptions.Method, cfgUploadBitcode, cfgCompileBitcode bool, iCloudContainerEnvironment string) exportoptions.ExportOptions { + if exportMethod == exportoptions.MethodAppStore { + appStoreOptions := exportoptions.NewAppStoreOptions() appStoreOptions.UploadBitcode = cfgUploadBitcode if iCloudContainerEnvironment != "" { appStoreOptions.ICloudContainerEnvironment = exportoptions.ICloudContainerEnvironment(iCloudContainerEnvironment) diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/targets.go b/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/targets.go index b503f9a5..fa2d9042 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/targets.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/targets.go @@ -2,7 +2,6 @@ package exportoptionsgenerator import ( "fmt" - "github.com/bitrise-io/go-xcode/exportoptions" "github.com/bitrise-io/go-xcode/xcodeproject/serialized" "github.com/bitrise-io/go-xcode/xcodeproject/xcodeproj" @@ -63,7 +62,7 @@ func filterApplicationBundleTargets(targets []xcodeproj.Target, exportMethod exp // Development App Clip Profile // // .., - if !exportMethod.IsAppStore() && target.IsAppClipProduct() { + if exportMethod != exportoptions.MethodAppStore && target.IsAppClipProduct() { continue } diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/utility.go b/vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/utility.go index c58ff7c1..bcd2b50b 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/utility.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/utility.go @@ -2,44 +2,58 @@ package xcodeversion import ( "fmt" - "regexp" "strconv" + "strings" ) func getXcodeVersionFromXcodebuildOutput(outStr string) (Version, error) { - versionRegexp := regexp.MustCompile(`(?m)^Xcode.* (\d+)(\.(\d+))?.*$`) - buildVersionRegexp := regexp.MustCompile(`(?m)^Build version.* (\w.*)$`) - - xcodeVersionMatch := versionRegexp.FindStringSubmatch(outStr) - if len(xcodeVersionMatch) < 4 { - return Version{}, fmt.Errorf("couldn't find Xcode version in output: (%s)", outStr) + split := strings.Split(outStr, "\n") + if len(split) == 0 { + return Version{}, fmt.Errorf("failed to parse xcodebuild version output (%s)", outStr) } - xcodebuildVersion := xcodeVersionMatch[0] - majorVersionStr := xcodeVersionMatch[1] - majorVersion, err := strconv.Atoi(majorVersionStr) + filteredOutput, err := filterXcodeWarnings(split) if err != nil { - return Version{}, fmt.Errorf("failed to parse xcodebuild major version (output %s): %w", outStr, err) + return Version{}, err } - minorVersion := int(0) - minorVersionStr := xcodeVersionMatch[3] - if minorVersionStr != "" { - if minorVersion, err = strconv.Atoi(minorVersionStr); err != nil { - return Version{}, fmt.Errorf("failed to parse xcodebuild minor version (output %s): %w", outStr, err) - } + xcodebuildVersion := filteredOutput[0] + buildVersion := filteredOutput[1] + + split = strings.Split(xcodebuildVersion, " ") + if len(split) != 2 { + return Version{}, fmt.Errorf("failed to parse xcodebuild version output (%s)", outStr) } - buildVersionMatch := buildVersionRegexp.FindStringSubmatch(outStr) - buildVersion := "unknown" - if len(buildVersionMatch) >= 2 { - buildVersion = buildVersionMatch[1] + version := split[1] + + split = strings.Split(version, ".") + majorVersionStr := split[0] + + majorVersion, err := strconv.ParseInt(majorVersionStr, 10, 32) + if err != nil { + return Version{}, fmt.Errorf("failed to parse xcodebuild version output (%s), error: %s", outStr, err) } return Version{ Version: xcodebuildVersion, BuildVersion: buildVersion, - Major: int64(majorVersion), - Minor: int64(minorVersion), + MajorVersion: majorVersion, }, nil } + +func filterXcodeWarnings(cmdOutputLines []string) ([]string, error) { + firstLineIndex := -1 + for i, line := range cmdOutputLines { + if strings.HasPrefix(line, "Xcode ") { + firstLineIndex = i + break + } + } + + if firstLineIndex < 0 { + return []string{}, fmt.Errorf("couldn't find Xcode version in output: %s", cmdOutputLines) + } + + return cmdOutputLines[firstLineIndex:], nil +} diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/xcodeversion.go b/vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/xcodeversion.go index aef6d33f..acb7f755 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/xcodeversion.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/xcodeversion.go @@ -10,8 +10,7 @@ import ( type Version struct { Version string BuildVersion string - Major int64 - Minor int64 + MajorVersion int64 } // Reader ... @@ -34,21 +33,10 @@ func NewXcodeVersionProvider(commandFactory command.Factory) Reader { func (b *reader) GetVersion() (Version, error) { cmd := b.commandFactory.Create("xcodebuild", []string{"-version"}, &command.Opts{}) - outStr, err := cmd.RunAndReturnTrimmedOutput() + outStr, err := cmd.RunAndReturnTrimmedCombinedOutput() if err != nil { return Version{}, fmt.Errorf("xcodebuild -version failed: %s, output: %s", err, outStr) } return getXcodeVersionFromXcodebuildOutput(outStr) } - -// IsGreaterThanOrEqualTo checks if the Xcode version is greater than or equal to the given major and minor version. -func (v Version) IsGreaterThanOrEqualTo(major, minor int64) bool { - if v.Major > major { - return true - } - if v.Major == major && v.Minor >= minor { - return true - } - return false -} diff --git a/vendor/github.com/golang-jwt/jwt/v4/parser.go b/vendor/github.com/golang-jwt/jwt/v4/parser.go index c0a6f692..0fc510a0 100644 --- a/vendor/github.com/golang-jwt/jwt/v4/parser.go +++ b/vendor/github.com/golang-jwt/jwt/v4/parser.go @@ -7,6 +7,8 @@ import ( "strings" ) +const tokenDelimiter = "." + type Parser struct { // If populated, only these methods will be considered valid. // @@ -36,19 +38,21 @@ func NewParser(options ...ParserOption) *Parser { return p } -// Parse parses, validates, verifies the signature and returns the parsed token. -// keyFunc will receive the parsed token and should return the key for validating. +// Parse parses, validates, verifies the signature and returns the parsed token. keyFunc will +// receive the parsed token and should return the key for validating. func (p *Parser) Parse(tokenString string, keyFunc Keyfunc) (*Token, error) { return p.ParseWithClaims(tokenString, MapClaims{}, keyFunc) } -// ParseWithClaims parses, validates, and verifies like Parse, but supplies a default object implementing the Claims -// interface. This provides default values which can be overridden and allows a caller to use their own type, rather -// than the default MapClaims implementation of Claims. +// ParseWithClaims parses, validates, and verifies like Parse, but supplies a default object +// implementing the Claims interface. This provides default values which can be overridden and +// allows a caller to use their own type, rather than the default MapClaims implementation of +// Claims. // -// Note: If you provide a custom claim implementation that embeds one of the standard claims (such as RegisteredClaims), -// make sure that a) you either embed a non-pointer version of the claims or b) if you are using a pointer, allocate the -// proper memory for it before passing in the overall claims, otherwise you might run into a panic. +// Note: If you provide a custom claim implementation that embeds one of the standard claims (such +// as RegisteredClaims), make sure that a) you either embed a non-pointer version of the claims or +// b) if you are using a pointer, allocate the proper memory for it before passing in the overall +// claims, otherwise you might run into a panic. func (p *Parser) ParseWithClaims(tokenString string, claims Claims, keyFunc Keyfunc) (*Token, error) { token, parts, err := p.ParseUnverified(tokenString, claims) if err != nil { @@ -85,12 +89,17 @@ func (p *Parser) ParseWithClaims(tokenString string, claims Claims, keyFunc Keyf return token, &ValidationError{Inner: err, Errors: ValidationErrorUnverifiable} } + // Perform validation + token.Signature = parts[2] + if err := token.Method.Verify(strings.Join(parts[0:2], "."), token.Signature, key); err != nil { + return token, &ValidationError{Inner: err, Errors: ValidationErrorSignatureInvalid} + } + vErr := &ValidationError{} // Validate Claims if !p.SkipClaimsValidation { if err := token.Claims.Valid(); err != nil { - // If the Claims Valid returned an error, check if it is a validation error, // If it was another error type, create a ValidationError with a generic ClaimsInvalid flag set if e, ok := err.(*ValidationError); !ok { @@ -98,22 +107,14 @@ func (p *Parser) ParseWithClaims(tokenString string, claims Claims, keyFunc Keyf } else { vErr = e } + return token, vErr } } - // Perform validation - token.Signature = parts[2] - if err = token.Method.Verify(strings.Join(parts[0:2], "."), token.Signature, key); err != nil { - vErr.Inner = err - vErr.Errors |= ValidationErrorSignatureInvalid - } - - if vErr.valid() { - token.Valid = true - return token, nil - } + // No errors so far, token is valid. + token.Valid = true - return token, vErr + return token, nil } // ParseUnverified parses the token but doesn't validate the signature. @@ -123,9 +124,10 @@ func (p *Parser) ParseWithClaims(tokenString string, claims Claims, keyFunc Keyf // It's only ever useful in cases where you know the signature is valid (because it has // been checked previously in the stack) and you want to extract values from it. func (p *Parser) ParseUnverified(tokenString string, claims Claims) (token *Token, parts []string, err error) { - parts = strings.Split(tokenString, ".") - if len(parts) != 3 { - return nil, parts, NewValidationError("token contains an invalid number of segments", ValidationErrorMalformed) + var ok bool + parts, ok = splitToken(tokenString) + if !ok { + return nil, nil, NewValidationError("token contains an invalid number of segments", ValidationErrorMalformed) } token = &Token{Raw: tokenString} @@ -175,3 +177,30 @@ func (p *Parser) ParseUnverified(tokenString string, claims Claims) (token *Toke return token, parts, nil } + +// splitToken splits a token string into three parts: header, claims, and signature. It will only +// return true if the token contains exactly two delimiters and three parts. In all other cases, it +// will return nil parts and false. +func splitToken(token string) ([]string, bool) { + parts := make([]string, 3) + header, remain, ok := strings.Cut(token, tokenDelimiter) + if !ok { + return nil, false + } + parts[0] = header + claims, remain, ok := strings.Cut(remain, tokenDelimiter) + if !ok { + return nil, false + } + parts[1] = claims + // One more cut to ensure the signature is the last part of the token and there are no more + // delimiters. This avoids an issue where malicious input could contain additional delimiters + // causing unecessary overhead parsing tokens. + signature, _, unexpected := strings.Cut(remain, tokenDelimiter) + if unexpected { + return nil, false + } + parts[2] = signature + + return parts, true +} diff --git a/vendor/github.com/hashicorp/go-version/CHANGELOG.md b/vendor/github.com/hashicorp/go-version/CHANGELOG.md index 5f16dd14..6d48174b 100644 --- a/vendor/github.com/hashicorp/go-version/CHANGELOG.md +++ b/vendor/github.com/hashicorp/go-version/CHANGELOG.md @@ -1,3 +1,22 @@ +# 1.7.0 (May 24, 2024) + +ENHANCEMENTS: + +- Remove `reflect` dependency ([#91](https://github.com/hashicorp/go-version/pull/91)) +- Implement the `database/sql.Scanner` and `database/sql/driver.Value` interfaces for `Version` ([#133](https://github.com/hashicorp/go-version/pull/133)) + +INTERNAL: + +- [COMPLIANCE] Add Copyright and License Headers ([#115](https://github.com/hashicorp/go-version/pull/115)) +- [COMPLIANCE] Update MPL-2.0 LICENSE ([#105](https://github.com/hashicorp/go-version/pull/105)) +- Bump actions/cache from 3.0.11 to 3.2.5 ([#116](https://github.com/hashicorp/go-version/pull/116)) +- Bump actions/checkout from 3.2.0 to 3.3.0 ([#111](https://github.com/hashicorp/go-version/pull/111)) +- Bump actions/upload-artifact from 3.1.1 to 3.1.2 ([#112](https://github.com/hashicorp/go-version/pull/112)) +- GHA Migration ([#103](https://github.com/hashicorp/go-version/pull/103)) +- github: Pin external GitHub Actions to hashes ([#107](https://github.com/hashicorp/go-version/pull/107)) +- SEC-090: Automated trusted workflow pinning (2023-04-05) ([#124](https://github.com/hashicorp/go-version/pull/124)) +- update readme ([#104](https://github.com/hashicorp/go-version/pull/104)) + # 1.6.0 (June 28, 2022) FEATURES: diff --git a/vendor/github.com/hashicorp/go-version/LICENSE b/vendor/github.com/hashicorp/go-version/LICENSE index c33dcc7c..1409d6ab 100644 --- a/vendor/github.com/hashicorp/go-version/LICENSE +++ b/vendor/github.com/hashicorp/go-version/LICENSE @@ -1,3 +1,5 @@ +Copyright (c) 2014 HashiCorp, Inc. + Mozilla Public License, version 2.0 1. Definitions diff --git a/vendor/github.com/hashicorp/go-version/README.md b/vendor/github.com/hashicorp/go-version/README.md index 4d250509..4b7806cd 100644 --- a/vendor/github.com/hashicorp/go-version/README.md +++ b/vendor/github.com/hashicorp/go-version/README.md @@ -1,5 +1,5 @@ # Versioning Library for Go -[![Build Status](https://circleci.com/gh/hashicorp/go-version/tree/main.svg?style=svg)](https://circleci.com/gh/hashicorp/go-version/tree/main) +![Build Status](https://github.com/hashicorp/go-version/actions/workflows/go-tests.yml/badge.svg) [![GoDoc](https://godoc.org/github.com/hashicorp/go-version?status.svg)](https://godoc.org/github.com/hashicorp/go-version) go-version is a library for parsing versions and version constraints, diff --git a/vendor/github.com/hashicorp/go-version/constraint.go b/vendor/github.com/hashicorp/go-version/constraint.go index da5d1aca..29bdc4d2 100644 --- a/vendor/github.com/hashicorp/go-version/constraint.go +++ b/vendor/github.com/hashicorp/go-version/constraint.go @@ -1,8 +1,10 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package version import ( "fmt" - "reflect" "regexp" "sort" "strings" @@ -199,7 +201,7 @@ func prereleaseCheck(v, c *Version) bool { case cPre && vPre: // A constraint with a pre-release can only match a pre-release version // with the same base segments. - return reflect.DeepEqual(c.Segments64(), v.Segments64()) + return v.equalSegments(c) case !cPre && vPre: // A constraint without a pre-release can only match a version without a diff --git a/vendor/github.com/hashicorp/go-version/version.go b/vendor/github.com/hashicorp/go-version/version.go index e87df699..7c683c28 100644 --- a/vendor/github.com/hashicorp/go-version/version.go +++ b/vendor/github.com/hashicorp/go-version/version.go @@ -1,9 +1,12 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package version import ( "bytes" + "database/sql/driver" "fmt" - "reflect" "regexp" "strconv" "strings" @@ -117,11 +120,8 @@ func (v *Version) Compare(other *Version) int { return 0 } - segmentsSelf := v.Segments64() - segmentsOther := other.Segments64() - // If the segments are the same, we must compare on prerelease info - if reflect.DeepEqual(segmentsSelf, segmentsOther) { + if v.equalSegments(other) { preSelf := v.Prerelease() preOther := other.Prerelease() if preSelf == "" && preOther == "" { @@ -137,6 +137,8 @@ func (v *Version) Compare(other *Version) int { return comparePrereleases(preSelf, preOther) } + segmentsSelf := v.Segments64() + segmentsOther := other.Segments64() // Get the highest specificity (hS), or if they're equal, just use segmentSelf length lenSelf := len(segmentsSelf) lenOther := len(segmentsOther) @@ -160,7 +162,7 @@ func (v *Version) Compare(other *Version) int { // this means Other had the lower specificity // Check to see if the remaining segments in Self are all zeros - if !allZero(segmentsSelf[i:]) { - //if not, it means that Self has to be greater than Other + // if not, it means that Self has to be greater than Other return 1 } break @@ -180,6 +182,21 @@ func (v *Version) Compare(other *Version) int { return 0 } +func (v *Version) equalSegments(other *Version) bool { + segmentsSelf := v.Segments64() + segmentsOther := other.Segments64() + + if len(segmentsSelf) != len(segmentsOther) { + return false + } + for i, v := range segmentsSelf { + if v != segmentsOther[i] { + return false + } + } + return true +} + func allZero(segs []int64) bool { for _, s := range segs { if s != 0 { @@ -405,3 +422,20 @@ func (v *Version) UnmarshalText(b []byte) error { func (v *Version) MarshalText() ([]byte, error) { return []byte(v.String()), nil } + +// Scan implements the sql.Scanner interface. +func (v *Version) Scan(src interface{}) error { + switch src := src.(type) { + case string: + return v.UnmarshalText([]byte(src)) + case nil: + return nil + default: + return fmt.Errorf("cannot scan %T as Version", src) + } +} + +// Value implements the driver.Valuer interface. +func (v *Version) Value() (driver.Value, error) { + return v.String(), nil +} diff --git a/vendor/github.com/hashicorp/go-version/version_collection.go b/vendor/github.com/hashicorp/go-version/version_collection.go index cc888d43..83547fe1 100644 --- a/vendor/github.com/hashicorp/go-version/version_collection.go +++ b/vendor/github.com/hashicorp/go-version/version_collection.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package version // Collection is a type that implements the sort.Interface interface diff --git a/vendor/golang.org/x/sys/unix/auxv.go b/vendor/golang.org/x/sys/unix/auxv.go new file mode 100644 index 00000000..37a82528 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/auxv.go @@ -0,0 +1,36 @@ +// Copyright 2025 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build go1.21 && (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos) + +package unix + +import ( + "syscall" + "unsafe" +) + +//go:linkname runtime_getAuxv runtime.getAuxv +func runtime_getAuxv() []uintptr + +// Auxv returns the ELF auxiliary vector as a sequence of key/value pairs. +// The returned slice is always a fresh copy, owned by the caller. +// It returns an error on non-ELF platforms, or if the auxiliary vector cannot be accessed, +// which happens in some locked-down environments and build modes. +func Auxv() ([][2]uintptr, error) { + vec := runtime_getAuxv() + vecLen := len(vec) + + if vecLen == 0 { + return nil, syscall.ENOENT + } + + if vecLen%2 != 0 { + return nil, syscall.EINVAL + } + + result := make([]uintptr, vecLen) + copy(result, vec) + return unsafe.Slice((*[2]uintptr)(unsafe.Pointer(&result[0])), vecLen/2), nil +} diff --git a/vendor/golang.org/x/sys/unix/auxv_unsupported.go b/vendor/golang.org/x/sys/unix/auxv_unsupported.go new file mode 100644 index 00000000..1200487f --- /dev/null +++ b/vendor/golang.org/x/sys/unix/auxv_unsupported.go @@ -0,0 +1,13 @@ +// Copyright 2025 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build !go1.21 && (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos) + +package unix + +import "syscall" + +func Auxv() ([][2]uintptr, error) { + return nil, syscall.ENOTSUP +} diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.go b/vendor/golang.org/x/sys/unix/syscall_darwin.go index 099867de..798f61ad 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin.go @@ -602,7 +602,150 @@ func Connectx(fd int, srcIf uint32, srcAddr, dstAddr Sockaddr, associd SaeAssocI return } -//sys connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error) +// sys connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error) +const minIovec = 8 + +func Readv(fd int, iovs [][]byte) (n int, err error) { + if !darwinKernelVersionMin(11, 0, 0) { + return 0, ENOSYS + } + + iovecs := make([]Iovec, 0, minIovec) + iovecs = appendBytes(iovecs, iovs) + n, err = readv(fd, iovecs) + readvRacedetect(iovecs, n, err) + return n, err +} + +func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) { + if !darwinKernelVersionMin(11, 0, 0) { + return 0, ENOSYS + } + iovecs := make([]Iovec, 0, minIovec) + iovecs = appendBytes(iovecs, iovs) + n, err = preadv(fd, iovecs, offset) + readvRacedetect(iovecs, n, err) + return n, err +} + +func Writev(fd int, iovs [][]byte) (n int, err error) { + if !darwinKernelVersionMin(11, 0, 0) { + return 0, ENOSYS + } + + iovecs := make([]Iovec, 0, minIovec) + iovecs = appendBytes(iovecs, iovs) + if raceenabled { + raceReleaseMerge(unsafe.Pointer(&ioSync)) + } + n, err = writev(fd, iovecs) + writevRacedetect(iovecs, n) + return n, err +} + +func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) { + if !darwinKernelVersionMin(11, 0, 0) { + return 0, ENOSYS + } + + iovecs := make([]Iovec, 0, minIovec) + iovecs = appendBytes(iovecs, iovs) + if raceenabled { + raceReleaseMerge(unsafe.Pointer(&ioSync)) + } + n, err = pwritev(fd, iovecs, offset) + writevRacedetect(iovecs, n) + return n, err +} + +func appendBytes(vecs []Iovec, bs [][]byte) []Iovec { + for _, b := range bs { + var v Iovec + v.SetLen(len(b)) + if len(b) > 0 { + v.Base = &b[0] + } else { + v.Base = (*byte)(unsafe.Pointer(&_zero)) + } + vecs = append(vecs, v) + } + return vecs +} + +func writevRacedetect(iovecs []Iovec, n int) { + if !raceenabled { + return + } + for i := 0; n > 0 && i < len(iovecs); i++ { + m := int(iovecs[i].Len) + if m > n { + m = n + } + n -= m + if m > 0 { + raceReadRange(unsafe.Pointer(iovecs[i].Base), m) + } + } +} + +func readvRacedetect(iovecs []Iovec, n int, err error) { + if !raceenabled { + return + } + for i := 0; n > 0 && i < len(iovecs); i++ { + m := int(iovecs[i].Len) + if m > n { + m = n + } + n -= m + if m > 0 { + raceWriteRange(unsafe.Pointer(iovecs[i].Base), m) + } + } + if err == nil { + raceAcquire(unsafe.Pointer(&ioSync)) + } +} + +func darwinMajorMinPatch() (maj, min, patch int, err error) { + var un Utsname + err = Uname(&un) + if err != nil { + return + } + + var mmp [3]int + c := 0 +Loop: + for _, b := range un.Release[:] { + switch { + case b >= '0' && b <= '9': + mmp[c] = 10*mmp[c] + int(b-'0') + case b == '.': + c++ + if c > 2 { + return 0, 0, 0, ENOTSUP + } + case b == 0: + break Loop + default: + return 0, 0, 0, ENOTSUP + } + } + if c != 2 { + return 0, 0, 0, ENOTSUP + } + return mmp[0], mmp[1], mmp[2], nil +} + +func darwinKernelVersionMin(maj, min, patch int) bool { + actualMaj, actualMin, actualPatch, err := darwinMajorMinPatch() + if err != nil { + return false + } + return actualMaj > maj || actualMaj == maj && (actualMin > min || actualMin == min && actualPatch >= patch) +} + //sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) //sys shmat(id int, addr uintptr, flag int) (ret uintptr, err error) @@ -705,3 +848,7 @@ func Connectx(fd int, srcIf uint32, srcAddr, dstAddr Sockaddr, associd SaeAssocI //sys write(fd int, p []byte) (n int, err error) //sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) //sys munmap(addr uintptr, length uintptr) (err error) +//sys readv(fd int, iovecs []Iovec) (n int, err error) +//sys preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) +//sys writev(fd int, iovecs []Iovec) (n int, err error) +//sys pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_dragonfly.go b/vendor/golang.org/x/sys/unix/syscall_dragonfly.go index 97cb916f..be8c0020 100644 --- a/vendor/golang.org/x/sys/unix/syscall_dragonfly.go +++ b/vendor/golang.org/x/sys/unix/syscall_dragonfly.go @@ -246,6 +246,18 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e return sendfile(outfd, infd, offset, count) } +func Dup3(oldfd, newfd, flags int) error { + if oldfd == newfd || flags&^O_CLOEXEC != 0 { + return EINVAL + } + how := F_DUP2FD + if flags&O_CLOEXEC != 0 { + how = F_DUP2FD_CLOEXEC + } + _, err := fcntl(oldfd, how, newfd) + return err +} + /* * Exposed directly */ diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go index 230a9454..4958a657 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -13,6 +13,7 @@ package unix import ( "encoding/binary" + "slices" "strconv" "syscall" "time" @@ -417,7 +418,7 @@ func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) { return nil, 0, EINVAL } sa.raw.Family = AF_UNIX - for i := 0; i < n; i++ { + for i := range n { sa.raw.Path[i] = int8(name[i]) } // length is family (uint16), name, NUL. @@ -507,7 +508,7 @@ func (sa *SockaddrL2) sockaddr() (unsafe.Pointer, _Socklen, error) { psm := (*[2]byte)(unsafe.Pointer(&sa.raw.Psm)) psm[0] = byte(sa.PSM) psm[1] = byte(sa.PSM >> 8) - for i := 0; i < len(sa.Addr); i++ { + for i := range len(sa.Addr) { sa.raw.Bdaddr[i] = sa.Addr[len(sa.Addr)-1-i] } cid := (*[2]byte)(unsafe.Pointer(&sa.raw.Cid)) @@ -589,11 +590,11 @@ func (sa *SockaddrCAN) sockaddr() (unsafe.Pointer, _Socklen, error) { sa.raw.Family = AF_CAN sa.raw.Ifindex = int32(sa.Ifindex) rx := (*[4]byte)(unsafe.Pointer(&sa.RxID)) - for i := 0; i < 4; i++ { + for i := range 4 { sa.raw.Addr[i] = rx[i] } tx := (*[4]byte)(unsafe.Pointer(&sa.TxID)) - for i := 0; i < 4; i++ { + for i := range 4 { sa.raw.Addr[i+4] = tx[i] } return unsafe.Pointer(&sa.raw), SizeofSockaddrCAN, nil @@ -618,11 +619,11 @@ func (sa *SockaddrCANJ1939) sockaddr() (unsafe.Pointer, _Socklen, error) { sa.raw.Family = AF_CAN sa.raw.Ifindex = int32(sa.Ifindex) n := (*[8]byte)(unsafe.Pointer(&sa.Name)) - for i := 0; i < 8; i++ { + for i := range 8 { sa.raw.Addr[i] = n[i] } p := (*[4]byte)(unsafe.Pointer(&sa.PGN)) - for i := 0; i < 4; i++ { + for i := range 4 { sa.raw.Addr[i+8] = p[i] } sa.raw.Addr[12] = sa.Addr @@ -911,7 +912,7 @@ func (sa *SockaddrIUCV) sockaddr() (unsafe.Pointer, _Socklen, error) { // These are EBCDIC encoded by the kernel, but we still need to pad them // with blanks. Initializing with blanks allows the caller to feed in either // a padded or an unpadded string. - for i := 0; i < 8; i++ { + for i := range 8 { sa.raw.Nodeid[i] = ' ' sa.raw.User_id[i] = ' ' sa.raw.Name[i] = ' ' @@ -1148,7 +1149,7 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { var user [8]byte var name [8]byte - for i := 0; i < 8; i++ { + for i := range 8 { user[i] = byte(pp.User_id[i]) name[i] = byte(pp.Name[i]) } @@ -1173,11 +1174,11 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { Ifindex: int(pp.Ifindex), } name := (*[8]byte)(unsafe.Pointer(&sa.Name)) - for i := 0; i < 8; i++ { + for i := range 8 { name[i] = pp.Addr[i] } pgn := (*[4]byte)(unsafe.Pointer(&sa.PGN)) - for i := 0; i < 4; i++ { + for i := range 4 { pgn[i] = pp.Addr[i+8] } addr := (*[1]byte)(unsafe.Pointer(&sa.Addr)) @@ -1188,11 +1189,11 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { Ifindex: int(pp.Ifindex), } rx := (*[4]byte)(unsafe.Pointer(&sa.RxID)) - for i := 0; i < 4; i++ { + for i := range 4 { rx[i] = pp.Addr[i] } tx := (*[4]byte)(unsafe.Pointer(&sa.TxID)) - for i := 0; i < 4; i++ { + for i := range 4 { tx[i] = pp.Addr[i+4] } return sa, nil @@ -2216,10 +2217,7 @@ func readvRacedetect(iovecs []Iovec, n int, err error) { return } for i := 0; n > 0 && i < len(iovecs); i++ { - m := int(iovecs[i].Len) - if m > n { - m = n - } + m := min(int(iovecs[i].Len), n) n -= m if m > 0 { raceWriteRange(unsafe.Pointer(iovecs[i].Base), m) @@ -2270,10 +2268,7 @@ func writevRacedetect(iovecs []Iovec, n int) { return } for i := 0; n > 0 && i < len(iovecs); i++ { - m := int(iovecs[i].Len) - if m > n { - m = n - } + m := min(int(iovecs[i].Len), n) n -= m if m > 0 { raceReadRange(unsafe.Pointer(iovecs[i].Base), m) @@ -2320,12 +2315,7 @@ func isGroupMember(gid int) bool { return false } - for _, g := range groups { - if g == gid { - return true - } - } - return false + return slices.Contains(groups, gid) } func isCapDacOverrideSet() bool { diff --git a/vendor/golang.org/x/sys/unix/syscall_solaris.go b/vendor/golang.org/x/sys/unix/syscall_solaris.go index 21974af0..abc39554 100644 --- a/vendor/golang.org/x/sys/unix/syscall_solaris.go +++ b/vendor/golang.org/x/sys/unix/syscall_solaris.go @@ -1102,3 +1102,90 @@ func (s *Strioctl) SetInt(i int) { func IoctlSetStrioctlRetInt(fd int, req int, s *Strioctl) (int, error) { return ioctlPtrRet(fd, req, unsafe.Pointer(s)) } + +// Ucred Helpers +// See ucred(3c) and getpeerucred(3c) + +//sys getpeerucred(fd uintptr, ucred *uintptr) (err error) +//sys ucredFree(ucred uintptr) = ucred_free +//sys ucredGet(pid int) (ucred uintptr, err error) = ucred_get +//sys ucredGeteuid(ucred uintptr) (uid int) = ucred_geteuid +//sys ucredGetegid(ucred uintptr) (gid int) = ucred_getegid +//sys ucredGetruid(ucred uintptr) (uid int) = ucred_getruid +//sys ucredGetrgid(ucred uintptr) (gid int) = ucred_getrgid +//sys ucredGetsuid(ucred uintptr) (uid int) = ucred_getsuid +//sys ucredGetsgid(ucred uintptr) (gid int) = ucred_getsgid +//sys ucredGetpid(ucred uintptr) (pid int) = ucred_getpid + +// Ucred is an opaque struct that holds user credentials. +type Ucred struct { + ucred uintptr +} + +// We need to ensure that ucredFree is called on the underlying ucred +// when the Ucred is garbage collected. +func ucredFinalizer(u *Ucred) { + ucredFree(u.ucred) +} + +func GetPeerUcred(fd uintptr) (*Ucred, error) { + var ucred uintptr + err := getpeerucred(fd, &ucred) + if err != nil { + return nil, err + } + result := &Ucred{ + ucred: ucred, + } + // set the finalizer on the result so that the ucred will be freed + runtime.SetFinalizer(result, ucredFinalizer) + return result, nil +} + +func UcredGet(pid int) (*Ucred, error) { + ucred, err := ucredGet(pid) + if err != nil { + return nil, err + } + result := &Ucred{ + ucred: ucred, + } + // set the finalizer on the result so that the ucred will be freed + runtime.SetFinalizer(result, ucredFinalizer) + return result, nil +} + +func (u *Ucred) Geteuid() int { + defer runtime.KeepAlive(u) + return ucredGeteuid(u.ucred) +} + +func (u *Ucred) Getruid() int { + defer runtime.KeepAlive(u) + return ucredGetruid(u.ucred) +} + +func (u *Ucred) Getsuid() int { + defer runtime.KeepAlive(u) + return ucredGetsuid(u.ucred) +} + +func (u *Ucred) Getegid() int { + defer runtime.KeepAlive(u) + return ucredGetegid(u.ucred) +} + +func (u *Ucred) Getrgid() int { + defer runtime.KeepAlive(u) + return ucredGetrgid(u.ucred) +} + +func (u *Ucred) Getsgid() int { + defer runtime.KeepAlive(u) + return ucredGetsgid(u.ucred) +} + +func (u *Ucred) Getpid() int { + defer runtime.KeepAlive(u) + return ucredGetpid(u.ucred) +} diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go index 6ebc48b3..4f432bfe 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -1245,6 +1245,7 @@ const ( FAN_REPORT_DFID_NAME = 0xc00 FAN_REPORT_DFID_NAME_TARGET = 0x1e00 FAN_REPORT_DIR_FID = 0x400 + FAN_REPORT_FD_ERROR = 0x2000 FAN_REPORT_FID = 0x200 FAN_REPORT_NAME = 0x800 FAN_REPORT_PIDFD = 0x80 @@ -1330,8 +1331,10 @@ const ( FUSE_SUPER_MAGIC = 0x65735546 FUTEXFS_SUPER_MAGIC = 0xbad1dea F_ADD_SEALS = 0x409 + F_CREATED_QUERY = 0x404 F_DUPFD = 0x0 F_DUPFD_CLOEXEC = 0x406 + F_DUPFD_QUERY = 0x403 F_EXLCK = 0x4 F_GETFD = 0x1 F_GETFL = 0x3 @@ -1551,6 +1554,7 @@ const ( IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e IPPROTO_SCTP = 0x84 + IPPROTO_SMC = 0x100 IPPROTO_TCP = 0x6 IPPROTO_TP = 0x1d IPPROTO_UDP = 0x11 @@ -1623,6 +1627,8 @@ const ( IPV6_UNICAST_IF = 0x4c IPV6_USER_FLOW = 0xe IPV6_V6ONLY = 0x1a + IPV6_VERSION = 0x60 + IPV6_VERSION_MASK = 0xf0 IPV6_XFRM_POLICY = 0x23 IP_ADD_MEMBERSHIP = 0x23 IP_ADD_SOURCE_MEMBERSHIP = 0x27 @@ -1867,6 +1873,7 @@ const ( MADV_UNMERGEABLE = 0xd MADV_WILLNEED = 0x3 MADV_WIPEONFORK = 0x12 + MAP_DROPPABLE = 0x8 MAP_FILE = 0x0 MAP_FIXED = 0x10 MAP_FIXED_NOREPLACE = 0x100000 @@ -1967,6 +1974,7 @@ const ( MSG_PEEK = 0x2 MSG_PROXY = 0x10 MSG_RST = 0x1000 + MSG_SOCK_DEVMEM = 0x2000000 MSG_SYN = 0x400 MSG_TRUNC = 0x20 MSG_TRYHARD = 0x4 @@ -2083,6 +2091,7 @@ const ( NFC_ATR_REQ_MAXSIZE = 0x40 NFC_ATR_RES_GB_MAXSIZE = 0x2f NFC_ATR_RES_MAXSIZE = 0x40 + NFC_ATS_MAXSIZE = 0x14 NFC_COMM_ACTIVE = 0x0 NFC_COMM_PASSIVE = 0x1 NFC_DEVICE_NAME_MAXSIZE = 0x8 @@ -2163,6 +2172,7 @@ const ( NFNL_SUBSYS_QUEUE = 0x3 NFNL_SUBSYS_ULOG = 0x4 NFS_SUPER_MAGIC = 0x6969 + NFT_BITWISE_BOOL = 0x0 NFT_CHAIN_FLAGS = 0x7 NFT_CHAIN_MAXNAMELEN = 0x100 NFT_CT_MAX = 0x17 @@ -2491,6 +2501,7 @@ const ( PR_GET_PDEATHSIG = 0x2 PR_GET_SECCOMP = 0x15 PR_GET_SECUREBITS = 0x1b + PR_GET_SHADOW_STACK_STATUS = 0x4a PR_GET_SPECULATION_CTRL = 0x34 PR_GET_TAGGED_ADDR_CTRL = 0x38 PR_GET_THP_DISABLE = 0x2a @@ -2499,6 +2510,7 @@ const ( PR_GET_TIMING = 0xd PR_GET_TSC = 0x19 PR_GET_UNALIGN = 0x5 + PR_LOCK_SHADOW_STACK_STATUS = 0x4c PR_MCE_KILL = 0x21 PR_MCE_KILL_CLEAR = 0x0 PR_MCE_KILL_DEFAULT = 0x2 @@ -2525,6 +2537,8 @@ const ( PR_PAC_GET_ENABLED_KEYS = 0x3d PR_PAC_RESET_KEYS = 0x36 PR_PAC_SET_ENABLED_KEYS = 0x3c + PR_PMLEN_MASK = 0x7f000000 + PR_PMLEN_SHIFT = 0x18 PR_PPC_DEXCR_CTRL_CLEAR = 0x4 PR_PPC_DEXCR_CTRL_CLEAR_ONEXEC = 0x10 PR_PPC_DEXCR_CTRL_EDITABLE = 0x1 @@ -2592,6 +2606,7 @@ const ( PR_SET_PTRACER = 0x59616d61 PR_SET_SECCOMP = 0x16 PR_SET_SECUREBITS = 0x1c + PR_SET_SHADOW_STACK_STATUS = 0x4b PR_SET_SPECULATION_CTRL = 0x35 PR_SET_SYSCALL_USER_DISPATCH = 0x3b PR_SET_TAGGED_ADDR_CTRL = 0x37 @@ -2602,6 +2617,9 @@ const ( PR_SET_UNALIGN = 0x6 PR_SET_VMA = 0x53564d41 PR_SET_VMA_ANON_NAME = 0x0 + PR_SHADOW_STACK_ENABLE = 0x1 + PR_SHADOW_STACK_PUSH = 0x4 + PR_SHADOW_STACK_WRITE = 0x2 PR_SME_GET_VL = 0x40 PR_SME_SET_VL = 0x3f PR_SME_SET_VL_ONEXEC = 0x40000 @@ -2911,7 +2929,6 @@ const ( RTM_NEWNEXTHOP = 0x68 RTM_NEWNEXTHOPBUCKET = 0x74 RTM_NEWNSID = 0x58 - RTM_NEWNVLAN = 0x70 RTM_NEWPREFIX = 0x34 RTM_NEWQDISC = 0x24 RTM_NEWROUTE = 0x18 @@ -2920,6 +2937,7 @@ const ( RTM_NEWTCLASS = 0x28 RTM_NEWTFILTER = 0x2c RTM_NEWTUNNEL = 0x78 + RTM_NEWVLAN = 0x70 RTM_NR_FAMILIES = 0x1b RTM_NR_MSGTYPES = 0x6c RTM_SETDCB = 0x4f diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go index c0d45e32..75207613 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -116,6 +116,8 @@ const ( IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 + IPV6_FLOWINFO_MASK = 0xffffff0f + IPV6_FLOWLABEL_MASK = 0xffff0f00 ISIG = 0x1 IUCLC = 0x200 IXOFF = 0x1000 @@ -304,6 +306,7 @@ const ( SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 + SCM_TS_OPT_ID = 0x51 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SECCOMP_IOCTL_NOTIF_ADDFD = 0x40182103 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go index c731d24f..c68acda5 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -116,6 +116,8 @@ const ( IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 + IPV6_FLOWINFO_MASK = 0xffffff0f + IPV6_FLOWLABEL_MASK = 0xffff0f00 ISIG = 0x1 IUCLC = 0x200 IXOFF = 0x1000 @@ -305,6 +307,7 @@ const ( SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 + SCM_TS_OPT_ID = 0x51 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SECCOMP_IOCTL_NOTIF_ADDFD = 0x40182103 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go index 680018a4..a8c607ab 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go @@ -115,6 +115,8 @@ const ( IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 + IPV6_FLOWINFO_MASK = 0xffffff0f + IPV6_FLOWLABEL_MASK = 0xffff0f00 ISIG = 0x1 IUCLC = 0x200 IXOFF = 0x1000 @@ -310,6 +312,7 @@ const ( SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 + SCM_TS_OPT_ID = 0x51 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SECCOMP_IOCTL_NOTIF_ADDFD = 0x40182103 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go index a63909f3..18563dd8 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -109,6 +109,7 @@ const ( F_SETOWN = 0x8 F_UNLCK = 0x2 F_WRLCK = 0x1 + GCS_MAGIC = 0x47435300 HIDIOCGRAWINFO = 0x80084803 HIDIOCGRDESC = 0x90044802 HIDIOCGRDESCSIZE = 0x80044801 @@ -119,6 +120,8 @@ const ( IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 + IPV6_FLOWINFO_MASK = 0xffffff0f + IPV6_FLOWLABEL_MASK = 0xffff0f00 ISIG = 0x1 IUCLC = 0x200 IXOFF = 0x1000 @@ -302,6 +305,7 @@ const ( SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 + SCM_TS_OPT_ID = 0x51 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SECCOMP_IOCTL_NOTIF_ADDFD = 0x40182103 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go index 9b0a2573..22912cda 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go @@ -116,6 +116,8 @@ const ( IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 + IPV6_FLOWINFO_MASK = 0xffffff0f + IPV6_FLOWLABEL_MASK = 0xffff0f00 ISIG = 0x1 IUCLC = 0x200 IXOFF = 0x1000 @@ -297,6 +299,7 @@ const ( SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 + SCM_TS_OPT_ID = 0x51 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SECCOMP_IOCTL_NOTIF_ADDFD = 0x40182103 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go index 958e6e06..29344eb3 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go @@ -115,6 +115,8 @@ const ( IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x80 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 + IPV6_FLOWINFO_MASK = 0xfffffff + IPV6_FLOWLABEL_MASK = 0xfffff ISIG = 0x1 IUCLC = 0x200 IXOFF = 0x1000 @@ -303,6 +305,7 @@ const ( SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 + SCM_TS_OPT_ID = 0x51 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SECCOMP_IOCTL_NOTIF_ADDFD = 0x80182103 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go index 50c7f25b..20d51fb9 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go @@ -115,6 +115,8 @@ const ( IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x80 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 + IPV6_FLOWINFO_MASK = 0xfffffff + IPV6_FLOWLABEL_MASK = 0xfffff ISIG = 0x1 IUCLC = 0x200 IXOFF = 0x1000 @@ -303,6 +305,7 @@ const ( SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 + SCM_TS_OPT_ID = 0x51 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SECCOMP_IOCTL_NOTIF_ADDFD = 0x80182103 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go index ced21d66..321b6090 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go @@ -115,6 +115,8 @@ const ( IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x80 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 + IPV6_FLOWINFO_MASK = 0xffffff0f + IPV6_FLOWLABEL_MASK = 0xffff0f00 ISIG = 0x1 IUCLC = 0x200 IXOFF = 0x1000 @@ -303,6 +305,7 @@ const ( SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 + SCM_TS_OPT_ID = 0x51 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SECCOMP_IOCTL_NOTIF_ADDFD = 0x80182103 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go index 226c0441..9bacdf1e 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go @@ -115,6 +115,8 @@ const ( IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x80 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 + IPV6_FLOWINFO_MASK = 0xffffff0f + IPV6_FLOWLABEL_MASK = 0xffff0f00 ISIG = 0x1 IUCLC = 0x200 IXOFF = 0x1000 @@ -303,6 +305,7 @@ const ( SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 + SCM_TS_OPT_ID = 0x51 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SECCOMP_IOCTL_NOTIF_ADDFD = 0x80182103 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go index 3122737c..c2242726 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go @@ -115,6 +115,8 @@ const ( IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 + IPV6_FLOWINFO_MASK = 0xfffffff + IPV6_FLOWLABEL_MASK = 0xfffff ISIG = 0x80 IUCLC = 0x1000 IXOFF = 0x400 @@ -358,6 +360,7 @@ const ( SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 + SCM_TS_OPT_ID = 0x51 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SECCOMP_IOCTL_NOTIF_ADDFD = 0x80182103 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go index eb5d3467..6270c8ee 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go @@ -115,6 +115,8 @@ const ( IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 + IPV6_FLOWINFO_MASK = 0xfffffff + IPV6_FLOWLABEL_MASK = 0xfffff ISIG = 0x80 IUCLC = 0x1000 IXOFF = 0x400 @@ -362,6 +364,7 @@ const ( SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 + SCM_TS_OPT_ID = 0x51 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SECCOMP_IOCTL_NOTIF_ADDFD = 0x80182103 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go index e921ebc6..9966c194 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go @@ -115,6 +115,8 @@ const ( IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 + IPV6_FLOWINFO_MASK = 0xffffff0f + IPV6_FLOWLABEL_MASK = 0xffff0f00 ISIG = 0x80 IUCLC = 0x1000 IXOFF = 0x400 @@ -362,6 +364,7 @@ const ( SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 + SCM_TS_OPT_ID = 0x51 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SECCOMP_IOCTL_NOTIF_ADDFD = 0x80182103 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go index 38ba81c5..848e5fcc 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go @@ -115,6 +115,8 @@ const ( IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 + IPV6_FLOWINFO_MASK = 0xffffff0f + IPV6_FLOWLABEL_MASK = 0xffff0f00 ISIG = 0x1 IUCLC = 0x200 IXOFF = 0x1000 @@ -294,6 +296,7 @@ const ( SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 + SCM_TS_OPT_ID = 0x51 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SECCOMP_IOCTL_NOTIF_ADDFD = 0x40182103 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go index 71f04009..669b2adb 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go @@ -115,6 +115,8 @@ const ( IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 + IPV6_FLOWINFO_MASK = 0xfffffff + IPV6_FLOWLABEL_MASK = 0xfffff ISIG = 0x1 IUCLC = 0x200 IXOFF = 0x1000 @@ -366,6 +368,7 @@ const ( SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 + SCM_TS_OPT_ID = 0x51 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SECCOMP_IOCTL_NOTIF_ADDFD = 0x40182103 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go index c44a3133..4834e575 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go @@ -119,6 +119,8 @@ const ( IN_CLOEXEC = 0x400000 IN_NONBLOCK = 0x4000 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 + IPV6_FLOWINFO_MASK = 0xfffffff + IPV6_FLOWLABEL_MASK = 0xfffff ISIG = 0x1 IUCLC = 0x200 IXOFF = 0x1000 @@ -357,6 +359,7 @@ const ( SCM_TIMESTAMPING_OPT_STATS = 0x38 SCM_TIMESTAMPING_PKTINFO = 0x3c SCM_TIMESTAMPNS = 0x21 + SCM_TS_OPT_ID = 0x5a SCM_TXTIME = 0x3f SCM_WIFI_STATUS = 0x25 SECCOMP_IOCTL_NOTIF_ADDFD = 0x80182103 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go index 24b346e1..813c05b6 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go @@ -2512,6 +2512,90 @@ var libc_munmap_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_readv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_readv readv "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_preadv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_preadv preadv "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_writev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_writev writev "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pwritev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pwritev pwritev "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := syscall_syscall(libc_fstat64_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s index ebd21310..fda32858 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s @@ -738,6 +738,26 @@ TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB) +TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_readv(SB) +GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_readv_trampoline_addr(SB)/8, $libc_readv_trampoline<>(SB) + +TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_preadv(SB) +GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_preadv_trampoline_addr(SB)/8, $libc_preadv_trampoline<>(SB) + +TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_writev(SB) +GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_writev_trampoline_addr(SB)/8, $libc_writev_trampoline<>(SB) + +TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pwritev(SB) +GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pwritev_trampoline_addr(SB)/8, $libc_pwritev_trampoline<>(SB) + TEXT libc_fstat64_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstat64(SB) GLOBL ·libc_fstat64_trampoline_addr(SB), RODATA, $8 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go index 824b9c2d..e6f58f3c 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go @@ -2512,6 +2512,90 @@ var libc_munmap_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_readv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_readv readv "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_preadv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_preadv preadv "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_writev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_writev writev "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pwritev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pwritev pwritev "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := syscall_syscall(libc_fstat_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s index 4f178a22..7f8998b9 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s @@ -738,6 +738,26 @@ TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB) +TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_readv(SB) +GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_readv_trampoline_addr(SB)/8, $libc_readv_trampoline<>(SB) + +TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_preadv(SB) +GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_preadv_trampoline_addr(SB)/8, $libc_preadv_trampoline<>(SB) + +TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_writev(SB) +GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_writev_trampoline_addr(SB)/8, $libc_writev_trampoline<>(SB) + +TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pwritev(SB) +GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pwritev_trampoline_addr(SB)/8, $libc_pwritev_trampoline<>(SB) + TEXT libc_fstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstat(SB) GLOBL ·libc_fstat_trampoline_addr(SB), RODATA, $8 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go index 829b87fe..c6545413 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go @@ -141,6 +141,16 @@ import ( //go:cgo_import_dynamic libc_getpeername getpeername "libsocket.so" //go:cgo_import_dynamic libc_setsockopt setsockopt "libsocket.so" //go:cgo_import_dynamic libc_recvfrom recvfrom "libsocket.so" +//go:cgo_import_dynamic libc_getpeerucred getpeerucred "libc.so" +//go:cgo_import_dynamic libc_ucred_get ucred_get "libc.so" +//go:cgo_import_dynamic libc_ucred_geteuid ucred_geteuid "libc.so" +//go:cgo_import_dynamic libc_ucred_getegid ucred_getegid "libc.so" +//go:cgo_import_dynamic libc_ucred_getruid ucred_getruid "libc.so" +//go:cgo_import_dynamic libc_ucred_getrgid ucred_getrgid "libc.so" +//go:cgo_import_dynamic libc_ucred_getsuid ucred_getsuid "libc.so" +//go:cgo_import_dynamic libc_ucred_getsgid ucred_getsgid "libc.so" +//go:cgo_import_dynamic libc_ucred_getpid ucred_getpid "libc.so" +//go:cgo_import_dynamic libc_ucred_free ucred_free "libc.so" //go:cgo_import_dynamic libc_port_create port_create "libc.so" //go:cgo_import_dynamic libc_port_associate port_associate "libc.so" //go:cgo_import_dynamic libc_port_dissociate port_dissociate "libc.so" @@ -280,6 +290,16 @@ import ( //go:linkname procgetpeername libc_getpeername //go:linkname procsetsockopt libc_setsockopt //go:linkname procrecvfrom libc_recvfrom +//go:linkname procgetpeerucred libc_getpeerucred +//go:linkname procucred_get libc_ucred_get +//go:linkname procucred_geteuid libc_ucred_geteuid +//go:linkname procucred_getegid libc_ucred_getegid +//go:linkname procucred_getruid libc_ucred_getruid +//go:linkname procucred_getrgid libc_ucred_getrgid +//go:linkname procucred_getsuid libc_ucred_getsuid +//go:linkname procucred_getsgid libc_ucred_getsgid +//go:linkname procucred_getpid libc_ucred_getpid +//go:linkname procucred_free libc_ucred_free //go:linkname procport_create libc_port_create //go:linkname procport_associate libc_port_associate //go:linkname procport_dissociate libc_port_dissociate @@ -420,6 +440,16 @@ var ( procgetpeername, procsetsockopt, procrecvfrom, + procgetpeerucred, + procucred_get, + procucred_geteuid, + procucred_getegid, + procucred_getruid, + procucred_getrgid, + procucred_getsuid, + procucred_getsgid, + procucred_getpid, + procucred_free, procport_create, procport_associate, procport_dissociate, @@ -2029,6 +2059,90 @@ func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Sockl // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func getpeerucred(fd uintptr, ucred *uintptr) (err error) { + _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procgetpeerucred)), 2, uintptr(fd), uintptr(unsafe.Pointer(ucred)), 0, 0, 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ucredGet(pid int) (ucred uintptr, err error) { + r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procucred_get)), 1, uintptr(pid), 0, 0, 0, 0, 0) + ucred = uintptr(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ucredGeteuid(ucred uintptr) (uid int) { + r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procucred_geteuid)), 1, uintptr(ucred), 0, 0, 0, 0, 0) + uid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ucredGetegid(ucred uintptr) (gid int) { + r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procucred_getegid)), 1, uintptr(ucred), 0, 0, 0, 0, 0) + gid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ucredGetruid(ucred uintptr) (uid int) { + r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procucred_getruid)), 1, uintptr(ucred), 0, 0, 0, 0, 0) + uid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ucredGetrgid(ucred uintptr) (gid int) { + r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procucred_getrgid)), 1, uintptr(ucred), 0, 0, 0, 0, 0) + gid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ucredGetsuid(ucred uintptr) (uid int) { + r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procucred_getsuid)), 1, uintptr(ucred), 0, 0, 0, 0, 0) + uid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ucredGetsgid(ucred uintptr) (gid int) { + r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procucred_getsgid)), 1, uintptr(ucred), 0, 0, 0, 0, 0) + gid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ucredGetpid(ucred uintptr) (pid int) { + r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procucred_getpid)), 1, uintptr(ucred), 0, 0, 0, 0, 0) + pid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ucredFree(ucred uintptr) { + sysvicall6(uintptr(unsafe.Pointer(&procucred_free)), 1, uintptr(ucred), 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func port_create() (n int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procport_create)), 0, 0, 0, 0, 0, 0, 0) n = int(r0) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go index 524b0820..c79aaff3 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go @@ -458,4 +458,8 @@ const ( SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 SYS_MSEAL = 462 + SYS_SETXATTRAT = 463 + SYS_GETXATTRAT = 464 + SYS_LISTXATTRAT = 465 + SYS_REMOVEXATTRAT = 466 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go index f485dbf4..5eb45069 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go @@ -381,4 +381,8 @@ const ( SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 SYS_MSEAL = 462 + SYS_SETXATTRAT = 463 + SYS_GETXATTRAT = 464 + SYS_LISTXATTRAT = 465 + SYS_REMOVEXATTRAT = 466 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go index 70b35bf3..05e50297 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go @@ -422,4 +422,8 @@ const ( SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 SYS_MSEAL = 462 + SYS_SETXATTRAT = 463 + SYS_GETXATTRAT = 464 + SYS_LISTXATTRAT = 465 + SYS_REMOVEXATTRAT = 466 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go index 1893e2fe..38c53ec5 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go @@ -325,4 +325,8 @@ const ( SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 SYS_MSEAL = 462 + SYS_SETXATTRAT = 463 + SYS_GETXATTRAT = 464 + SYS_LISTXATTRAT = 465 + SYS_REMOVEXATTRAT = 466 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go index 16a4017d..31d2e71a 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go @@ -321,4 +321,8 @@ const ( SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 SYS_MSEAL = 462 + SYS_SETXATTRAT = 463 + SYS_GETXATTRAT = 464 + SYS_LISTXATTRAT = 465 + SYS_REMOVEXATTRAT = 466 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go index 7e567f1e..f4184a33 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go @@ -442,4 +442,8 @@ const ( SYS_LSM_SET_SELF_ATTR = 4460 SYS_LSM_LIST_MODULES = 4461 SYS_MSEAL = 4462 + SYS_SETXATTRAT = 4463 + SYS_GETXATTRAT = 4464 + SYS_LISTXATTRAT = 4465 + SYS_REMOVEXATTRAT = 4466 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go index 38ae55e5..05b99622 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go @@ -372,4 +372,8 @@ const ( SYS_LSM_SET_SELF_ATTR = 5460 SYS_LSM_LIST_MODULES = 5461 SYS_MSEAL = 5462 + SYS_SETXATTRAT = 5463 + SYS_GETXATTRAT = 5464 + SYS_LISTXATTRAT = 5465 + SYS_REMOVEXATTRAT = 5466 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go index 55e92e60..43a256e9 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go @@ -372,4 +372,8 @@ const ( SYS_LSM_SET_SELF_ATTR = 5460 SYS_LSM_LIST_MODULES = 5461 SYS_MSEAL = 5462 + SYS_SETXATTRAT = 5463 + SYS_GETXATTRAT = 5464 + SYS_LISTXATTRAT = 5465 + SYS_REMOVEXATTRAT = 5466 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go index 60658d6a..eea5ddfc 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go @@ -442,4 +442,8 @@ const ( SYS_LSM_SET_SELF_ATTR = 4460 SYS_LSM_LIST_MODULES = 4461 SYS_MSEAL = 4462 + SYS_SETXATTRAT = 4463 + SYS_GETXATTRAT = 4464 + SYS_LISTXATTRAT = 4465 + SYS_REMOVEXATTRAT = 4466 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go index e203e8a7..0d777bfb 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go @@ -449,4 +449,8 @@ const ( SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 SYS_MSEAL = 462 + SYS_SETXATTRAT = 463 + SYS_GETXATTRAT = 464 + SYS_LISTXATTRAT = 465 + SYS_REMOVEXATTRAT = 466 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go index 5944b97d..b4463650 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go @@ -421,4 +421,8 @@ const ( SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 SYS_MSEAL = 462 + SYS_SETXATTRAT = 463 + SYS_GETXATTRAT = 464 + SYS_LISTXATTRAT = 465 + SYS_REMOVEXATTRAT = 466 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go index c66d416d..0c7d21c1 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go @@ -421,4 +421,8 @@ const ( SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 SYS_MSEAL = 462 + SYS_SETXATTRAT = 463 + SYS_GETXATTRAT = 464 + SYS_LISTXATTRAT = 465 + SYS_REMOVEXATTRAT = 466 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go index a5459e76..84053916 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go @@ -326,4 +326,8 @@ const ( SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 SYS_MSEAL = 462 + SYS_SETXATTRAT = 463 + SYS_GETXATTRAT = 464 + SYS_LISTXATTRAT = 465 + SYS_REMOVEXATTRAT = 466 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go index 01d86825..fcf1b790 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go @@ -387,4 +387,8 @@ const ( SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 SYS_MSEAL = 462 + SYS_SETXATTRAT = 463 + SYS_GETXATTRAT = 464 + SYS_LISTXATTRAT = 465 + SYS_REMOVEXATTRAT = 466 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go index 7b703e77..52d15b5f 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go @@ -400,4 +400,8 @@ const ( SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 SYS_MSEAL = 462 + SYS_SETXATTRAT = 463 + SYS_GETXATTRAT = 464 + SYS_LISTXATTRAT = 465 + SYS_REMOVEXATTRAT = 466 ) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go index 5537148d..a46abe64 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -4747,7 +4747,7 @@ const ( NL80211_ATTR_MAC_HINT = 0xc8 NL80211_ATTR_MAC_MASK = 0xd7 NL80211_ATTR_MAX_AP_ASSOC_STA = 0xca - NL80211_ATTR_MAX = 0x14c + NL80211_ATTR_MAX = 0x14d NL80211_ATTR_MAX_CRIT_PROT_DURATION = 0xb4 NL80211_ATTR_MAX_CSA_COUNTERS = 0xce NL80211_ATTR_MAX_MATCH_SETS = 0x85 @@ -5519,7 +5519,7 @@ const ( NL80211_MNTR_FLAG_CONTROL = 0x3 NL80211_MNTR_FLAG_COOK_FRAMES = 0x5 NL80211_MNTR_FLAG_FCSFAIL = 0x1 - NL80211_MNTR_FLAG_MAX = 0x6 + NL80211_MNTR_FLAG_MAX = 0x7 NL80211_MNTR_FLAG_OTHER_BSS = 0x4 NL80211_MNTR_FLAG_PLCPFAIL = 0x2 NL80211_MPATH_FLAG_ACTIVE = 0x1 @@ -6174,3 +6174,5 @@ type SockDiagReq struct { Family uint8 Protocol uint8 } + +const RTM_NEWNVLAN = 0x70 diff --git a/vendor/golang.org/x/sys/windows/dll_windows.go b/vendor/golang.org/x/sys/windows/dll_windows.go index 4e613cf6..3ca814f5 100644 --- a/vendor/golang.org/x/sys/windows/dll_windows.go +++ b/vendor/golang.org/x/sys/windows/dll_windows.go @@ -43,8 +43,8 @@ type DLL struct { // LoadDLL loads DLL file into memory. // // Warning: using LoadDLL without an absolute path name is subject to -// DLL preloading attacks. To safely load a system DLL, use LazyDLL -// with System set to true, or use LoadLibraryEx directly. +// DLL preloading attacks. To safely load a system DLL, use [NewLazySystemDLL], +// or use [LoadLibraryEx] directly. func LoadDLL(name string) (dll *DLL, err error) { namep, err := UTF16PtrFromString(name) if err != nil { @@ -271,6 +271,9 @@ func (d *LazyDLL) NewProc(name string) *LazyProc { } // NewLazyDLL creates new LazyDLL associated with DLL file. +// +// Warning: using NewLazyDLL without an absolute path name is subject to +// DLL preloading attacks. To safely load a system DLL, use [NewLazySystemDLL]. func NewLazyDLL(name string) *LazyDLL { return &LazyDLL{Name: name} } @@ -410,7 +413,3 @@ func loadLibraryEx(name string, system bool) (*DLL, error) { } return &DLL{Name: name, Handle: h}, nil } - -type errString string - -func (s errString) Error() string { return string(s) } diff --git a/vendor/golang.org/x/sys/windows/types_windows.go b/vendor/golang.org/x/sys/windows/types_windows.go index 9d138de5..ad67df2f 100644 --- a/vendor/golang.org/x/sys/windows/types_windows.go +++ b/vendor/golang.org/x/sys/windows/types_windows.go @@ -1074,6 +1074,7 @@ const ( IP_ADD_MEMBERSHIP = 0xc IP_DROP_MEMBERSHIP = 0xd IP_PKTINFO = 0x13 + IP_MTU_DISCOVER = 0x47 IPV6_V6ONLY = 0x1b IPV6_UNICAST_HOPS = 0x4 @@ -1083,6 +1084,7 @@ const ( IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd IPV6_PKTINFO = 0x13 + IPV6_MTU_DISCOVER = 0x47 MSG_OOB = 0x1 MSG_PEEK = 0x2 @@ -1132,6 +1134,15 @@ const ( WSASYS_STATUS_LEN = 128 ) +// enum PMTUD_STATE from ws2ipdef.h +const ( + IP_PMTUDISC_NOT_SET = 0 + IP_PMTUDISC_DO = 1 + IP_PMTUDISC_DONT = 2 + IP_PMTUDISC_PROBE = 3 + IP_PMTUDISC_MAX = 4 +) + type WSABuf struct { Len uint32 Buf *byte @@ -1146,6 +1157,22 @@ type WSAMsg struct { Flags uint32 } +type WSACMSGHDR struct { + Len uintptr + Level int32 + Type int32 +} + +type IN_PKTINFO struct { + Addr [4]byte + Ifindex uint32 +} + +type IN6_PKTINFO struct { + Addr [16]byte + Ifindex uint32 +} + // Flags for WSASocket const ( WSA_FLAG_OVERLAPPED = 0x01 diff --git a/vendor/golang.org/x/term/terminal.go b/vendor/golang.org/x/term/terminal.go index f636667f..14f89470 100644 --- a/vendor/golang.org/x/term/terminal.go +++ b/vendor/golang.org/x/term/terminal.go @@ -44,6 +44,8 @@ type Terminal struct { // bytes, as an index into |line|). If it returns ok=false, the key // press is processed normally. Otherwise it returns a replacement line // and the new cursor position. + // + // This will be disabled during ReadPassword. AutoCompleteCallback func(line string, pos int, key rune) (newLine string, newPos int, ok bool) // Escape contains a pointer to the escape codes for this terminal. @@ -692,6 +694,8 @@ func (t *Terminal) Write(buf []byte) (n int, err error) { // ReadPassword temporarily changes the prompt and reads a password, without // echo, from the terminal. +// +// The AutoCompleteCallback is disabled during this call. func (t *Terminal) ReadPassword(prompt string) (line string, err error) { t.lock.Lock() defer t.lock.Unlock() @@ -699,6 +703,11 @@ func (t *Terminal) ReadPassword(prompt string) (line string, err error) { oldPrompt := t.prompt t.prompt = []rune(prompt) t.echo = false + oldAutoCompleteCallback := t.AutoCompleteCallback + t.AutoCompleteCallback = nil + defer func() { + t.AutoCompleteCallback = oldAutoCompleteCallback + }() line, err = t.readLine() diff --git a/vendor/modules.txt b/vendor/modules.txt index 59fa3d32..a37cf461 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,4 +1,4 @@ -# github.com/bitrise-io/go-pkcs12 v0.0.0-20230913085202-b40653eb06c7 +# github.com/bitrise-io/go-pkcs12 v0.1.0 ## explicit; go 1.19 github.com/bitrise-io/go-pkcs12 github.com/bitrise-io/go-pkcs12/internal/rc2 @@ -10,11 +10,11 @@ github.com/bitrise-io/go-plist github.com/bitrise-io/go-steputils/cache github.com/bitrise-io/go-steputils/input github.com/bitrise-io/go-steputils/tools -# github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.23 +# github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.37 ## explicit; go 1.17 github.com/bitrise-io/go-steputils/v2/ruby github.com/bitrise-io/go-steputils/v2/stepconf -# github.com/bitrise-io/go-utils v1.0.12 +# github.com/bitrise-io/go-utils v1.0.14 ## explicit; go 1.13 github.com/bitrise-io/go-utils/colorstring github.com/bitrise-io/go-utils/command @@ -57,7 +57,7 @@ github.com/bitrise-io/go-xcode/xcodeproject/serialized github.com/bitrise-io/go-xcode/xcodeproject/xcodeproj github.com/bitrise-io/go-xcode/xcodeproject/xcscheme github.com/bitrise-io/go-xcode/xcodeproject/xcworkspace -# github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.54.0.20250408104939-27c790ba5555 +# github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.55 ## explicit; go 1.22 github.com/bitrise-io/go-xcode/v2/autocodesign github.com/bitrise-io/go-xcode/v2/autocodesign/certdownloader @@ -86,7 +86,7 @@ github.com/davecgh/go-spew/spew # github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa ## explicit github.com/fullsailor/pkcs7 -# github.com/golang-jwt/jwt/v4 v4.5.0 +# github.com/golang-jwt/jwt/v4 v4.5.2 ## explicit; go 1.16 github.com/golang-jwt/jwt/v4 # github.com/google/go-cmp v0.6.0 @@ -100,7 +100,7 @@ github.com/hashicorp/go-cleanhttp # github.com/hashicorp/go-retryablehttp v0.7.7 ## explicit; go 1.19 github.com/hashicorp/go-retryablehttp -# github.com/hashicorp/go-version v1.6.0 +# github.com/hashicorp/go-version v1.7.0 ## explicit github.com/hashicorp/go-version # github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 @@ -128,20 +128,20 @@ github.com/stretchr/testify/assert github.com/stretchr/testify/assert/yaml github.com/stretchr/testify/mock github.com/stretchr/testify/require -# golang.org/x/crypto v0.31.0 -## explicit; go 1.20 +# golang.org/x/crypto v0.37.0 +## explicit; go 1.23.0 golang.org/x/crypto/pbkdf2 golang.org/x/crypto/ssh/terminal -# golang.org/x/sys v0.28.0 -## explicit; go 1.18 +# golang.org/x/sys v0.32.0 +## explicit; go 1.23.0 golang.org/x/sys/plan9 golang.org/x/sys/unix golang.org/x/sys/windows -# golang.org/x/term v0.27.0 -## explicit; go 1.18 +# golang.org/x/term v0.31.0 +## explicit; go 1.23.0 golang.org/x/term -# golang.org/x/text v0.21.0 -## explicit; go 1.18 +# golang.org/x/text v0.24.0 +## explicit; go 1.23.0 golang.org/x/text/transform golang.org/x/text/unicode/norm # gopkg.in/yaml.v3 v3.0.1 From 9ce59c4f04d0667fe1ef04a3f52161779eba521f Mon Sep 17 00:00:00 2001 From: LaszloP <7979773+lpusok@users.noreply.github.com> Date: Tue, 8 Apr 2025 17:03:28 +0200 Subject: [PATCH 06/11] dep update --- go.mod | 2 +- go.sum | 4 +- .../exportoptionsgenerator.go | 41 ++++++++----- .../v2/exportoptionsgenerator/targets.go | 3 +- .../go-xcode/v2/xcodeversion/utility.go | 60 +++++++------------ .../go-xcode/v2/xcodeversion/xcodeversion.go | 14 ++++- vendor/modules.txt | 2 +- 7 files changed, 68 insertions(+), 58 deletions(-) diff --git a/go.mod b/go.mod index f0ee361a..dd98cb2a 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/bitrise-io/go-utils v1.0.14 github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.23 github.com/bitrise-io/go-xcode v1.3.0 - github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.55 + github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.56 github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 github.com/stretchr/testify v1.10.0 gopkg.in/yaml.v3 v3.0.1 diff --git a/go.sum b/go.sum index 4a65b910..c62ceafb 100644 --- a/go.sum +++ b/go.sum @@ -13,8 +13,8 @@ github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.23 h1:Dfh4nyZPuEtilBisidejqxBrkx9 github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.23/go.mod h1:3XUplo0dOWc3DqT2XA2SeHToDSg7+j1y1HTHibT2H68= github.com/bitrise-io/go-xcode v1.3.0 h1:QB8Vyr2oZQro/ocs9DJai80rlYL1hU1kwjHqdGslFLo= github.com/bitrise-io/go-xcode v1.3.0/go.mod h1:9OwsvrhZ4A2JxHVoEY7CPcABAKA+OE7FQqFfBfvbFuY= -github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.55 h1:hLLVWstKv0KZZexCWE9so1mDB4MnDZK2TrX5jz2AYpI= -github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.55/go.mod h1:T4rhWQljdgH5As4Dq/RQWuazdScY0YB7uZAMuBUnxeY= +github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.56 h1:JSwOStu6HCkT6b7icTQ3x/0OBNPQ8mD7Q6vQt2hG7fg= +github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.56/go.mod h1:zoLzT5fJE8V2SeYq0D0Z+ZN2FAzERjV3uiqDg5H8Bug= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/exportoptionsgenerator.go b/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/exportoptionsgenerator.go index 32ff1828..6eff3b9c 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/exportoptionsgenerator.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/exportoptionsgenerator.go @@ -10,6 +10,7 @@ import ( "github.com/bitrise-io/go-xcode/exportoptions" "github.com/bitrise-io/go-xcode/plistutil" "github.com/bitrise-io/go-xcode/profileutil" + "github.com/bitrise-io/go-xcode/v2/xcodeversion" "github.com/bitrise-io/go-xcode/xcodeproject/serialized" "github.com/bitrise-io/go-xcode/xcodeproject/xcodeproj" "github.com/bitrise-io/go-xcode/xcodeproject/xcscheme" @@ -26,6 +27,7 @@ type ExportOptionsGenerator struct { scheme *xcscheme.Scheme configuration string + xcodeVersionReader xcodeversion.Reader certificateProvider CodesignIdentityProvider profileProvider ProvisioningProfileProvider targetInfoProvider TargetInfoProvider @@ -33,11 +35,12 @@ type ExportOptionsGenerator struct { } // New constructs a new ExportOptionsGenerator. -func New(xcodeProj *xcodeproj.XcodeProj, scheme *xcscheme.Scheme, configuration string, logger log.Logger) ExportOptionsGenerator { +func New(xcodeProj *xcodeproj.XcodeProj, scheme *xcscheme.Scheme, configuration string, xcodeVersionReader xcodeversion.Reader, logger log.Logger) ExportOptionsGenerator { g := ExportOptionsGenerator{ - xcodeProj: xcodeProj, - scheme: scheme, - configuration: configuration, + xcodeProj: xcodeProj, + scheme: scheme, + configuration: configuration, + xcodeVersionReader: xcodeVersionReader, } g.certificateProvider = LocalCodesignIdentityProvider{} g.profileProvider = LocalProvisioningProfileProvider{} @@ -55,26 +58,30 @@ func (g ExportOptionsGenerator) GenerateApplicationExportOptions( compileBitcode bool, archivedWithXcodeManagedProfiles bool, codeSigningStyle exportoptions.SigningStyle, - xcodeMajorVersion int64, testFlightInternalTestingOnly bool, ) (exportoptions.ExportOptions, error) { + xcodeVersion, err := g.xcodeVersionReader.GetVersion() + if err != nil { + return nil, fmt.Errorf("failed to get Xcode version: %w", err) + } + mainTargetBundleID, entitlementsByBundleID, err := g.applicationTargetsAndEntitlements(exportMethod) if err != nil { return nil, err } - iCloudContainerEnvironment, err := determineIcloudContainerEnvironment(containerEnvironment, entitlementsByBundleID, exportMethod, xcodeMajorVersion) + iCloudContainerEnvironment, err := determineIcloudContainerEnvironment(containerEnvironment, entitlementsByBundleID, exportMethod, xcodeVersion.Major) if err != nil { return nil, err } - exportOpts := generateBaseExportOptions(exportMethod, uploadBitcode, compileBitcode, iCloudContainerEnvironment) + exportOpts := generateBaseExportOptions(exportMethod, xcodeVersion, uploadBitcode, compileBitcode, iCloudContainerEnvironment) - if xcodeMajorVersion >= 12 { + if xcodeVersion.Major >= 12 { exportOpts = addDistributionBundleIdentifierFromXcode12(exportOpts, mainTargetBundleID) } - if xcodeMajorVersion >= 13 { + if xcodeVersion.Major >= 13 { exportOpts = disableManagedBuildNumberFromXcode13(exportOpts) } @@ -92,7 +99,7 @@ func (g ExportOptionsGenerator) GenerateApplicationExportOptions( exportOpts = addManualSigningFields(exportOpts, codeSignGroup, archivedWithXcodeManagedProfiles, g.logger) } - if xcodeMajorVersion >= 15 { + if xcodeVersion.Major >= 15 { if testFlightInternalTestingOnly { exportOpts = addTestFlightInternalTestingOnly(exportOpts, testFlightInternalTestingOnly) } @@ -292,11 +299,11 @@ func determineIcloudContainerEnvironment(desiredIcloudContainerEnvironment strin } // From Xcode 9 iCloudContainerEnvironment is required for every export method, before that version only for non app-store exports. - if xcodeMajorVersion < 9 && exportMethod == exportoptions.MethodAppStore { + if xcodeMajorVersion < 9 && exportMethod.IsAppStore() { return "", nil } - if exportMethod == exportoptions.MethodAppStore { + if exportMethod.IsAppStore() { return "Production", nil } @@ -332,9 +339,13 @@ func projectUsesCloudKit(bundleIDEntitlementsMap map[string]plistutil.PlistData) } // generateBaseExportOptions creates a default exportOptions introduced in Xcode 7. -func generateBaseExportOptions(exportMethod exportoptions.Method, cfgUploadBitcode, cfgCompileBitcode bool, iCloudContainerEnvironment string) exportoptions.ExportOptions { - if exportMethod == exportoptions.MethodAppStore { - appStoreOptions := exportoptions.NewAppStoreOptions() +func generateBaseExportOptions(exportMethod exportoptions.Method, xcodeVersion xcodeversion.Version, cfgUploadBitcode, cfgCompileBitcode bool, iCloudContainerEnvironment string) exportoptions.ExportOptions { + if xcodeVersion.IsGreaterThanOrEqualTo(15, 3) { + exportMethod = exportoptions.UpgradeToXcode15_3MethodName(exportMethod) + } + + if exportMethod.IsAppStore() { + appStoreOptions := exportoptions.NewAppStoreConnectOptions(exportMethod) appStoreOptions.UploadBitcode = cfgUploadBitcode if iCloudContainerEnvironment != "" { appStoreOptions.ICloudContainerEnvironment = exportoptions.ICloudContainerEnvironment(iCloudContainerEnvironment) diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/targets.go b/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/targets.go index fa2d9042..b503f9a5 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/targets.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator/targets.go @@ -2,6 +2,7 @@ package exportoptionsgenerator import ( "fmt" + "github.com/bitrise-io/go-xcode/exportoptions" "github.com/bitrise-io/go-xcode/xcodeproject/serialized" "github.com/bitrise-io/go-xcode/xcodeproject/xcodeproj" @@ -62,7 +63,7 @@ func filterApplicationBundleTargets(targets []xcodeproj.Target, exportMethod exp // Development App Clip Profile // // .., - if exportMethod != exportoptions.MethodAppStore && target.IsAppClipProduct() { + if !exportMethod.IsAppStore() && target.IsAppClipProduct() { continue } diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/utility.go b/vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/utility.go index bcd2b50b..ca542714 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/utility.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/utility.go @@ -2,58 +2,44 @@ package xcodeversion import ( "fmt" + "regexp" "strconv" - "strings" ) func getXcodeVersionFromXcodebuildOutput(outStr string) (Version, error) { - split := strings.Split(outStr, "\n") - if len(split) == 0 { - return Version{}, fmt.Errorf("failed to parse xcodebuild version output (%s)", outStr) + versionRegexp := regexp.MustCompile(`(?m)^Xcode +(\d+)(\.(\d+))?.*$`) + buildVersionRegexp := regexp.MustCompile(`(?m)^Build version +(\w.*)$`) + + xcodeVersionMatch := versionRegexp.FindStringSubmatch(outStr) + if len(xcodeVersionMatch) < 4 { + return Version{}, fmt.Errorf("couldn't find Xcode version in output: (%s)", outStr) } - filteredOutput, err := filterXcodeWarnings(split) + xcodebuildVersion := xcodeVersionMatch[0] + majorVersionStr := xcodeVersionMatch[1] + majorVersion, err := strconv.Atoi(majorVersionStr) if err != nil { - return Version{}, err + return Version{}, fmt.Errorf("failed to parse xcodebuild major version (output %s): %w", outStr, err) } - xcodebuildVersion := filteredOutput[0] - buildVersion := filteredOutput[1] - - split = strings.Split(xcodebuildVersion, " ") - if len(split) != 2 { - return Version{}, fmt.Errorf("failed to parse xcodebuild version output (%s)", outStr) + minorVersion := int(0) + minorVersionStr := xcodeVersionMatch[3] + if minorVersionStr != "" { + if minorVersion, err = strconv.Atoi(minorVersionStr); err != nil { + return Version{}, fmt.Errorf("failed to parse xcodebuild minor version (output %s): %w", outStr, err) + } } - version := split[1] - - split = strings.Split(version, ".") - majorVersionStr := split[0] - - majorVersion, err := strconv.ParseInt(majorVersionStr, 10, 32) - if err != nil { - return Version{}, fmt.Errorf("failed to parse xcodebuild version output (%s), error: %s", outStr, err) + buildVersionMatch := buildVersionRegexp.FindStringSubmatch(outStr) + buildVersion := "unknown" + if len(buildVersionMatch) >= 2 { + buildVersion = buildVersionMatch[1] } return Version{ Version: xcodebuildVersion, BuildVersion: buildVersion, - MajorVersion: majorVersion, + Major: int64(majorVersion), + Minor: int64(minorVersion), }, nil } - -func filterXcodeWarnings(cmdOutputLines []string) ([]string, error) { - firstLineIndex := -1 - for i, line := range cmdOutputLines { - if strings.HasPrefix(line, "Xcode ") { - firstLineIndex = i - break - } - } - - if firstLineIndex < 0 { - return []string{}, fmt.Errorf("couldn't find Xcode version in output: %s", cmdOutputLines) - } - - return cmdOutputLines[firstLineIndex:], nil -} diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/xcodeversion.go b/vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/xcodeversion.go index acb7f755..a28c3652 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/xcodeversion.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/xcodeversion.go @@ -10,7 +10,8 @@ import ( type Version struct { Version string BuildVersion string - MajorVersion int64 + Major int64 + Minor int64 } // Reader ... @@ -40,3 +41,14 @@ func (b *reader) GetVersion() (Version, error) { return getXcodeVersionFromXcodebuildOutput(outStr) } + +// IsGreaterThanOrEqualTo checks if the Xcode version is greater than or equal to the given major and minor version. +func (v Version) IsGreaterThanOrEqualTo(major, minor int64) bool { + if v.Major > major { + return true + } + if v.Major == major && v.Minor >= minor { + return true + } + return false +} diff --git a/vendor/modules.txt b/vendor/modules.txt index a37cf461..88b08d6c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -57,7 +57,7 @@ github.com/bitrise-io/go-xcode/xcodeproject/serialized github.com/bitrise-io/go-xcode/xcodeproject/xcodeproj github.com/bitrise-io/go-xcode/xcodeproject/xcscheme github.com/bitrise-io/go-xcode/xcodeproject/xcworkspace -# github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.55 +# github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.56 ## explicit; go 1.22 github.com/bitrise-io/go-xcode/v2/autocodesign github.com/bitrise-io/go-xcode/v2/autocodesign/certdownloader From 277f65a417568ccd9204ba13cb89860787dff99c Mon Sep 17 00:00:00 2001 From: LaszloP <7979773+lpusok@users.noreply.github.com> Date: Tue, 8 Apr 2025 17:22:01 +0200 Subject: [PATCH 07/11] use Apple Dev cert --- e2e/bitrise.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/e2e/bitrise.yml b/e2e/bitrise.yml index 7b71743b..931e5869 100644 --- a/e2e/bitrise.yml +++ b/e2e/bitrise.yml @@ -39,7 +39,7 @@ workflows: # - BITRISE_SCHEME: World # - CODE_SIGNING_METHOD: api-key # - MIN_DAYS_PROFILE_VALID: 0 - # - FORCE_CODE_SIGN_IDENTITY: "iPhone Developer: Tooling Bot Bitrise" + # - FORCE_CODE_SIGN_IDENTITY: "Apple Development: Tooling Bot Bitrise" # - TEAM_ID: 72SA8V3WYL # - FORCE_PROV_PROFILE_SPECIFIER: "" # - IPA_EXPORT_METHOD: development @@ -163,7 +163,7 @@ workflows: - automatic_code_signing: $CODE_SIGNING_METHOD - xcconfig_content: | COMPILER_INDEX_STORE_ENABLE = NO - CODE_SIGN_IDENTITY = iPhone Developer: Tooling Bot Bitrise + CODE_SIGN_IDENTITY = Apple Development: Tooling Bot Bitrise - distribution_method: $IPA_EXPORT_METHOD - icloud_container_environment: $IPA_EXPORT_ICLOUD_CONTAINER_ENVIRONMENT - export_development_team: $TEAM_ID @@ -191,7 +191,7 @@ workflows: - CODE_SIGNING_METHOD: api-key - XCCONFIG_CONTENT: | COMPILER_INDEX_STORE_ENABLE = NO - CODE_SIGN_IDENTITY = iPhone Developer: Tooling Bot Bitrise + CODE_SIGN_IDENTITY = Apple Development: Tooling Bot Bitrise - MIN_DAYS_PROFILE_VALID: 0 - IPA_EXPORT_METHOD: development - LOG_FORMATTER: xcodebuild @@ -444,7 +444,7 @@ workflows: - BITRISE_SCHEME: Catalyst Sample - CODE_SIGNING_METHOD: api-key - MIN_DAYS_PROFILE_VALID: 0 - - FORCE_CODE_SIGN_IDENTITY: "iPhone Developer: Tooling Bot Bitrise" + - FORCE_CODE_SIGN_IDENTITY: "Apple Development: Tooling Bot Bitrise" - TEAM_ID: 72SA8V3WYL - FORCE_PROV_PROFILE_SPECIFIER: "" - IPA_EXPORT_METHOD: development From 7531c800bc406d6ed793d9c2ecbfcc62603a43a0 Mon Sep 17 00:00:00 2001 From: LaszloP <7979773+lpusok@users.noreply.github.com> Date: Mon, 31 Mar 2025 15:35:15 +0200 Subject: [PATCH 08/11] Revert passing additional options --- step/step.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/step/step.go b/step/step.go index a6783c93..3c6500b6 100644 --- a/step/step.go +++ b/step/step.go @@ -816,7 +816,12 @@ func (s XcodebuildArchiver) xcodeArchive(opts xcodeArchiveOpts) (xcodeArchiveRes s.logger.TInfof("Reading xcode project") - platform, err := BuildableTargetPlatform(xcodeProj, scheme, configuration, opts.AdditionalOptions, XcodeBuild{}, s.logger) + // When Package.resolved is embedded in the workspace, passing additional options can cause failure ("-onlyUsePackageVersionsFromResolvedFile" "-skipMacroValidation" "-skipPackagePluginValidation") + // a resolved file is required when automatic dependency resolution is disabled and should be placed at /git/sample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved. + // An alternative to passing "-onlyUsePackageVersionsFromResolvedFile" or "-disableAutomaticPackageResolution" is to set the following defaults in a Script Step: + // defaults write com.apple.dt.Xcode IDEPackageOnlyUseVersionsFromResolvedFile + // defaults write com.apple.dt.Xcode IDEDisableAutomaticPackageResolution + platform, err := BuildableTargetPlatform(xcodeProj, scheme, configuration, []string{}, XcodeBuild{}, s.logger) if err != nil { return out, fmt.Errorf("failed to read project platform: %s: %s", opts.ProjectPath, err) } From fcd9b96b97982deddc66ce57555c4783d696d373 Mon Sep 17 00:00:00 2001 From: LaszloP <7979773+lpusok@users.noreply.github.com> Date: Tue, 8 Apr 2025 19:23:13 +0200 Subject: [PATCH 09/11] Add lock Swift packges input --- main.go | 2 ++ step.yml | 18 ++++++++++++++++++ step/step.go | 18 ++++++++++++++---- step/utils.go | 25 +++++++++++++++++++++++++ 4 files changed, 59 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 20e794e1..39087502 100644 --- a/main.go +++ b/main.go @@ -103,6 +103,8 @@ func createRunOptions(config step.Config) step.RunOpts { XcodeMajorVersion: config.XcodeMajorVersion, ArtifactName: config.ArtifactName, + ShouldLockSwiftPackages: config.ShouldLockSwiftPackages, + CodesignManager: config.CodesignManager, PerformCleanAction: config.PerformCleanAction, diff --git a/step.yml b/step.yml index d909f397..9ae8fe14 100644 --- a/step.yml +++ b/step.yml @@ -115,6 +115,24 @@ inputs: The input value sets xcodebuild's `-configuration` option. +- lock_swift_packages: "yes" + opts: + category: xcodebuild configuration + title: Disable Swift Package Manager automatic resolution + summary: If this input is set, the Step will disable Swift Package Manager automatic resolution. + description: |- + If this input is set, the Step will disable Swift Package Manager automatic resolution. + + When enabled, runs the following: + ``` + defaults write com.apple.dt.Xcode IDEPackageOnlyUseVersionsFromResolvedFile -bool YES + defaults write com.apple.dt.Xcode IDEDisableAutomaticPackageResolution -bool YES + ``` + value_options: + - "yes" + - "no" + is_required: true + - xcconfig_content: COMPILER_INDEX_STORE_ENABLE = NO opts: category: xcodebuild configuration diff --git a/step/step.go b/step/step.go index 3c6500b6..8d1edc9f 100644 --- a/step/step.go +++ b/step/step.go @@ -76,10 +76,11 @@ type Inputs struct { ExportMethod string `env:"distribution_method,opt[app-store,ad-hoc,enterprise,development]"` // xcodebuild configuration - Configuration string `env:"configuration"` - XcconfigContent string `env:"xcconfig_content"` - PerformCleanAction bool `env:"perform_clean_action,opt[yes,no]"` - XcodebuildOptions string `env:"xcodebuild_options"` + Configuration string `env:"configuration"` + ShouldLockSwiftPackages bool `env:"lock_swift_packages,opt[yes,no]"` + XcconfigContent string `env:"xcconfig_content"` + PerformCleanAction bool `env:"perform_clean_action,opt[yes,no]"` + XcodebuildOptions string `env:"xcodebuild_options"` // xcodebuild log formatting LogFormatter string `env:"log_formatter,opt[xcbeautify,xcodebuild,xcpretty]"` @@ -319,6 +320,8 @@ type RunOpts struct { XcodeMajorVersion int ArtifactName string + ShouldLockSwiftPackages bool + // Code signing, nil if automatic code signing is "off" CodesignManager *codesign.Manager @@ -361,6 +364,13 @@ func (s XcodebuildArchiver) Run(opts RunOpts) (RunResult, error) { s.logger.Println() if opts.XcodeMajorVersion >= 11 { + if opts.ShouldLockSwiftPackages { + s.logger.Infof("Swift package dependencies are locked, disabling automatic updates") + if err := lockSwiftPackages(s.logger, s.cmdFactory); err != nil { + return out, fmt.Errorf("failed to lock swift packages: %w", err) + } + } + s.logger.Infof("Running resolve Swift package dependencies") // Resolve Swift package dependencies, so running -showBuildSettings later is faster later // Specifying a scheme is required for workspaces diff --git a/step/utils.go b/step/utils.go index 1cce2a76..b2042a84 100644 --- a/step/utils.go +++ b/step/utils.go @@ -3,12 +3,14 @@ package step import ( "bufio" "fmt" + "os" "regexp" "strings" "github.com/bitrise-io/go-utils/colorstring" "github.com/bitrise-io/go-utils/sliceutil" "github.com/bitrise-io/go-utils/stringutil" + "github.com/bitrise-io/go-utils/v2/command" "github.com/bitrise-io/go-utils/v2/log" "github.com/bitrise-io/go-xcode/exportoptions" ) @@ -91,3 +93,26 @@ func findIDEDistrubutionLogsPath(output string, logger log.Logger) (string, erro return "", nil } + +func lockSwiftPackages(logger log.Logger, cmdFactory command.Factory) error { + // defaults write com.apple.dt.Xcode IDEPackageOnlyUseVersionsFromResolvedFile -bool YES + // defaults write com.apple.dt.Xcode IDEDisableAutomaticPackageResolution -bool YES + + cmdOpts := &command.Opts{ + Stdout: os.Stdout, + Stderr: os.Stderr, + } + deafultsCommands := []command.Command{ + cmdFactory.Create("defaults", []string{"write", "com.apple.dt.Xcode", "IDEPackageOnlyUseVersionsFromResolvedFile", "-bool", "YES"}, cmdOpts), + cmdFactory.Create("defaults", []string{"write", "com.apple.dt.Xcode", "IDEDisableAutomaticPackageResolution", "-bool", "YES"}, cmdOpts), + } + + for _, cmd := range deafultsCommands { + logger.Printf("$ %s", cmd.PrintableCommandArgs()) + if err := cmd.Run(); err != nil { + return fmt.Errorf("Locking Swift pacakges failed: %w", err) + } + } + + return nil +} From 6ce168c223aaa21c69f3762dc11d730e99f4bff2 Mon Sep 17 00:00:00 2001 From: LaszloP <7979773+lpusok@users.noreply.github.com> Date: Tue, 8 Apr 2025 19:23:17 +0200 Subject: [PATCH 10/11] Revert "Revert passing additional options" This reverts commit 7531c800bc406d6ed793d9c2ecbfcc62603a43a0. --- step/step.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/step/step.go b/step/step.go index 8d1edc9f..5a146223 100644 --- a/step/step.go +++ b/step/step.go @@ -826,12 +826,7 @@ func (s XcodebuildArchiver) xcodeArchive(opts xcodeArchiveOpts) (xcodeArchiveRes s.logger.TInfof("Reading xcode project") - // When Package.resolved is embedded in the workspace, passing additional options can cause failure ("-onlyUsePackageVersionsFromResolvedFile" "-skipMacroValidation" "-skipPackagePluginValidation") - // a resolved file is required when automatic dependency resolution is disabled and should be placed at /git/sample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved. - // An alternative to passing "-onlyUsePackageVersionsFromResolvedFile" or "-disableAutomaticPackageResolution" is to set the following defaults in a Script Step: - // defaults write com.apple.dt.Xcode IDEPackageOnlyUseVersionsFromResolvedFile - // defaults write com.apple.dt.Xcode IDEDisableAutomaticPackageResolution - platform, err := BuildableTargetPlatform(xcodeProj, scheme, configuration, []string{}, XcodeBuild{}, s.logger) + platform, err := BuildableTargetPlatform(xcodeProj, scheme, configuration, opts.AdditionalOptions, XcodeBuild{}, s.logger) if err != nil { return out, fmt.Errorf("failed to read project platform: %s: %s", opts.ProjectPath, err) } From c5ecc599deb2bf7bf8a95048e5d9538bbc6e6d7f Mon Sep 17 00:00:00 2001 From: LaszloP <7979773+lpusok@users.noreply.github.com> Date: Tue, 8 Apr 2025 19:45:03 +0200 Subject: [PATCH 11/11] Added readme --- README.md | 1 + e2e/bitrise.yml | 3 +++ step.yml | 6 +++--- step/utils.go | 5 +---- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4ee75d17..f479e870 100644 --- a/README.md +++ b/README.md @@ -125,6 +125,7 @@ Build a development IPA with custom xcconfig file path: | `scheme` | Xcode Scheme name. The input value sets xcodebuild's `-scheme` option. | required | `$BITRISE_SCHEME` | | `distribution_method` | Describes how Xcode should export the archive. The input value sets the method in the export options plist content. From Xcode 15.3 onwards, updated methods are used: - `debugging`, when `development` is selected - `app-store-connect`, when `app-store` is selected - `release-testing`, when `ad-hoc` is selected - `enterprise` is unchanged | required | `development` | | `configuration` | Xcode Build Configuration. If not specified, the default Build Configuration will be used. The input value sets xcodebuild's `-configuration` option. | | | +| `lock_swift_packages` | If this input is set, the Step will disable Swift Package Manager automatic resolution. When enabled, runs the following: ``` defaults write com.apple.dt.Xcode IDEPackageOnlyUseVersionsFromResolvedFile -bool YES defaults write com.apple.dt.Xcode IDEDisableAutomaticPackageResolution -bool YES ``` | required | `no` | | `xcconfig_content` | Build settings to override the project's build settings, using xcodebuild's `-xcconfig` option. You can't define `-xcconfig` option in `Additional options for the xcodebuild command` if this input is set. If empty, no setting is changed. When set it can be either: 1. Existing `.xcconfig` file path. Example: `./ios-sample/ios-sample/Configurations/Dev.xcconfig` 2. The contents of a newly created temporary `.xcconfig` file. (This is the default.) Build settings must be separated by newline character (`\n`). Example: ``` COMPILER_INDEX_STORE_ENABLE = NO ONLY_ACTIVE_ARCH[config=Debug][sdk=*][arch=*] = YES ``` | | `COMPILER_INDEX_STORE_ENABLE = NO` | | `perform_clean_action` | If this input is set, `clean` xcodebuild action will be performed besides the `archive` action. | required | `no` | | `xcodebuild_options` | Additional options to be added to the executed xcodebuild command. Prefer using `Build settings (xcconfig)` input for specifying `-xcconfig` option. You can't use both. `-destination` is set automatically, unless specified explicitely. | | | diff --git a/e2e/bitrise.yml b/e2e/bitrise.yml index 931e5869..b0a8c9e0 100644 --- a/e2e/bitrise.yml +++ b/e2e/bitrise.yml @@ -102,6 +102,7 @@ workflows: inputs: - project_path: ./_tmp/ios-simple-objc/ios-simple-objc.xcodeproj - scheme: ios-simple-objc + - lock_swift_packages: "yes" - automatic_code_signing: api-key - certificate_url_list: $BITFALL_APPLE_IOS_CERTIFICATE_NOPASSPHRASE_URL - passphrase_list: "" @@ -161,6 +162,7 @@ workflows: - project_path: ./_tmp/$BITRISE_PROJECT_PATH - scheme: $BITRISE_SCHEME - automatic_code_signing: $CODE_SIGNING_METHOD + - lock_swift_packages: "yes" - xcconfig_content: | COMPILER_INDEX_STORE_ENABLE = NO CODE_SIGN_IDENTITY = Apple Development: Tooling Bot Bitrise @@ -484,6 +486,7 @@ workflows: inputs: - project_path: ./_tmp/$BITRISE_PROJECT_PATH - scheme: $BITRISE_SCHEME + - lock_swift_packages: "yes" - automatic_code_signing: $CODE_SIGNING_METHOD - min_profile_validity: $MIN_DAYS_PROFILE_VALID - certificate_url_list: $BITFALL_APPLE_APPLE_CERTIFICATE_URL_LIST|$BITFALL_APPLE_IOS_CERTIFICATE_URL_LIST diff --git a/step.yml b/step.yml index fe27db64..acc41cc5 100644 --- a/step.yml +++ b/step.yml @@ -125,7 +125,7 @@ inputs: The input value sets xcodebuild's `-configuration` option. -- lock_swift_packages: "yes" +- lock_swift_packages: "no" opts: category: xcodebuild configuration title: Disable Swift Package Manager automatic resolution @@ -135,8 +135,8 @@ inputs: When enabled, runs the following: ``` - defaults write com.apple.dt.Xcode IDEPackageOnlyUseVersionsFromResolvedFile -bool YES - defaults write com.apple.dt.Xcode IDEDisableAutomaticPackageResolution -bool YES + defaults write com.apple.dt.Xcode IDEPackageOnlyUseVersionsFromResolvedFile -bool YES + defaults write com.apple.dt.Xcode IDEDisableAutomaticPackageResolution -bool YES ``` value_options: - "yes" diff --git a/step/utils.go b/step/utils.go index b2042a84..719e3ef8 100644 --- a/step/utils.go +++ b/step/utils.go @@ -95,9 +95,6 @@ func findIDEDistrubutionLogsPath(output string, logger log.Logger) (string, erro } func lockSwiftPackages(logger log.Logger, cmdFactory command.Factory) error { - // defaults write com.apple.dt.Xcode IDEPackageOnlyUseVersionsFromResolvedFile -bool YES - // defaults write com.apple.dt.Xcode IDEDisableAutomaticPackageResolution -bool YES - cmdOpts := &command.Opts{ Stdout: os.Stdout, Stderr: os.Stderr, @@ -108,7 +105,7 @@ func lockSwiftPackages(logger log.Logger, cmdFactory command.Factory) error { } for _, cmd := range deafultsCommands { - logger.Printf("$ %s", cmd.PrintableCommandArgs()) + logger.TPrintf("$ %s", cmd.PrintableCommandArgs()) if err := cmd.Run(); err != nil { return fmt.Errorf("Locking Swift pacakges failed: %w", err) }