Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Windows ARM64 prebuild configuration #1957

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dennisameling
Copy link

@dennisameling dennisameling commented Dec 28, 2021

This adds a prebuild configuration for Windows ARM64. I've been adding the necessary packages to MSYS2 clangarm64 (they will be published in the coming weeks):

GitHub Actions doesn't have ARM64 runners yet, so for now, this allows folks to create prebuilds locally. An example build can be found here: https://github.com/dennisameling/node-canvas/releases/tag/v2.8.0-arm64

Result of npm test:

Test results
PS C:\repos\node-canvas> npm test

> canvas@2.8.0 test
> mocha test/*.test.js

  Canvas
    √ Prototype and ctor are well-shaped, don't hit asserts on accessors (GH-803)
    √ .parseFont()
    √ registerFont
    √ color serialization
    √ color parser
    √ Canvas#type
    √ Canvas#getContext("2d") (53ms)
    √ Canvas#getContext("2d", {pixelFormat: string})
    √ Canvas#getContext("2d", {alpha: boolean})
    √ Canvas#{width,height}=
    √ Canvas#width= (resurfacing) doesn't crash when fillStyle is a pattern (#1357)
    √ SVG Canvas#width changes don't crash (#1380)
    √ Canvas#stride
    √ Canvas#getContext("invalid")
    √ Context2d#patternQuality
    √ Context2d#imageSmoothingEnabled
    √ Context2d#font=
    √ Context2d#lineWidth=
    √ Context2d#antiAlias=
    √ Context2d#lineCap=
    √ Context2d#lineJoin=
    √ Context2d#globalAlpha=
    √ Context2d#isPointInPath()
    √ Context2d#textAlign
    √ Context2d#fillText()
    √ Context2d#currentTransform
    √ Context2d#createImageData(ImageData)
    √ Context2d#createPattern(Canvas)
    √ Context2d#createPattern(Canvas).setTransform() (75ms)
    √ Context2d#createPattern(Image)
    √ Context2d#createLinearGradient()
    √ Canvas#createPNGStream()
    √ Canvas#createPDFStream()
    √ Canvas#createJPEGStream()
    √ EOI at end of Canvas#createJPEGStream()
    √ Context2d#fill()
    √ Context2d#clip()
    √ Context2d#IsPointInPath()
    √ Context2d#rotate(angle)
    √ Context2d#drawImage()
    √ Context2d#SetFillColor()
    #toBuffer
      √ Canvas#toBuffer()
      √ Canvas#toBuffer("image/png")
      √ Canvas#toBuffer("image/png", {resolution: 96})
      √ Canvas#toBuffer("image/png", {compressionLevel: 5})
      √ Canvas#toBuffer("image/jpeg")
      √ Canvas#toBuffer("image/jpeg", {quality: 0.95})
      √ Canvas#toBuffer(callback)
      √ Canvas#toBuffer(callback, "image/jpeg")
      √ Canvas#toBuffer(callback, "image/jpeg", {quality: 0.95})
      #toBuffer("raw")
        √ should have the correct size
        √ does not premultiply alpha
        √ draws red
        √ draws green
        √ draws black
        √ leaves undrawn pixels black, transparent
        √ is immutable
    #toDataURL()
      √ toDataURL() works and defaults to PNG
      √ toDataURL(0.5) works and defaults to PNG
      √ toDataURL(undefined) works and defaults to PNG
      √ toDataURL("image/png") works
      √ toDataURL("image/png", 0.5) works
      √ toDataURL("iMaGe/PNg") works
      √ toDataURL("image/jpeg") works
      √ toDataURL(function (err, str) {...}) works and defaults to PNG
      √ toDataURL(function (err, str) {...}) is async even with no canvas data
      √ toDataURL(0.5, function (err, str) {...}) works and defaults to PNG
      √ toDataURL(undefined, function (err, str) {...}) works and defaults to PNG
      √ toDataURL("image/png", function (err, str) {...}) works
      √ toDataURL("image/png", 0.5, function (err, str) {...}) works
      √ toDataURL("image/png", {}) works
      √ toDataURL("image/jpeg", {}) works
      √ toDataURL("image/jpeg", function (err, str) {...}) works
      √ toDataURL("iMAge/JPEG", function (err, str) {...}) works
      √ toDataURL("image/jpeg", undefined, function (err, str) {...}) works
      √ toDataURL("image/jpeg", 0.5, function (err, str) {...}) works
      √ toDataURL("image/jpeg", opts, function (err, str) {...}) works
    Context2d#createImageData(width, height)
      √ works
      √ works, A8 format
      √ works, A1 format
      √ works, RGB24 format
      √ works, RGB16_565 format
    Context2d#measureText()
      √ Context2d#measureText().width
      √ works
    Context2d#getImageData()
      √ works, full width, RGBA32
      √ works, full width, RGB24
      √ works, full width, RGB16_565
      √ works, full width, A8
      - works, full width, A1
      - works, full width, RGB30
      √ works, slice, RGBA32
      √ works, slice, RGB24
      √ works, slice, RGB16_565
      √ works, slice, A8
      - works, slice, A1
      - works, slice, RGB30
      √ works, assignment
      √ throws if indexes are invalid
    Context2d#putImageData()
      √ throws for invalid arguments
      √ works for negative source values
      √ works, RGBA32
      √ works, RGB24/alpha:false
      √ works, A8
      √ works, RGB16_565

  DOMMatrix
    constructor, general
      √ aliases a,b,c,d,e,f properly
      √ parses lists of transforms per spec
      √ parses matrix2d(<16 numbers>) per spec
      √ sets is2D to true if matrix2d(<16 numbers>) is 2D
    multiply
      √ performs self.other, returning a new DOMMatrix
    multiplySelf
      √ performs self.other, mutating self
    preMultiplySelf
      √ performs other.self, mutating self
    translateSelf
      √ works, 1 arg
      √ works, 2 args
      √ works, 3 args
    scale
      √ works, 1 arg
      √ works, 2 args
      √ works, 3 args
      √ works, 4 args
      √ works, 5 args
      √ works, 6 args
    scale3d
      √ works, 0 args
      √ works, 1 arg
      √ works, 2 args
      √ works, 3 args
      √ works, 4 args
    rotate
      √ works, 1 arg
      √ works, 2 args
      √ works, 3 args
    rotateFromVector
      √ works, no args and x/y=0
      √ works
    rotateAxisAngle
      √ works, 0 args
      √ works, 4 args
    skewX
      √ works
    skewY
      √ works
    flipX
      √ works
    flipY
      √ works
    invertSelf
      √ works for invertible matrices
      √ works for non-invertible matrices
    inverse
      √ preserves the original DOMMatrix
      √ preserves the original DOMMatrix for non-invertible matrices
    transformPoint
      √ works
    toFloat32Array
      √ works
    toFloat64Array
      √ works
    toString
      √ works, 2d
      √ works, 3d

  Image
    √ Prototype and ctor are well-shaped, don't hit asserts on accessors (GH-803)
    √ loads JPEG image
    √ loads JPEG data URL
    √ loads PNG image
    √ loads PNG data URL
    - detects invalid PNG
    √ propagates exceptions thrown by onload
    √ propagates exceptions thrown by onerror
    √ loads SVG data URL base64
    √ loads SVG data URL utf8
    √ calls Image#onload multiple times
    √ handles errors
    √ returns a nice, coded error for fopen failures
    √ captures errors from libjpeg
    √ calls Image#onerror multiple times
    √ Image#{width,height}
    √ Image#src set empty buffer
    √ should unbind Image#onload
    √ should unbind Image#onerror
    √ does not crash on invalid images
    √ does not contain `source` property
    supports BMP
      √ parses 1-bit image
      √ parses 4-bit image
      - parses 8-bit image
      √ parses 24-bit image
      √ parses 32-bit image
      √ parses minimal BMP
      √ properly handles negative height
      √ color palette
      √ V3 header
      - V5 header
      √ catches BMP errors
      √ BMP bomb

  ImageData
    √ Prototype and ctor are well-shaped, don't hit asserts on accessors (GH-803)
    √ should throw with invalid numeric arguments
    √ should construct with width and height
    √ should throw with invalid typed array
    √ should construct with Uint8ClampedArray
    √ should construct with Uint16Array


  177 passing (634ms)
  7 pending

@zbjornson
Copy link
Collaborator

Cool! Did you by chance try cross-compiling?

@heldersepu
Copy link

I get a feeling this no longer needed:
https://github.blog/changelog/2022-08-09-github-actions-self-hosted-runners-now-support-apple-m1-hardware/

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.

None yet

3 participants