Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 8 commits into from
May 18, 2022

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