Skip to content

Commit

Permalink
Fix errors with node 22.x in cflinuxfs3 (skip this version line)
Browse files Browse the repository at this point in the history
  • Loading branch information
brayanhenao authored and robdimsdale committed Jun 3, 2024
1 parent 561beb5 commit a730fae
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions pipelines/config/dependency-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ dependencies:
link: https://github.com/nodejs/Release
source_type: node
versions_to_keep: 2
skip_lines_cflinuxfs3: [ '22.X.X' ]
php:
buildpacks:
php:
Expand Down
6 changes: 4 additions & 2 deletions pipelines/dependency-builds.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ private_key = '((cf-buildpacks-eng-github-ssh-key.private_key))'
jobs:
<% dependencies.each do |dep_name, dep| %>
<%
skipped_version_lines = dep['skip_lines_cflinuxfs4'] ? dep['skip_lines_cflinuxfs4'] : []
skipped_version_lines_fs4 = dep['skip_lines_cflinuxfs4'] ? dep['skip_lines_cflinuxfs4'] : []
skipped_version_lines_fs3 = dep['skip_lines_cflinuxfs3'] ? dep['skip_lines_cflinuxfs3'] : []
version_lines = dep['buildpacks'].values.reduce([]) {|sum, bp| sum | get_version_lines(bp['lines'], ['latest'])}
%>
<% if is_multiline?(dep) %>
Expand Down Expand Up @@ -365,7 +366,8 @@ version_lines = dep['buildpacks'].values.reduce([]) {|sum, bp| sum | get_version
- in_parallel:
<%
build_stacks = dep['any_stack'] ? ['any-stack'] : specific_stack
build_stacks = build_stacks - ['cflinuxfs4'] if skipped_version_lines.map(&:downcase).include?(line.downcase)
build_stacks = build_stacks - ['cflinuxfs4'] if skipped_version_lines_fs4.map(&:downcase).include?(line.downcase)
build_stacks = build_stacks - ['cflinuxfs3'] if skipped_version_lines_fs3.map(&:downcase).include?(line.downcase)
%>
<% build_stacks.each do |stack| %>
- do:
Expand Down
9 changes: 4 additions & 5 deletions tasks/build-binary-new/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ def setup_python
Runner.run('rm', '-f', 'get-pip.py')
end

def setup_gcc11
def setup_gcc
Runner.run('apt', 'update')
Runner.run('apt', 'install', '-y', 'software-properties-common')
Runner.run('add-apt-repository', '-y', 'ppa:ubuntu-toolchain-r/test')
Runner.run('apt', 'update')
Runner.run('apt', 'install', '-y', 'gcc-11', 'g++-11')
Runner.run('update-alternatives', '--install', '/usr/bin/gcc', 'gcc', '/usr/bin/gcc-11', '60', '--slave', '/usr/bin/g++', 'g++', '/usr/bin/g++-11')
Runner.run('apt', 'install', '-y', 'gcc-8', 'g++-8')
Runner.run('update-alternatives', '--install', '/usr/bin/gcc', 'gcc', '/usr/bin/gcc-8', '60', '--slave', '/usr/bin/g++', 'g++', '/usr/bin/g++-8')
end

def bundle_pip_dependencies(source_input)
Expand Down Expand Up @@ -683,8 +683,7 @@ def execute(binary_builder, stack, source_input, build_input, build_output, arti
)

when 'node', 'httpd'
DependencyBuild.setup_python
DependencyBuild.setup_gcc11
DependencyBuild.setup_gcc

source_input.version = source_input.version.delete_prefix('v') if source_input.name == 'node'
binary_builder.build(source_input)
Expand Down
6 changes: 6 additions & 0 deletions tasks/update-buildpack-dependency/run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ def is_null(value)
stacks = stacks - ['cflinuxfs4']
end

# Logic to skip certain version lines that are not supported in cflinuxfs3
skip_lines_cflinuxfs3 = config['dependencies'][source_name].key?('skip_lines_cflinuxfs3') ? config['dependencies'][source_name]['skip_lines_cflinuxfs3'].map(&:downcase) : []
if skip_lines_cflinuxfs3.include?(version_line.downcase)
stacks = stacks - ['cflinuxfs3']
end

stacks = WINDOWS_STACKS if source_name == 'hwc'
total_stacks = total_stacks | stacks

Expand Down

0 comments on commit a730fae

Please sign in to comment.