Skip to content

chore: add Windows dev support#2847

Open
fwextensions wants to merge 3 commits intomainfrom
jdunning/chore/enable-windows-support
Open

chore: add Windows dev support#2847
fwextensions wants to merge 3 commits intomainfrom
jdunning/chore/enable-windows-support

Conversation

@fwextensions
Copy link
Copy Markdown
Collaborator

@fwextensions fwextensions commented Apr 3, 2026

Description

Minimal changes to get the Rails + React dev environment running on Windows without breaking the existing Mac workflow.

The main thing to test is that nothing is broken or affected on macOS or CI/CD by these changes.


npm scripts — Added cross-env to handle inline environment variables (TZ, NODE_OPTIONS, TIMING) that use Unix shell syntax. This is a no-op on Mac/Linux. Also fixed the yarn start script which had nested quoting issues causing NODE_OPTIONS to be interpreted as a command on Windows — it now delegates to yarn server and yarn client.

Puma — Windows doesn't support fork(), so Puma's clustered worker mode fails. Added WEB_CONCURRENCY=0 to .env.sample (commented, with explanation) to run Puma in single-process threaded mode on Windows.

tzinfo-data — Windows has no system zoneinfo directory. Added the tzinfo-data gem with a platform guard (platforms: %i[mingw mswin x64_mingw jruby]) so it's only pulled in on Windows.

Bundler — Added x64-mingw-ucrt platform to Gemfile.lock so native gems (pg, nokogiri, etc.) resolve for Windows Ruby.

database.yml — Added DATABASE_USERNAME, DATABASE_PASSWORD, and DATABASE_HOST from env vars. On Mac with default trust/peer auth these are typically unset and Postgres connects without credentials as before. On Windows where Postgres usually requires a password, the values from .env are now picked up.

Before requesting eng review

Version Control

  • branch name begins with angular if it contains updates to Angular code
  • branch name contains the Jira ticket number
  • PR name follows type: TICKET-NUMBER Description format, use DAH-000 if it does not need a ticket
  • PR name follows urgent: Description format if it is urgent and does not need a ticket

Code quality

  • the set of changes is small
  • all automated code checks pass (linting, tests, coverage, etc.)
  • if the PR is a bugfix, there are tests and logs around the bug

Code conventions

  • web pages are formatted with .scss stylesheets and ui-seeds tokens, rather than inline styles or Tailwind

Review instructions

  • instructions specify which environment(s) it applies to
  • instructions work for PA testers
  • instructions have already been performed at least once

Request eng review

  • PR has needs review label
  • Use Housing Eng group to automatically assign reviewers, and/or assign specific engineers
  • If time sensitive, notify engineers in Slack

Before merging

Request product acceptance (PA) testing

  • PA tested in the review environment (use needs product acceptance label)
  • if PA testing cannot be done, changes are behind a feature flag

Copilot AI review requested due to automatic review settings April 3, 2026 01:32
@fwextensions fwextensions requested review from a team, cliu02 and jtcaovan and removed request for a team April 3, 2026 01:33
@hshaosf hshaosf temporarily deployed to dahlia-webapp-pr-2847 April 3, 2026 01:34 Inactive
Add cross-env to handle setting env vars on the command line.
Add tzinfo-data gem when on Windows.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds Windows development environment support to the Rails + React application by:

  • Using cross-env to handle cross-platform environment variables in npm scripts
  • Adding tzinfo-data gem for Windows timezone support
  • Adding platform-specific gem dependencies for Windows (x64-mingw-ucrt)
  • Extending database.yml to support environment-based database credentials for Windows
  • Refactoring the start script to use separate server and client commands

Changes:

  • Added cross-env@^10.1.0 dependency and updated npm scripts to use it for environment variables
  • Added tzinfo-data gem with Windows platform guard to Gemfile
  • Extended database.yml to support DATABASE_USERNAME, DATABASE_PASSWORD, and DATABASE_HOST environment variables
  • Added .env.sample comment about WEB_CONCURRENCY=0 for Windows Puma configuration
  • Updated Gemfile.lock and yarn.lock with platform-specific dependencies

Reviewed changes

Copilot reviewed 3 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
yarn.lock Added cross-env and @epic-web/invariant dependencies for Windows environment variable handling
package.json Added cross-env and updated npm scripts; reorganized react-dropzone dependency; refactored start command
Gemfile Added tzinfo-data gem with Windows-only platform guard
Gemfile.lock Added Windows platform (x64-mingw-ucrt) versions of native gems (pg, nokogiri, grpc, etc.) and tzinfo-data
config/database.yml Added DATABASE_USERNAME, DATABASE_PASSWORD, and DATABASE_HOST configuration from environment variables
.env.sample Added commented documentation for WEB_CONCURRENCY=0 Windows setting

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread config/database.yml
Comment thread .env.sample
Comment thread package.json
@fwextensions fwextensions force-pushed the jdunning/chore/enable-windows-support branch from 04e8975 to 486588a Compare April 3, 2026 01:38
@hshaosf hshaosf temporarily deployed to dahlia-webapp-pr-2847 April 3, 2026 01:38 Inactive
fwextensions and others added 2 commits April 2, 2026 18:42
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@hshaosf hshaosf temporarily deployed to dahlia-webapp-pr-2847 April 3, 2026 01:42 Inactive
@fwextensions fwextensions requested review from alulabeshue-sfgov, cade-exygy and jimlin-sfgov and removed request for cliu02 and jtcaovan April 3, 2026 01:43
@fwextensions fwextensions added the needs review Pull request needs review label Apr 3, 2026
Copy link
Copy Markdown
Contributor

@alulabeshue-sfgov alulabeshue-sfgov left a comment

Choose a reason for hiding this comment

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

Locally on my mac this branch is failing, running yarn start and visiting localhost:3000 results in the below

[SERVER] Started GET "/" for ::1 at 2026-04-10 10:58:38 -0700
[SERVER] objc[80679]: +[NSCharacterSet initialize] may have been in progress in another thread when fork() was called.
[SERVER] objc[80679]: +[NSCharacterSet initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
[SERVER] [80535] - Worker 0 (PID: 80756) booted in 0.7s, phase: 0
[SERVER] Started GET "/" for ::1 at 2026-04-10 10:58:41 -0700
[SERVER] objc[80756]: +[NSCharacterSet initialize] may have been in progress in another thread when fork() was called.
[SERVER] objc[80756]: +[NSCharacterSet initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
[SERVER] [80535] - Worker 0 (PID: 80759) booted in 0.67s, phase: 0
[SERVER] Started GET "/" for ::1 at 2026-04-10 10:58:43 -0700
[SERVER] objc[80759]: +[NSCharacterSet initialize] may have been in progress in another thread when fork() was called.
[SERVER] objc[80759]: +[NSCharacterSet initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
[SERVER] [80535] - Worker 0 (PID: 80761) booted in 0.67s, phase: 0
[SERVER] Started GET "/" for ::1 at 2026-04-10 10:58:48 -0700
[SERVER] objc[80761]: +[NSCharacterSet initialize] may have been in progress in another thread when fork() was called.
[SERVER] objc[80761]: +[NSCharacterSet initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
[SERVER] [80535] - Worker 0 (PID: 80764) booted in 0.71s, phase: 0
[SERVER] Started GET "/" for ::1 at 2026-04-10 10:58:53 -0700
[SERVER] objc[80764]: +[NSCharacterSet initialize] may have been in progress in another thread when fork() was called.
[SERVER] objc[80764]: +[NSCharacterSet initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
[SERVER] [80535] - Worker 0 (PID: 80766) booted in 0.62s, phase: 0
[SERVER] Started GET "/" for ::1 at 2026-04-10 10:59:01 -0700
[SERVER] objc[80766]: +[NSCharacterSet initialize] may have been in progress in another thread when fork() was called.
[SERVER] objc[80766]: +[NSCharacterSet initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.```

@jimlin-sfgov
Copy link
Copy Markdown
Collaborator

what's the target tooling on windows? I would think wsl2 would "just work", but I don't have the experience

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review Pull request needs review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants