Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn --ext option of bundle gem into string. Deprecate usage without explicit value. #6144

Merged
merged 1 commit into from
Dec 19, 2022

Conversation

simi
Copy link
Member

@simi simi commented Dec 17, 2022

Personally I used to create gems with bundle gem --ext hello. Now it prints deprecation when extension type is not provided explicitly, but continues with C extension.

[retro@retro  bundler (ext-enum %=)]❤ ./exe/bundle gem --ext hello
[DEPRECATED] Option `--ext` without explicit value is deprecated. Please pass value like `--ext=c` for C extension. Pretending `--ext=c` was used for now.
Creating gem 'hello'...
MIT License enabled in config
Initializing git repo in /home/retro/code/work/oss/rubygems/bundler/hello
      create  hello/Gemfile
      create  hello/lib/hello.rb
      create  hello/lib/hello/version.rb
      create  hello/sig/hello.rbs
      create  hello/hello.gemspec
      create  hello/Rakefile
      create  hello/README.md
      create  hello/bin/console
      create  hello/bin/setup
      create  hello/.gitignore
      create  hello/test/test_helper.rb
      create  hello/test/test_hello.rb
      create  hello/LICENSE.txt
      create  hello/ext/hello/extconf.rb
      create  hello/ext/hello/hello.h
      create  hello/ext/hello/hello.c
Gem 'hello' was successfully created. For more information on making a RubyGem visit https://bundler.io/guides/creating_gem.html

@simi simi force-pushed the ext-enum branch 3 times, most recently from 85d613f to 3c5379c Compare December 17, 2022 14:16
# when deprecated version of `--ext` is called
# print out deprecation warning and pretend `--ext=c` was provided
if deprecated_ext_value?(arguments)
SharedHelpers.major_deprecation 2, "Option `--ext` without explicit value is deprecated. Please pass value like `--ext=c` for C extension. Pretending `--ext=c` was used for now."
Copy link
Member Author

Choose a reason for hiding this comment

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

I'll appreciate any suggestion of better text in here. pray

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
SharedHelpers.major_deprecation 2, "Option `--ext` without explicit value is deprecated. Please pass value like `--ext=c` for C extension. Pretending `--ext=c` was used for now."
SharedHelpers.major_deprecation 2, "Extensions can now be generated using C or Rust, so `--ext` with no arguments has been deprecated. Please select a language, e.g. `--ext=rust` to generate a Rust extension. This gem will now be generated as if `--ext=c` was used."

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll use this for the final one (other PR onboarding Rust gem generator).

@simi
Copy link
Member Author

simi commented Dec 17, 2022

🤔 locally bin/ronn --warnings --roff --pipe --date 2022-12-17 lib/bundler/man/bundle-gem.1.ronn > lib/bundler/man/bundle-gem.1 makes no difference

@indirect
Copy link
Member

Perhaps this branch needs to be rebased? GitHub says it is out of date.

@simi simi force-pushed the ext-enum branch 2 times, most recently from c0ed5c9 to 167ebb2 Compare December 18, 2022 19:03
@simi simi marked this pull request as ready for review December 18, 2022 19:11
- this is preparation for onboarding Rust based extension gem generator
@simi simi merged commit b57a515 into master Dec 19, 2022
@simi simi deleted the ext-enum branch December 19, 2022 03:09
@deivid-rodriguez deivid-rodriguez changed the title Turn --ext option into string. Deprecate usage without explicit value. Turn --ext option of bundle gem into string. Deprecate usage without explicit value. Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants