Skip to content

Commit be48def

Browse files
Robert Marshallbalasankarc
andcommitted
Merge branch '8207-fix-asset-compilation-rpi-32' into 'master'
Set max memory for node during asset compilation only on 32 bit OSs Closes https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8207 See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7174 Merged-by: Robert Marshall <[email protected]> Approved-by: Robert Marshall <[email protected]> Approved-by: Andrew Patterson <[email protected]> Co-authored-by: Balasankar "Balu" C <[email protected]>
2 parents 1fab82e + 07aae13 commit be48def

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

config/software/gitlab-rails.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,9 @@
158158
'PATH' => "#{install_dir}/embedded/bin:#{Gitlab::Util.get_env('PATH')}",
159159
'SKIP_STORAGE_VALIDATION' => 'true',
160160
'SKIP_DATABASE_CONFIG_VALIDATION' => 'true',
161-
'NODE_OPTIONS' => '--max_old_space_size=3584'
162161
}
162+
assets_compile_env['NODE_OPTIONS'] = '--max_old_space_size=3584' if OhaiHelper.is_32_bit?
163+
163164
assets_compile_env['NO_SOURCEMAPS'] = 'true' if Gitlab::Util.get_env('NO_SOURCEMAPS')
164165
command 'yarn install --pure-lockfile --production'
165166

lib/gitlab/ohai_helper.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,10 @@ def raspberry_pi?
180180
os_platform == 'raspbian'
181181
end
182182

183+
def is_32_bit?
184+
`getconf LONG_BIT`.strip == "32"
185+
end
186+
183187
def gcc_target
184188
ohai['languages']['c']['gcc']['target']
185189
end

0 commit comments

Comments
 (0)