Skip to content

feat: Windows support — build.ps1, .gitattributes, and Dockerfile fixes#3814

Closed
pasmud wants to merge 1 commit into
jo-inc:masterfrom
pasmud:master
Closed

feat: Windows support — build.ps1, .gitattributes, and Dockerfile fixes#3814
pasmud wants to merge 1 commit into
jo-inc:masterfrom
pasmud:master

Conversation

@pasmud
Copy link
Copy Markdown
Contributor

@pasmud pasmud commented May 21, 2026

Summary

Makes camofox-browser buildable on Windows without make or WSL, and prevents shell script line-ending issues that break Docker builds from Windows hosts.

Changes

build.ps1 (new)

PowerShell script mirroring the Makefile targets: build, up, down, reset, clean, and fetch. Each supports the same parameters, including -Arch, -CamoufoxVersion, and -CamoufoxRelease. Runs on both Windows PowerShell 5.1 and PowerShell 7+.

.gitattributes (new)

Enforces LF line endings for .sh files via *.sh text eol=lf. Without this, cloning on Windows with default Git settings can produce CRLF line endings, which breaks shebang lines and set -e inside Docker builds. The attribute file ensures Git always checks out shell scripts with LF endings regardless of core.autocrlf.

Dockerfile fixes

Changed RUN scripts/install-plugin-deps.sh to RUN sh scripts/install-plugin-deps.sh in both Dockerfile and Dockerfile.ci. The COPY instruction on Windows does not preserve +x permission bits, so invoking the script directly can fail during Docker builds. Running it via sh is explicit and works across platforms.

README.md

Added a Windows subsection under ### Docker with usage examples for build.ps1 and instructions for fixing line endings on existing clones.

Testing

Tested end-to-end on Windows 11 with Docker Desktop using the WSL2 backend:

  • .\build.ps1 fetch downloads Camoufox and yt-dlp.
  • docker build completes all 14 stages successfully.
  • The container starts and responds on port 9377 with Camoufox browser pre-warmed.

Add three changes to make camofox-browser buildable on Windows:

- build.ps1: PowerShell script mirroring the Makefile targets (build, up,
  down, reset, clean, fetch) for Windows users without make.
- .gitattributes: enforce LF line endings for .sh files so shell
  scripts don't break when run inside Linux containers after a
  Windows clone.
- Dockerfile + Dockerfile.ci: run plugin installer via 'sh' explicitly
  instead of relying on +x permissions, since Docker COPY on Windows
  does not preserve executable bits.
@skyfallsin
Copy link
Copy Markdown
Contributor

Shipped in v1.11 — thank you!

We merged the Windows build support: build.ps1, LF line-ending enforcement for shell scripts, Dockerfile shell invocation fixes, and README Windows docs.

Release notes: https://github.com/jo-inc/camofox-browser/releases/tag/v1.11.0
Latest patch: https://github.com/jo-inc/camofox-browser/releases/tag/v1.11.1

@skyfallsin
Copy link
Copy Markdown
Contributor

Closing since this shipped via #4150 in v1.11.

@skyfallsin skyfallsin closed this May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants