Skip to content

Commit

Permalink
Remove Windows support (rogchap#234)
Browse files Browse the repository at this point in the history
* Remove Windows binary support

* Update CHANGELOG.md

Co-authored-by: Oliver Fuerst <87430407+ofuerst@users.noreply.github.com>

* Update CHANGELOG.md

Co-authored-by: Dylan Thacker-Smith <dylan.smith@shopify.com>

* Update windows section

* Update README.md

Co-authored-by: Dylan Thacker-Smith <dylan.smith@shopify.com>

* Update README.md

Co-authored-by: Dylan Thacker-Smith <dylan.smith@shopify.com>

* Remove windows fossa step

* Remove deps/windows_x86_64

Co-authored-by: Oliver Fuerst <87430407+ofuerst@users.noreply.github.com>
Co-authored-by: Dylan Thacker-Smith <dylan.smith@shopify.com>
Co-authored-by: Roger Chapman <rogchap@gmail.com>
  • Loading branch information
4 people authored Nov 22, 2021
1 parent a8a4920 commit f55271d
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 2,226 deletions.
16 changes: 3 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
# We use macos-11 over macos-latest because macos-latest defaults to Catalina(10.15) and not Big Sur(11.0)
# We can switch to macos-latest whenever Big Sur becomes the default
# See https://github.com/actions/virtual-environments#available-environments
platform: [ubuntu-latest, macos-11, windows-latest]
platform: [ubuntu-latest, macos-11]
runs-on: ${{ matrix.platform }}

steps:
Expand All @@ -26,10 +26,6 @@ jobs:
go-version: ${{ matrix.go-version }}
- name: Checkout
uses: actions/checkout@v2
- name: Add MINGW to PATH
if: matrix.platform == 'windows-latest'
run: echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH
shell: bash
- name: Go Test
env:
CGO_CXXFLAGS: "-Werror"
Expand All @@ -45,16 +41,10 @@ jobs:
- name: Add GOPATH to GITHUB_ENV
run: echo "GOPATH=$(go env GOPATH)" >>"$GITHUB_ENV"
- name: Scan and upload FOSSA data (Linux/Mac)
if: env.FOSSA_API_KEY != '' && github.ref == 'refs/heads/master' && matrix.platform != 'windows-latest'
if: env.FOSSA_API_KEY != '' && github.ref == 'refs/heads/master'
run: |
curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | sudo bash
fossa analyze
env:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}
- name: Scan and upload FOSSA data (Windows)
if: env.FOSSA_API_KEY != '' && github.ref == 'refs/heads/master' && matrix.platform == 'windows-latest'
run: |
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/fossas/fossa-cli/master/install.ps1'))
C:\ProgramData\fossa-cli\fossa.exe analyze
env:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}

14 changes: 1 addition & 13 deletions .github/workflows/v8build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ jobs:
#
# We need xcode 12.4 or newer to cross compile between arm64/amd64
# https://github.com/actions/virtual-environments/blob/main/images/macos/macos-11-Readme.md#xcode
platform: [ubuntu-18.04, macos-11, windows-latest]
platform: [ubuntu-18.04, macos-11]
arch: [x86_64, arm64]
exclude:
- platform: ubuntu-18.04
arch: arm64
- platform: windows-latest
arch: arm64
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout
Expand All @@ -37,16 +35,6 @@ jobs:
- name: Build V8 macOS
if: matrix.platform == 'macos-11'
run: cd deps && ./build.py --arch ${{ matrix.arch }}
- name: Add MSYS2 to PATH
if: matrix.platform == 'windows-latest'
run: echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH
shell: bash
- name: Build V8 windows
if: matrix.platform == 'windows-latest'
run: cd deps; python build.py --no-clang --arch ${{ matrix.arch }}
env:
MSYSTEM: MINGW64
DEPOT_TOOLS_WIN_TOOLCHAIN: 0
- name: Create PR
uses: peter-evans/create-pull-request@v3
with:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ to run a pre-compiled script in new contexts.
- Removed error return value from Context.Isolate() which never fails
- Removed error return value from NewObjectTemplate and NewFunctionTemplate. Panic if given a nil argument.
- Function Call accepts receiver as first argument.
- Removed Windows support until its build issues are addressed.

### Fixed
- Add some missing error propagation
Expand Down
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,21 +192,20 @@ please join the [**#v8go**](https://gophers.slack.com/channels/v8go) channel on

### Windows

In order to build a project using v8go on Windows, Go requires a gcc compiler to be installed.
There used to be Windows binary support. For further information see, [PR #234](https://github.com/rogchap/v8go/pull/234).

To set this up:
1. Install MSYS2 (https://www.msys2.org/)
2. Add the Mingw-w64 bin to your PATH environment variable (`C:\msys64\mingw64\bin` by default)
3. Open MSYS2 MSYS and execute `pacman -S mingw-w64-x86_64-toolchain`

V8 requires 64-bit on Windows, therefore it will not work on 32-bit systems.
The v8go library would welcome contributions from anyone able to get an external windows
build of the V8 library linking with v8go, using the version of V8 checked out in the
`deps/v8` git submodule, and documentation of the process involved. This process will likely
involve passing a linker flag when building v8go (e.g. using the `CGO_LDFLAGS` environment
variable.

## V8 dependency

V8 version: **9.0.257.18** (April 2021)

In order to make `v8go` usable as a standard Go package, prebuilt static libraries of V8
are included for Linux, macOS and Windows ie. you *should not* require to build V8 yourself.
are included for Linux and macOS. you *should not* require to build V8 yourself.

Due to security concerns of binary blobs hiding malicious code, the V8 binary is built via CI *ONLY*.

Expand Down Expand Up @@ -247,7 +246,7 @@ The next steps are:
1) The build is not yet triggered automatically. To trigger it manually, go to the [V8
Build](https://github.com/rogchap/v8go/actions?query=workflow%3A%22V8+Build%22) Github Action, Select "Run workflow",
and select your pushed branch eg. `v8_upgrade/<v8-version>`.
1) Once built, this should open 3 PRs against your branch to add the `libv8.a` for Linux, macOS and Windows; merge
1) Once built, this should open 3 PRs against your branch to add the `libv8.a` for Linux (for x86_64) and macOS for x86_64 and arm64; merge
these PRs into your branch. You are now ready to raise the PR against `master` with the latest version of V8.

### Flushing after C/C++ standard library printing for debugging
Expand Down
2 changes: 0 additions & 2 deletions cgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ package v8go
// #cgo darwin,amd64 LDFLAGS: -L${SRCDIR}/deps/darwin_x86_64
// #cgo darwin,arm64 LDFLAGS: -L${SRCDIR}/deps/darwin_arm64
// #cgo linux LDFLAGS: -L${SRCDIR}/deps/linux_x86_64
// #cgo windows LDFLAGS: -L${SRCDIR}/deps/windows_x86_64 -static -ldbghelp -lssp -lwinmm -lz
import "C"

// These imports forces `go mod vendor` to pull in all the folders that
Expand All @@ -22,5 +21,4 @@ import (
_ "rogchap.com/v8go/deps/darwin_x86_64"
_ "rogchap.com/v8go/deps/include"
_ "rogchap.com/v8go/deps/linux_x86_64"
_ "rogchap.com/v8go/deps/windows_x86_64"
)
2 changes: 0 additions & 2 deletions deps/windows_x86_64/.gitattributes

This file was deleted.

Loading

0 comments on commit f55271d

Please sign in to comment.