Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

[WIP] Bundler::Runtime#clean: remove extensions dirs #5816

Closed

Conversation

igorbozato
Copy link
Contributor

Thanks so much for the contribution!
To make reviewing this PR a bit easier, please fill out answers to the following questions.

What was the end-user problem that led to this PR?

The problem was...
See #5596

Was was your diagnosis of the problem?

My diagnosis was...

What is your fix for the problem, implemented in this PR?

My fix...

Why did you choose this fix out of the possible options?

I chose this fix because...

@ghost
Copy link

ghost commented Jun 26, 2017

Thanks for opening a pull request and helping make Bundler better! Someone from the Bundler team will take a look at your pull request shortly and leave any feedback. Please make sure that your pull request has tests for any changes or added functionality.

We use Travis CI to test and make sure your change works functionally and uses acceptable conventions, you can review the current progress of Travis CI in the PR status window below.

If you have any questions or concerns that you wish to ask, feel free to leave a comment in this PR or join our #bundler channel on Slack.

For more information about contributing to the Bundler project feel free to review our CONTRIBUTING guide

@colby-swandale
Copy link
Member

colby-swandale commented Jun 26, 2017

HI, can you please fill out the questionnaire.

edit: sorry didn't realise this was still a WIP

@igorbozato igorbozato changed the title WIP: Bundler::Runtime#clean: remove extensions dirs [WIP] Bundler::Runtime#clean: remove extensions dirs Jun 27, 2017

bundle "install --path vendor/bundle"

expect(vendored_gems("extensions/x86_64-linux/2.3.0-static/c_extension-1.0")).to exist
Copy link
Member

Choose a reason for hiding this comment

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

please don't hardcode the platform, use something like bundled_app(*["vendor/bundle", Gem.ruby_engine, Gem::ConfigMap[:ruby_version], c_extention-1.0"].compact) instead

require "mkmf"
name = "c_extension_bundle"
dir_config(name)
raise "OMG" unless with_config("c_extension") == "hello"
Copy link
Member

Choose a reason for hiding this comment

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

this seems to be raising on CI

@@ -193,6 +196,9 @@ def clean(dry_run = false)
stale_gem_dirs = gem_dirs - spec_gem_paths
stale_gem_files = gem_files - spec_cache_paths
stale_gemspec_files = gemspec_files - spec_gemspec_paths
stale_extension_dirs = extension_dirs - spec_extension_dirs

stale_extension_dirs.collect {|dir| FileUtils.rm_rf(dir) } unless dry_run
Copy link
Member

Choose a reason for hiding this comment

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

this should assign to a variable that gets added to output a couple of lines below and use the remove_dir helper, same as 2 lines below

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using remove_dir for this would duplicate the output of the removed gem, what should be the output text for this?


bundle "install --path vendor/bundle"

expect(vendored_gems.join("extensions", Gem::Platform.local.to_s, Gem::ConfigMap[:ruby_version] + "-static", "c_extension-1.0")).to exist
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gem::ConfigMap[:ruby_version] + "-static" still hardcoded, not sure where "2.3.0-static" comes from.

@igorbozato igorbozato closed this Sep 26, 2017
@igorbozato igorbozato deleted the bundle_clean_remove_extensions branch September 26, 2017 09:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants