Skip to content

builder: runtime.buildVersion not a string #4810

Closed
@ydnar

Description

@ydnar

When running tests under -target=wasip2, the build for #4809 was failing when testing crypto/elliiptic:

$ tinygo test -v -target=wasip2 crypto/elliptic
FAIL	crypto/elliptic	0.000s
runtime.buildVersion: not a string

I traced the issue to an error type in package internal/cm:

var (
	errEmpty          = &stringError{err: "empty text"}
	errNoMatchingCase = &stringError{err: "no matching case"}
)

type stringError struct {
	_   struct{}
	err string
}

func (err *stringError) Error() string {
	return err.err
}

Removing this type fixes the build-time error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions