mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 13:42:24 -05:00
[feature/OFFICIALLY UNSUPPORTED] add nowasm build tag to disable building with WebAssembly (#3429)
* add experimental build-tag 'nowasm' which uses local ffmpeg / ffprobe * updated experimental support message * add comment to build script explaining build tag * add nowasm build tags to moderncsqlite files
This commit is contained in:
parent
157ee3193d
commit
6a76b9d609
13 changed files with 301 additions and 26 deletions
|
|
@ -19,9 +19,6 @@ package ffmpeg
|
|||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"codeberg.org/gruf/go-ffmpreg/wasm"
|
||||
"github.com/tetratelabs/wazero"
|
||||
)
|
||||
|
||||
// runner simply abstracts away the complexities
|
||||
|
|
@ -53,7 +50,7 @@ func (r *runner) Init(n int) {
|
|||
|
||||
// Run will attempt to pass the given compiled WebAssembly module with args to run(), waiting on
|
||||
// the receiving runner until a free slot is available to run an instance, (if a limit is enabled).
|
||||
func (r *runner) Run(ctx context.Context, cmod wazero.CompiledModule, args Args) (uint32, error) {
|
||||
func (r *runner) Run(ctx context.Context, run func() (uint32, error)) (uint32, error) {
|
||||
select {
|
||||
// Context canceled.
|
||||
case <-ctx.Done():
|
||||
|
|
@ -66,6 +63,6 @@ func (r *runner) Run(ctx context.Context, cmod wazero.CompiledModule, args Args)
|
|||
// Release slot back to pool on end.
|
||||
defer func() { r.pool <- struct{}{} }()
|
||||
|
||||
// Pass to main module runner function.
|
||||
return wasm.Run(ctx, runtime, cmod, args)
|
||||
// Call run.
|
||||
return run()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue