Skip to content

Add JS/WASM platform mmap no-op implementation.#188

Merged
richardlehane merged 8 commits intorichardlehane:developfrom
ukwa:js-wasm-support
May 18, 2022
Merged

Add JS/WASM platform mmap no-op implementation.#188
richardlehane merged 8 commits intorichardlehane:developfrom
ukwa:js-wasm-support

Conversation

@anjackson
Copy link
Contributor

@anjackson anjackson commented May 13, 2022

This add an no-op implementation of mmap for the js platform. With this in place, Siegfried compiles under:

GOOS=js GOARCH=wasm go build -o main.wasm

NOTE THAT THIS HAS NOT YET BEEN TESTED!

Now tested and seems to work well, see https://github.com/ukwa/siegfried-js#readme

@anjackson
Copy link
Contributor Author

Okay, so hacking our the dependency on user.Current (f84deff) needs to be done with more care.

But, other than that, with these changes, I managed to successfully run a Siegfried identification process in the browser via WebAssembly. See https://github.com/ukwa/siegfried-js#readme

@richardlehane
Copy link
Owner

look forward to trying this out, thanks Andy!

@anjackson
Copy link
Contributor Author

Thanks Richard. I just realised I could extend the existing conditional build settings for config/default.go rather than modifying the behaviour of the sf tool, so that should be an improvement.

@richardlehane richardlehane changed the base branch from main to develop May 18, 2022 19:54
@richardlehane richardlehane merged commit fb4f706 into richardlehane:develop May 18, 2022
richardlehane pushed a commit that referenced this pull request Mar 20, 2023
* test fails if close reader before drained

* Add JS/WASM platform mmap dummy implementation.

* Make lack of user.Current a non-fatal error.

* Shift signature file reader into LoadReader so it can be used on non-file sources.

* Cleaner to simply omit this file from js builds.
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.

2 participants