Skip to content

Commit

Permalink
pcweb: do not build on windows (unless overriding)
Browse files Browse the repository at this point in the history
Avoid EMFILE errors when building reflex-web on windows during CI.

reflex-web has too many pages and causes too many files to get opened during
the build, and windows seems to have a non-configurable limit for open file
handles via the C runtime.

Until we come up with a nicer solution, simply disallow windows builds. If the
override environment variable is set (like in CI runs), then we will compile a
subset of pages for testing.
  • Loading branch information
masenf committed Jan 22, 2024
1 parent f38bcba commit 2fc366a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pcweb/pcweb.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
"""The main Reflex website."""

import os
import sys

import reflex as rx
import reflex.components.radix.themes as rdxt
from pcweb import styles
Expand All @@ -25,6 +28,17 @@
],
)


# XXX: The app is TOO BIG to build on Windows, so explicitly disallow it except for testing
if sys.platform == "win32":
if not os.environ.get("REFLEX_WEB_WINDOWS_OVERRIDE"):
raise RuntimeError(
"reflex-web cannot be built on Windows due to EMFILE error. To build a "
"subset of pages for testing, set environment variable REFLEX_WEB_WINDOWS_OVERRIDE."
)
routes = routes[:150]


# Add the pages to the app.
for route in routes:
app.add_page(
Expand Down

0 comments on commit 2fc366a

Please sign in to comment.