GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Remove dependency on `win32ole` by Earlopain · Pull Request #1051 · ruby-concurrency/concurrent-ruby

Conversation

@Earlopain

@Earlopain Earlopain commented Jun 6, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This will become bundled in Ruby 3.5

Unfortunately there is no portable way of checking for this. The wmic command is deprecated, though I don't observe this myself on W11 (yet?)

Closes #1048

The powershell variant will work in at least releases from 2012 (Windows 8):
https://learn.microsoft.com/en-us/previous-versions/powershell/module/cimcmdlets/get-ciminstance?view=powershell-3.0
https://learn.microsoft.com/en-us/previous-versions/powershell/module/microsoft.powershell.utility/select-object?view=powershell-3.0
https://learn.microsoft.com/en-us/powershell/scripting/install/powershell-support-lifecycle?view=powershell-7.4

There are no docs from earlier so I can't say about versions from before that. Maybe supporting 12 year old versions is good enough and wmic doesn't even need to be used? Let me know.

This is overall very defensive in what could happen because I'm not primarily developing on windows.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Earlopain
Remove dependency on win32ole
02182c3
This will become bundled in Ruby 3.5

Unfortunately there is no portable way of checking for this.
The wmic command is deprecated, though I don't observe this myself on W11 (yet?)
@Earlopain
Earlopain force-pushed the drop-win32ole branch 2 times, most recently from 2c42376 to 6742a0d Compare June 6, 2024 09:46
@Earlopain
Add a windows job to CI
a9b6784
@Earlopain
Earlopain force-pushed the drop-win32ole branch from 6742a0d to a9b6784 Compare June 6, 2024 09:57
@Earlopain Earlopain mentioned this pull request Jun 6, 2024
Ruby 3.5 to drop win32ole grosser/parallel#345
Closed
eregon
eregon approved these changes Jun 7, 2024
View reviewed changes

@eregon eregon left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This looks great, thank you!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@eregon

eregon commented Jun 7, 2024

Copy link
Copy Markdown
Member

@MSP-Greg I wonder if you might know what's the best way to get the number of (physical) cores on a Windows machine from Ruby?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@MSP-Greg

MSP-Greg commented Jun 7, 2024

Copy link
Copy Markdown

@eregon

The PowerShell command Get-CimInstance -ClassName Win32_Processor | Select-Object -Property NumberOfCores works.

On my system, it shows 10. Etc.nprocessors shows 20, both on Windows and WSL2/Ubuntu. I have a single CPU.

Do you mean via c code?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@eregon

eregon commented Jun 7, 2024

Copy link
Copy Markdown
Member

I meant via the command-line.
OK, thanks for confirming it works.

MSP-Greg reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@eregon
eregon merged commit c672d6e into ruby-concurrency:master Jun 7, 2024
@eregon

eregon commented Jun 7, 2024

Copy link
Copy Markdown
Member

I made a release with this: https://github.com/ruby-concurrency/concurrent-ruby/releases/tag/v1.3.2

Earlopain reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Earlopain Earlopain mentioned this pull request Jun 8, 2024
Remove dependency on win32ole ruby/rake#573
Merged
@Earlopain
Earlopain deleted the drop-win32ole branch June 8, 2024 15:57
@Earlopain Earlopain mentioned this pull request Jun 8, 2024
Improve speed for windows Get-CimInstance #1053
Merged
Copilot AI added a commit to nsano-rururu/fluentd-ui that referenced this pull request Nov 3, 2025
@nsano-rururu
Pin concurrent-ruby to 1.3.4 for Ruby 3.2+ compatibility
fb1826c
- Added concurrent-ruby 1.3.4 constraint to Gemfile to fix Logger NameError
- This resolves the "uninitialized constant LoggerThreadSafeLevel::Logger" error
- Updated MIGRATION_GUIDE with Issue 7 documenting the problem and solution
- Updated README to mention the concurrent-ruby compatibility fix
- All 47 tests passing

The concurrent-ruby 1.3.5+ has a known issue with Ruby 3.2+ causing Logger::Severity errors. Pinning to 1.3.4 resolves this until the upstream bug is fixed.

See: ruby-concurrency/concurrent-ruby#1051

Co-authored-by: nsano-rururu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@eregon eregon eregon approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Ruby 3.5 to drop win32ole

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@Earlopain @eregon @MSP-Greg
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.