Skip to content

Conversation

@ramonskie
Copy link
Contributor

Summary

Remove legacy compile-extensions infrastructure from buildpacks CI pipeline now that all Cloud Foundry buildpacks have migrated to Go-based packaging with compile_extensions: false.

Background

The compile-extensions submodule and Ruby gem-based buildpack-packager were deprecated in favor of Go-based tooling from github.com/cloudfoundry/libbuildpack/packager/buildpack-packager. PHP buildpack was the last holdout using compile_extensions: true, which has now been modernized in cloudfoundry/php-buildpack#1200.

Changes

1. Pipeline Resources Removed (pipelines/buildpack/pipeline.yml)

Removed resources (66 lines):

  • compile-extensions git resource
  • buildpack-packager GitHub release resource
  • update-compile-extensions job (auto-updated compile-extensions submodule)
  • update-buildpack-packager job (auto-updated buildpack-packager gem)

These resources were only active when compile_extensions: true, which no buildpack now uses.

2. Legacy Packaging Logic Removed (tasks/detect-and-upload/buildpack-tagger.rb)

Removed (30 lines):

if File.exist?('compile-extensions')
  # Old PHP buildpack style with Ruby gem packaging
  export BUNDLE_GEMFILE=cf.Gemfile
  
  # Hardcoded PHP v4.5.3 Gemfile URLs
  wget https://github.com/cloudfoundry/php-buildpack/raw/v4.5.3/cf.Gemfile
  wget https://github.com/cloudfoundry/php-buildpack/raw/v4.5.3/cf.Gemfile.lock
  
  bundle install --deployment
  bundle cache
  bundle exec buildpack-packager --uncached
  bundle exec buildpack-packager --cached

Now uses standard path for all buildpacks:

if File.exist?('./scripts/.util/tools.sh')
  # Modern Go-based packaging (all buildpacks)

3. Buildpack Values Cleanup (14 files)

Removed field from all buildpack values files:

compile_extensions: false  # Removed (no longer needed)

Files updated:

  • apt-values.yml, binary-values.yml, config.yml, dotnet-core-values.yml
  • go-values.yml, hwc-values.yml, nginx-values.yml, nodejs-values.yml
  • php-values.yml (was true, now removed entirely)
  • python-values.yml, r-values.yml, ruby-values.yml, staticfile-values.yml

4. Task Directory Deleted

Removed:

  • tasks/update-compile-extensions/run.sh (38 lines)
  • tasks/update-compile-extensions/task.yml (17 lines)

Impact

Statistics

  • 17 files changed
  • 158 lines deleted, 4 lines added (net -154 lines)
  • 2 pipeline jobs removed (update-compile-extensions, update-buildpack-packager)
  • 2 pipeline resources removed (compile-extensions, buildpack-packager)

Benefits

  1. Consistency: All buildpacks now use identical Go-based packaging
  2. Simplified CI: Removed Ruby/Bundler dependencies for packaging
  3. No Technical Debt: Eliminated hardcoded version references (v4.5.3)
  4. Reduced Complexity: Fewer conditional branches in pipeline templates
  5. Faster Builds: No Docker container creation or Ruby gem installation

Breaking Changes

None. All buildpacks already use Go-based packaging:

Verification

All Buildpacks Confirmed Using compile_extensions: false

Buildpack Previous Value Current Value Status
apt false removed
binary false removed
dotnet-core false removed
go false removed
hwc false removed
nginx false removed
nodejs false removed
php true removed ✅ (modernized)
python false removed
r false removed
ruby false removed
staticfile false removed

Pipeline Template Logic

The YTT conditionals in pipeline.yml will now never be true:

#@ if data.values.buildpack.compile_extensions:
  # These resources/jobs are now completely removed
#@ end

Since no buildpack values file defines compile_extensions (or all implicitly false), these blocks are unreachable.

Testing Recommendations

1. Pipeline Generation Test

# Verify pipeline generates without errors
cd pipelines/buildpack
ytt -f pipeline.yml -f php-values.yml

Expected: No compile-extensions resources or jobs in output

2. Full Pipeline Deployment Test

# Test with PHP buildpack (was the last to migrate)
fly -t target set-pipeline -p php-buildpack \
  -c pipelines/buildpack/pipeline.yml \
  -l pipelines/buildpack/php-values.yml

Expected: Pipeline deploys successfully without compile-extensions resources

3. Buildpack Packaging Test

# Verify detect-and-upload task works with modernized buildpacks
fly -t target trigger-job -j php-buildpack/build-php

Expected: Uses Go-based packager via tools.sh path

Dependencies

Required Before Merge

PHP Buildpack Modernization: cloudfoundry/php-buildpack#1200

  • Adds buildpack-packager::install function to scripts/.util/tools.sh
  • Refactors scripts/package.sh to use Go-based packager
  • Removes Docker and Ruby dependencies from packaging

Status: PR created, awaiting review/merge

Coordination

This PR should be merged AFTER the PHP buildpack modernization is:

  1. ✅ Reviewed and approved
  2. ✅ Merged to main branch
  3. ✅ Available in the buildpack repository used by CI

Migration Path Completed

From the original PHP buildpack modernization analysis:

  • Phase 1: Fix CI issues (hardcoded v4.5.3 Gemfiles)
  • Phase 2: Modernize packaging (Go-based packager)
  • CI Cleanup: Remove compile-extensions infrastructure (this PR)

References

Reviewers Checklist

  • Verify all 14 buildpack values files have compile_extensions field removed
  • Confirm pipeline.yml removed 66 lines (2 resources, 2 jobs)
  • Check buildpack-tagger.rb removed hardcoded v4.5.3 Gemfile logic
  • Verify update-compile-extensions task directory deleted
  • Confirm no other references to compile-extensions remain
  • Test pipeline generation with YTT for at least one buildpack
  • Verify PHP buildpack PR #1200 is merged before merging this

Migration Status: ✅ Complete - All buildpacks now use modern Go-based packaging

All Cloud Foundry buildpacks now use compile_extensions: false and
Go-based packaging, making the legacy Ruby gem-based compile-extensions
infrastructure obsolete.

This change removes:
- compile-extensions git resource from pipeline
- buildpack-packager GitHub release resource from pipeline
- update-compile-extensions job
- update-buildpack-packager job
- Legacy Ruby bundler packaging logic from buildpack-tagger.rb
- Hardcoded PHP v4.5.3 Gemfile download URLs
- compile_extensions field from all buildpack values files

Impact:
- 66 lines removed from pipeline.yml
- 30 lines removed from buildpack-tagger.rb
- 2 task files deleted (update-compile-extensions)
- 14 buildpack values files cleaned up

This completes the buildpack modernization effort, ensuring all
buildpacks use consistent Go-based tooling. PHP buildpack packaging
was modernized in cloudfoundry/php-buildpack#1200.

Related: cloudfoundry/php-buildpack#1200
@ramonskie
Copy link
Contributor Author

cloudfoundry/php-buildpack#1203 has been merged so we can now merge this

Copy link
Contributor

@tnikolova82 tnikolova82 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor

@ivanovac ivanovac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ramonskie ramonskie merged commit d5d8a84 into master Nov 25, 2025
1 check passed
@ramonskie ramonskie deleted the remove-compile-extensions-legacy branch November 25, 2025 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants