Coder Social home page Coder Social logo

Build failure using TinyGo about sysfont HOT 6 OPEN

adrg avatar adrg commented on July 20, 2024
Build failure using TinyGo

from sysfont.

Comments (6)

adrg avatar adrg commented on July 20, 2024

Hi @tdewolff. It would be great if TinyGo was supported by xdg (and implicitly by sysfont). However, I think it might be better to raise the issues on the TinyGo repository. It would certainly avoid a lot of workarounds on my part in order to make it work.

From what I can tell, two of the three issues you mentioned are already in work there:

ModeDir not declared by package os: there's already an issue for this (tinygo-org/tinyfs#4) and a PR (tinygo-org/tinygo#1903) which has been merged already.

Getuid not declared by package os: there's already an issue for this one as well (tinygo-org/tinygo#1886) and a PR (tinygo-org/tinygo#1892) which will hopefully be merged soon.

So there's only MkdirAll not declared by package os left. Maybe @gedw99 can open an issue there regarding this because it's not specific to the xdg library.

Are these issues on Go 1.16 only or does this reproduce with Go 1.15 as well?

from sysfont.

tdewolff avatar tdewolff commented on July 20, 2024

Hey Adrian, thanks for the quick and in-depth response. I agree this would be better to take up with TinyGo!

from sysfont.

gedw99 avatar gedw99 commented on July 20, 2024

hey @tdewolff @adrg

"So there's only MkdirAll not declared by package os left ..."

Some ideas on this:

  1. Virtualise the OS file system using indexdb as the base store.

https://github.com/JohnStarich/go-wasm/blob/master/internal/js/fs/mkdir.go

Johns project wraps the golang file OS with a indexdb based implementation, allowing golang wasm to work.
He uses file embeded at compile time to put the golang src code into the system it seems.
This is not what we want though i think. As what you want is to be able to see if the fonts are on the real OS the browser is running on right ?

Yep its crazy but thats the golang src files, sitting there in indexdb.
Screenshot 2021-06-04 at 14 49 43

  1. this supports Mkdir: tinygo-org/tinyfs#5

Not sure if this is a viable option for the sysfont project though.

from sysfont.

gedw99 avatar gedw99 commented on July 20, 2024

Hmm there is also this

https://web.dev/file-system-access/#storing-file-handles-or-directory-handles-in-indexeddb

from sysfont.

gedw99 avatar gedw99 commented on July 20, 2024

BTW added "no-debug" flag sometimes helps things work

For example:
tinygo build -o wasm.wasm -target=wasm -no-debug -tags=example ./examples/2048/

from sysfont.

dkegel-fastly avatar dkegel-fastly commented on July 20, 2024

tinygo now supports os.MkdirAll().

The next problem blocking "tinygo test" from working in sysfont seems to be unsupported uses of reflect in testify and go-spew, see
tinygo-org/tinygo#2650
tinygo-org/tinygo#2649

from sysfont.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.