Skip to content

Commit 4ae8142

Browse files
committed
Revert "Reapply "Reduce initial memory usage by auto-loading bundled gems (2) (#3088)""
This reverts commit b363a5c.
1 parent 0707065 commit 4ae8142

File tree

5 files changed

+12
-23
lines changed

5 files changed

+12
-23
lines changed

gems/aws-sdk-core/lib/aws-sdk-core.rb

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,15 @@
109109
# defaults
110110
require_relative 'aws-defaults'
111111

112-
# plugins - loaded through service clients as needed.
112+
# plugins
113+
# loaded through building STS or SSO ..
114+
115+
# aws-sdk-sts is included to support Aws::AssumeRoleCredentials
116+
require_relative 'aws-sdk-sts'
117+
118+
# aws-sdk-sso is included to support Aws::SSOCredentials
119+
require_relative 'aws-sdk-sso'
120+
require_relative 'aws-sdk-ssooidc'
113121

114122
module Aws
115123

@@ -197,14 +205,3 @@ def eager_autoload!(*args)
197205

198206
end
199207
end
200-
201-
# Autoload bundled service gems used in credential providers
202-
# need to ensure that the files are the local files from aws-sdk-core
203-
# and not the installed, legacy/dummy service gems.
204-
205-
# aws-sdk-sts is included to support Aws::AssumeRoleCredentials
206-
Aws.autoload :STS, File.join(__dir__, 'aws-sdk-sts.rb')
207-
208-
# aws-sdk-sso is included to support Aws::SSOCredentials
209-
Aws.autoload :SSO, File.join(__dir__, 'aws-sdk-sso.rb')
210-
Aws.autoload :SSOOIDC, File.join(__dir__, 'aws-sdk-ssooidc.rb')

gems/aws-sdk-resources/CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Unreleased Changes
1717

1818
* Issue - Remove autoloads for service gems bundled in `aws-sdk-core` (STS, SSO, SSOOIDC).
1919

20-
3.201.0 (2024-08-12)
2120
------------------
2221

2322
* Feature - Removed a dependency on the deprecated `aws-sdk-codestar` gem.

gems/aws-sdk-resources/bin/aws-v3.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,11 @@ def env_bool key, default
106106
# The Aws namespace used to check autoload requires aws-sdk-resources.
107107
require 'aws-sdk-resources'
108108

109-
# Finally load all of the gems.
110-
# Don't update the load path for gems bundled in core.
111-
core_gems = [:STS, :SSO, :SSOOIDC]
109+
# Finally load all of the gems. Core is loaded a second time because of STS.
112110
if File.directory?(File.expand_path('../../../../build_tools', __FILE__))
113111
gems = []
114112
Aws.constants.each do |const_name|
115-
if Aws.autoload?(const_name) && !core_gems.include?(const_name)
113+
if Aws.autoload?(const_name)
116114
gems << "aws-sdk-#{const_name.downcase}"
117115
end
118116
end

tasks/build.rake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ end
2828
# It is need to provide session credentials and assume role support.
2929
# Only building source, but not gemspecs, version file, etc.
3030
task 'build:aws-sdk-sts' do
31-
Aws::STS if Aws.autoload?(:STS) # force autoload from core
3231
sts = BuildTools::Services.service('sts')
3332
generator = AwsSdkCodeGenerator::CodeBuilder.new(
3433
aws_sdk_core_lib_path: $CORE_LIB,
@@ -49,7 +48,6 @@ end
4948
# It is need to provide SSO Credentials.
5049
# Only building source, but not gemspecs, version file, etc.
5150
task 'build:aws-sdk-sso' do
52-
Aws::SSO if Aws.autoload?(:SSO) # force autoload from core
5351
sso = BuildTools::Services.service('sso')
5452
generator = AwsSdkCodeGenerator::CodeBuilder.new(
5553
aws_sdk_core_lib_path: $CORE_LIB,
@@ -68,7 +66,6 @@ end
6866
# Aws::SSOOIDC is generated directly into the `aws-sdk-core` gem.
6967
# Only building source, but not gemspecs, version file, etc.
7068
task 'build:aws-sdk-ssooidc' do
71-
Aws::SSOOIDC if Aws.autoload?(:SSOOIDC) # force autoload from core
7269
ssooidc = BuildTools::Services.service('ssooidc')
7370
generator = AwsSdkCodeGenerator::CodeBuilder.new(
7471
aws_sdk_core_lib_path: $CORE_LIB,

tasks/update-aws-sdk-dependencies.rake

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ task 'update-aws-sdk-dependencies' do
1919
)
2020

2121
# update the module autoloads
22-
# Remove service gems bundled in core (eg, sts) that have gem_name of aws-sdk-core.
23-
autoload_services = BuildTools::Services.select { |svc| svc.gem_name != 'aws-sdk-core' }
2422
BuildTools.replace_lines(
2523
filename: "#{$GEMS_DIR}/aws-sdk-resources/lib/aws-sdk-resources.rb",
2624
start: /# service gems/,
2725
stop: /# end service gems/,
28-
new_lines: autoload_services.map { |service|
26+
new_lines: BuildTools::Services.map { |service|
2927
" autoload :#{service.name}, '#{service.gem_name}'\n"
3028
}
3129
)

0 commit comments

Comments
 (0)