yglukhov / nimx

GUI library
MIT License
1.08k stars 76 forks source link

Build fails with Nim 1.6.8 #503

Closed muemmel closed 1 year ago

muemmel commented 1 year ago

Trying to build nimx fails on commit 7cda4e15f03a379bf40f88263fbcdcf95d199c16

Reverting the commit on my end makes it work just fine. Cannot really help, since I'm very new to nim, thought I'd report it though.

Log attached. nake_output.txt

muemmel commented 1 year ago
Hint: used config file '/home/pk/.choosenim/toolchains/nim-1.6.8/config/nim.cfg' [Conf]
Hint: used config file '/home/pk/.choosenim/toolchains/nim-1.6.8/config/config.nims' [Conf]
...............................................................................................................
/home/pk/Git/nimx/nimx/system_logger.nim(26, 14) Hint: 'native_log' should be: 'nativeLog' [Name]
....
/home/pk/Git/nimx/nimx/portable_gl.nim(194, 14) Hint: 'VERTEX_SHADER' should be: 'Vertex_Shader' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(195, 14) Hint: 'FRAGMENT_SHADER' should be: 'Fragment_Shader' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(196, 14) Hint: 'TEXTURE_2D' should be: 'Texture_2d' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(197, 14) Hint: 'CONSTANT_COLOR' should be: 'Constant_Color' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(198, 14) Hint: 'ONE_MINUS_SRC_COLOR' should be: 'One_Minus_Src_Color' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(199, 14) Hint: 'ONE_MINUS_SRC_ALPHA' should be: 'One_Minus_Src_Alpha' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(200, 14) Hint: 'ONE_MINUS_DST_ALPHA' should be: 'One_Minus_Dst_Alpha' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(201, 14) Hint: 'SRC_ALPHA' should be: 'Src_Alpha' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(202, 14) Hint: 'DST_ALPHA' should be: 'Dst_Alpha' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(203, 14) Hint: 'DST_COLOR' should be: 'Dst_Color' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(204, 14) Hint: 'ONE' should be: 'one' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(205, 14) Hint: 'BLEND' should be: 'blend' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(206, 14) Hint: 'TRIANGLES' should be: 'triangles' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(207, 14) Hint: 'TRIANGLE_FAN' should be: 'Triangle_Fan' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(208, 14) Hint: 'TRIANGLE_STRIP' should be: 'Triangle_Strip' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(209, 14) Hint: 'LINES' should be: 'lines' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(210, 14) Hint: 'LINE_LOOP' should be: 'Line_Loop' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(211, 14) Hint: 'COLOR_BUFFER_BIT' should be: 'Color_Buffer_Bit' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(212, 14) Hint: 'STENCIL_BUFFER_BIT' should be: 'Stencil_Buffer_Bit' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(213, 14) Hint: 'DEPTH_BUFFER_BIT' should be: 'Depth_Buffer_Bit' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(214, 14) Hint: 'TEXTURE_MIN_FILTER' should be: 'Texture_Min_Filter' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(215, 14) Hint: 'TEXTURE_MAG_FILTER' should be: 'Texture_Mag_Filter' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(216, 14) Hint: 'TEXTURE_WRAP_S' should be: 'Texture_Wrap_S' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(217, 14) Hint: 'TEXTURE_WRAP_T' should be: 'Texture_Wrap_T' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(218, 14) Hint: 'LINEAR' should be: 'linear' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(219, 14) Hint: 'NEAREST' should be: 'nearest' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(220, 14) Hint: 'CLAMP_TO_EDGE' should be: 'Clamp_To_Edge' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(221, 14) Hint: 'LINEAR_MIPMAP_NEAREST' should be: 'Linear_Mipmap_Nearest' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(222, 14) Hint: 'PACK_ALIGNMENT' should be: 'Pack_Alignment' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(223, 14) Hint: 'UNPACK_ALIGNMENT' should be: 'Unpack_Alignment' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(224, 14) Hint: 'FRAMEBUFFER' should be: 'framebuffer' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(225, 14) Hint: 'RENDERBUFFER' should be: 'renderbuffer' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(226, 14) Hint: 'ARRAY_BUFFER' should be: 'Array_Buffer' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(227, 14) Hint: 'ELEMENT_ARRAY_BUFFER' should be: 'Element_Array_Buffer' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(228, 14) Hint: 'RED' should be: 'red' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(229, 14) Hint: 'R16F' should be: 'r16f' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(230, 14) Hint: 'R32F' should be: 'r32f' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(231, 14) Hint: 'RGBA' should be: 'rgba' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(232, 14) Hint: 'RGBA16F' should be: 'rgba16f' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(233, 14) Hint: 'ALPHA' should be: 'alpha' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(234, 14) Hint: 'LUMINANCE' should be: 'luminance' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(235, 14) Hint: 'UNSIGNED_BYTE' should be: 'Unsigned_Byte' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(236, 14) Hint: 'COLOR_ATTACHMENT0' should be: 'Color_Attachment0' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(237, 14) Hint: 'DEPTH_ATTACHMENT' should be: 'Depth_Attachment' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(238, 14) Hint: 'STENCIL_ATTACHMENT' should be: 'Stencil_Attachment' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(239, 14) Hint: 'DEPTH_STENCIL_ATTACHMENT' should be: 'Depth_Stencil_Attachment' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(240, 14) Hint: 'DEPTH_COMPONENT16' should be: 'Depth_Component16' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(241, 14) Hint: 'STENCIL_INDEX8' should be: 'Stencil_Index8' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(242, 14) Hint: 'DEPTH_STENCIL' should be: 'Depth_Stencil' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(243, 14) Hint: 'DEPTH24_STENCIL8' should be: 'Depth24Stencil8' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(246, 14) Hint: 'STENCIL_TEST' should be: 'Stencil_Test' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(247, 14) Hint: 'DEPTH_TEST' should be: 'Depth_Test' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(248, 14) Hint: 'SCISSOR_TEST' should be: 'Scissor_Test' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(249, 14) Hint: 'MAX_TEXTURE_SIZE' should be: 'Max_Texture_Size' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(250, 14) Hint: 'BLEND_SRC_RGB' should be: 'Blend_Src_Rgb' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(251, 14) Hint: 'BLEND_SRC_ALPHA' should be: 'Blend_Src_Alpha' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(252, 14) Hint: 'BLEND_DST_RGB' should be: 'Blend_Dst_Rgb' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(253, 14) Hint: 'BLEND_DST_ALPHA' should be: 'Blend_Dst_Alpha' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(254, 14) Hint: 'NEVER' should be: 'never' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(255, 14) Hint: 'LESS' should be: 'less' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(256, 14) Hint: 'LEQUAL' should be: 'lequal' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(257, 14) Hint: 'GREATER' should be: 'greater' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(258, 14) Hint: 'GEQUAL' should be: 'gequal' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(259, 14) Hint: 'EQUAL' should be: 'equal' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(260, 14) Hint: 'NOTEQUAL' should be: 'notequal' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(261, 14) Hint: 'ALWAYS' should be: 'always' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(263, 14) Hint: 'KEEP' should be: 'keep' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(264, 14) Hint: 'ZERO' should be: 'zero' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(265, 14) Hint: 'REPLACE' should be: 'replace' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(266, 14) Hint: 'INCR' should be: 'incr' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(267, 14) Hint: 'INCR_WRAP' should be: 'Incr_Wrap' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(268, 14) Hint: 'DECR' should be: 'decr' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(269, 14) Hint: 'DECR_WRAP' should be: 'Decr_Wrap' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(270, 14) Hint: 'INVERT' should be: 'invert' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(272, 14) Hint: 'STREAM_DRAW' should be: 'Stream_Draw' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(273, 14) Hint: 'STREAM_READ' should be: 'Stream_Read' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(274, 14) Hint: 'STREAM_COPY' should be: 'Stream_Copy' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(275, 14) Hint: 'STATIC_DRAW' should be: 'Static_Draw' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(276, 14) Hint: 'STATIC_READ' should be: 'Static_Read' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(277, 14) Hint: 'STATIC_COPY' should be: 'Static_Copy' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(278, 14) Hint: 'DYNAMIC_DRAW' should be: 'Dynamic_Draw' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(279, 14) Hint: 'DYNAMIC_READ' should be: 'Dynamic_Read' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(280, 14) Hint: 'DYNAMIC_COPY' should be: 'Dynamic_Copy' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(282, 14) Hint: 'FLOAT' should be: 'float' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(283, 14) Hint: 'UNSIGNED_SHORT' should be: 'Unsigned_Short' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(285, 14) Hint: 'TEXTURE0' should be: 'texture0' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(287, 14) Hint: 'CULL_FACE' should be: 'Cull_Face' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(288, 14) Hint: 'FRONT' should be: 'front' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(289, 14) Hint: 'BACK' should be: 'back' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(290, 14) Hint: 'FRONT_AND_BACK' should be: 'Front_And_Back' [Name]
/home/pk/Git/nimx/nimx/portable_gl.nim(292, 14) Hint: 'BUFFER_SIZE' should be: 'Buffer_Size' [Name]
...................
/home/pk/Git/nimx/nimx/load_image_impl.nim(7473, 58) Hint: 'req_comp' should be: 'reqComp' [Name]
/home/pk/Git/nimx/nimx/load_image_impl.nim(7474, 90) Hint: 'req_comp' should be: 'reqComp' [Name]
/home/pk/Git/nimx/nimx/load_image_impl.nim(7477, 54) Hint: 'req_comp' should be: 'reqComp' [Name]
/home/pk/Git/nimx/nimx/load_image_impl.nim(7477, 6) Hint: 'stbi_load' should be: 'stbiLoad' [Name]
/home/pk/Git/nimx/nimx/load_image_impl.nim(7480, 86) Hint: 'req_comp' should be: 'reqComp' [Name]
/home/pk/Git/nimx/nimx/load_image_impl.nim(7480, 6) Hint: 'stbi_load_from_memory' should be: 'stbiLoadFromMemory' [Name]
/home/pk/Git/nimx/nimx/load_image_impl.nim(7483, 6) Hint: 'stbi_image_free' should be: 'stbiImageFree' [Name]
.
/home/pk/Git/nimx/nimx/write_image_impl.nim(1545, 78) Hint: 'stride_in_bytes' should be: 'strideInBytes' [Name]
/home/pk/Git/nimx/nimx/write_image_impl.nim(1551, 74) Hint: 'stride_in_bytes' should be: 'strideInBytes' [Name]
/home/pk/Git/nimx/nimx/write_image_impl.nim(1551, 6) Hint: 'stbi_write_png' should be: 'stbiWritePng' [Name]
/home/pk/Git/nimx/nimx/write_image_impl.nim(1554, 6) Hint: 'stbi_write_bmp' should be: 'stbiWriteBmp' [Name]
/home/pk/Git/nimx/nimx/write_image_impl.nim(1557, 6) Hint: 'stbi_write_tga' should be: 'stbiWriteTga' [Name]
/home/pk/Git/nimx/nimx/write_image_impl.nim(1560, 6) Hint: 'stbi_write_hdr' should be: 'stbiWriteHdr' [Name]
........................................
/home/pk/.nimble/pkgs/async_http_request-0.1.4/async_http_request.nim(157, 34) template/generic instantiation of `request` from here
/home/pk/.choosenim/toolchains/nim-1.6.8/lib/pure/httpclient.nim(1086, 14) Warning: Deprecated since v1.5; use HttpMethod enum instead; string parameter httpMethod is deprecated [User]
....
/home/pk/Git/nimx/nimx/image.nim(657, 24) Error: type mismatch: got <array[0..8, string], proc (url: string, handler: proc (i: Image){.closure, gcsafe.}){.locks: 0.}>
but expected one of:
proc registerAssetLoader(fileExtensions: openArray[string];
                         loader: UrlLoaderProc)
  first type mismatch at position: 2
  required type for loader: UrlLoaderProc
  but expression 'proc (url: string; handler: proc (i: Image) {.gcsafe.}) =
  var ctx: ImageLoadingCtx
  new(ctx)
  ctx.url = url
  ctx.completionCallback = handler
  let curWnd = glGetCurrentWindow()
  if isNil(threadCtx):
    let curCtx = glGetCurrentContext()
    threadCtx = glCreateContext(curWnd)
    discard glMakeCurrent(curWnd, curCtx)
  ctx.glCtx = threadCtx
  const
    loc`gensym87 = (filename: "/home/pk/Git/nimx/nimx/image.nim", line: 671,
      column: 24)
    ploc`gensym87 = "/home/pk/Git/nimx/nimx/image.nim(671, 25)"
  bind instantiationInfo
  mixin failedAssertImpl
  {.line: (filename: "/home/pk/Git/nimx/nimx/image.nim", line: 671, column: 24).}:
    if not not isNil(ctx.glCtx):
      failedAssertImpl("/home/pk/Git/nimx/nimx/image.nim(671, 25) `not ctx.glCtx.isNil` ")
  ctx.wnd = curWnd
  GC_ref(ctx)
  if isNil(loadingQueue):
    loadingQueue = newWorkerQueue(1)
  addTask(loadingQueue, loadResourceThreaded, cast[pointer](ctx))' is of type: proc (url: string, handler: proc (i: Image){.closure, gcsafe.}){.locks: 0.}
  Pragma mismatch: got '{..}', but expected '{.gcsafe.}'.
  This expression is not GC-safe. Annotate the proc with {.gcsafe.} to get extended error information.
proc registerAssetLoader(fileExtensions: openArray[string];
                         streamLoader: StreamLoaderProc)
  first type mismatch at position: 2
  required type for streamLoader: StreamLoaderProc
  but expression 'proc (url: string; handler: proc (i: Image) {.gcsafe.}) =
  var ctx: ImageLoadingCtx
  new(ctx)
  ctx.url = url
  ctx.completionCallback = handler
  let curWnd = glGetCurrentWindow()
  if isNil(threadCtx):
    let curCtx = glGetCurrentContext()
    threadCtx = glCreateContext(curWnd)
    discard glMakeCurrent(curWnd, curCtx)
  ctx.glCtx = threadCtx
  const
    loc`gensym87 = (filename: "/home/pk/Git/nimx/nimx/image.nim", line: 671,
      column: 24)
    ploc`gensym87 = "/home/pk/Git/nimx/nimx/image.nim(671, 25)"
  bind instantiationInfo
  mixin failedAssertImpl
  {.line: (filename: "/home/pk/Git/nimx/nimx/image.nim", line: 671, column: 24).}:
    if not not isNil(ctx.glCtx):
      failedAssertImpl("/home/pk/Git/nimx/nimx/image.nim(671, 25) `not ctx.glCtx.isNil` ")
  ctx.wnd = curWnd
  GC_ref(ctx)
  if isNil(loadingQueue):
    loadingQueue = newWorkerQueue(1)
  addTask(loadingQueue, loadResourceThreaded, cast[pointer](ctx))' is of type: proc (url: string, handler: proc (i: Image){.closure, gcsafe.}){.locks: 0.}
  Pragma mismatch: got '{..}', but expected '{.gcsafe.}'.
  This expression is not GC-safe. Annotate the proc with {.gcsafe.} to get extended error information.
proc registerAssetLoader(urlSchemes: openArray[string];
                         fileExtensions: openArray[string];
                         loader: UrlLoaderProc)
  first type mismatch at position: 2
  required type for fileExtensions: openArray[string]
  but expression 'proc (url: string; handler: proc (i: Image) {.gcsafe.}) =
  var ctx: ImageLoadingCtx
  new(ctx)
  ctx.url = url
  ctx.completionCallback = handler
  let curWnd = glGetCurrentWindow()
  if isNil(threadCtx):
    let curCtx = glGetCurrentContext()
    threadCtx = glCreateContext(curWnd)
    discard glMakeCurrent(curWnd, curCtx)
  ctx.glCtx = threadCtx
  const
    loc`gensym87 = (filename: "/home/pk/Git/nimx/nimx/image.nim", line: 671,
      column: 24)
    ploc`gensym87 = "/home/pk/Git/nimx/nimx/image.nim(671, 25)"
  bind instantiationInfo
  mixin failedAssertImpl
  {.line: (filename: "/home/pk/Git/nimx/nimx/image.nim", line: 671, column: 24).}:
    if not not isNil(ctx.glCtx):
      failedAssertImpl("/home/pk/Git/nimx/nimx/image.nim(671, 25) `not ctx.glCtx.isNil` ")
  ctx.wnd = curWnd
  GC_ref(ctx)
  if isNil(loadingQueue):
    loadingQueue = newWorkerQueue(1)
  addTask(loadingQueue, loadResourceThreaded, cast[pointer](ctx))' is of type: proc (url: string, handler: proc (i: Image){.closure, gcsafe.}){.locks: 0.}
proc registerAssetLoader[T](fileExtensions: openArray[string];
                            loader: SimpleUrlLoaderProc[T])
  first type mismatch at position: 2
  required type for loader: SimpleUrlLoaderProc[registerAssetLoader.T]
  but expression 'proc (url: string; handler: proc (i: Image) {.gcsafe.}) =
  var ctx: ImageLoadingCtx
  new(ctx)
  ctx.url = url
  ctx.completionCallback = handler
  let curWnd = glGetCurrentWindow()
  if isNil(threadCtx):
    let curCtx = glGetCurrentContext()
    threadCtx = glCreateContext(curWnd)
    discard glMakeCurrent(curWnd, curCtx)
  ctx.glCtx = threadCtx
  const
    loc`gensym87 = (filename: "/home/pk/Git/nimx/nimx/image.nim", line: 671,
      column: 24)
    ploc`gensym87 = "/home/pk/Git/nimx/nimx/image.nim(671, 25)"
  bind instantiationInfo
  mixin failedAssertImpl
  {.line: (filename: "/home/pk/Git/nimx/nimx/image.nim", line: 671, column: 24).}:
    if not not isNil(ctx.glCtx):
      failedAssertImpl("/home/pk/Git/nimx/nimx/image.nim(671, 25) `not ctx.glCtx.isNil` ")
  ctx.wnd = curWnd
  GC_ref(ctx)
  if isNil(loadingQueue):
    loadingQueue = newWorkerQueue(1)
  addTask(loadingQueue, loadResourceThreaded, cast[pointer](ctx))' is of type: proc (url: string, handler: proc (i: Image){.closure, gcsafe.}){.locks: 0.}
proc registerAssetLoader[T](fileExtensions: openArray[string];
                            streamLoader: SimpleStreamLoaderProc[T])
  first type mismatch at position: 2
  required type for streamLoader: SimpleStreamLoaderProc[registerAssetLoader.T]
  but expression 'proc (url: string; handler: proc (i: Image) {.gcsafe.}) =
  var ctx: ImageLoadingCtx
  new(ctx)
  ctx.url = url
  ctx.completionCallback = handler
  let curWnd = glGetCurrentWindow()
  if isNil(threadCtx):
    let curCtx = glGetCurrentContext()
    threadCtx = glCreateContext(curWnd)
    discard glMakeCurrent(curWnd, curCtx)
  ctx.glCtx = threadCtx
  const
    loc`gensym87 = (filename: "/home/pk/Git/nimx/nimx/image.nim", line: 671,
      column: 24)
    ploc`gensym87 = "/home/pk/Git/nimx/nimx/image.nim(671, 25)"
  bind instantiationInfo
  mixin failedAssertImpl
  {.line: (filename: "/home/pk/Git/nimx/nimx/image.nim", line: 671, column: 24).}:
    if not not isNil(ctx.glCtx):
      failedAssertImpl("/home/pk/Git/nimx/nimx/image.nim(671, 25) `not ctx.glCtx.isNil` ")
  ctx.wnd = curWnd
  GC_ref(ctx)
  if isNil(loadingQueue):
    loadingQueue = newWorkerQueue(1)
  addTask(loadingQueue, loadResourceThreaded, cast[pointer](ctx))' is of type: proc (url: string, handler: proc (i: Image){.closure, gcsafe.}){.locks: 0.}
proc registerAssetLoader[T](urlSchemes: openArray[string];
                            fileExtensions: openArray[string];
                            simpleLoader: SimpleUrlLoaderProc[T])
  first type mismatch at position: 2
  required type for fileExtensions: openArray[string]
  but expression 'proc (url: string; handler: proc (i: Image) {.gcsafe.}) =
  var ctx: ImageLoadingCtx
  new(ctx)
  ctx.url = url
  ctx.completionCallback = handler
  let curWnd = glGetCurrentWindow()
  if isNil(threadCtx):
    let curCtx = glGetCurrentContext()
    threadCtx = glCreateContext(curWnd)
    discard glMakeCurrent(curWnd, curCtx)
  ctx.glCtx = threadCtx
  const
    loc`gensym87 = (filename: "/home/pk/Git/nimx/nimx/image.nim", line: 671,
      column: 24)
    ploc`gensym87 = "/home/pk/Git/nimx/nimx/image.nim(671, 25)"
  bind instantiationInfo
  mixin failedAssertImpl
  {.line: (filename: "/home/pk/Git/nimx/nimx/image.nim", line: 671, column: 24).}:
    if not not isNil(ctx.glCtx):
      failedAssertImpl("/home/pk/Git/nimx/nimx/image.nim(671, 25) `not ctx.glCtx.isNil` ")
  ctx.wnd = curWnd
  GC_ref(ctx)
  if isNil(loadingQueue):
    loadingQueue = newWorkerQueue(1)
  addTask(loadingQueue, loadResourceThreaded, cast[pointer](ctx))' is of type: proc (url: string, handler: proc (i: Image){.closure, gcsafe.}){.locks: 0.}

expression: registerAssetLoader(["png", "jpg", "jpeg", "gif", "tif", "tiff", "tga", "pvr",
                     "webp"], proc (url: string;
                                    handler: proc (i: Image) {.gcsafe.}) =
  var ctx: ImageLoadingCtx
  new(ctx)
  ctx.url = url
  ctx.completionCallback = handler
  let curWnd = glGetCurrentWindow()
  if isNil(threadCtx):
    let curCtx = glGetCurrentContext()
    threadCtx = glCreateContext(curWnd)
    discard glMakeCurrent(curWnd, curCtx)
  ctx.glCtx = threadCtx
  const
    loc`gensym87 = (filename: "/home/pk/Git/nimx/nimx/image.nim", line: 671,
      column: 24)
    ploc`gensym87 = "/home/pk/Git/nimx/nimx/image.nim(671, 25)"
  bind instantiationInfo
  mixin failedAssertImpl
  {.line: (filename: "/home/pk/Git/nimx/nimx/image.nim", line: 671, column: 24).}:
    if not not isNil(ctx.glCtx):
      failedAssertImpl("/home/pk/Git/nimx/nimx/image.nim(671, 25) `not ctx.glCtx.isNil` ")
  ctx.wnd = curWnd
  GC_ref(ctx)
  if isNil(loadingQueue):
    loadingQueue = newWorkerQueue(1)
  addTask(loadingQueue, loadResourceThreaded, cast[pointer](ctx)))
yglukhov commented 1 year ago

Thanks for the report, please update both nimx (52891504b2cebc84afb1c6d78ac6b939ee245986) and async_http_request (https://github.com/yglukhov/async_http_request/commit/351e68770aed11e4c22b8d3d1de1d0c35872a785) and try again

muemmel commented 1 year ago

@yglukhov Thank you! That fixes the issue.