Re: regenerate wasm.js from preamble.js

2021-04-21 Thread Александр Гурьянов
I did it. However I realized that it is not what I actually want, I will
write a new topic.

ср, 21 апр. 2021 г. в 09:05, Александр Гурьянов :

> Yeah pushing emscripten of Unity to new version is a best solution either,
> but I think it's impossible. They didn't change emscripten version for many
> years, they use 1.38.11. I don't know why, maybe there is some internal
> problem, but seems it's not into their priority. They  still use js2wasm to
> generate WebAssembly.
>
> I tried to update it manually by replacing emscripten, and hook into build
> scripts, however they also uses *.bc files to link into binary. As answered
> before, it's not possible to use *.bc files from older version of
> emscripten with newer emscripten.
>
> So, I see back porting wasm-split is only solution, btw I hope it will not
> be super hard. I did similar stuff with js split. I use wasm file from
> unity and split out some functions into js, now I just want to improve my
> technology with wasm-split.
>
>
>
> ср, 21 апр. 2021 г. в 00:31, 'Sam Clegg' via emscripten-discuss <
> emscripten-discuss@googlegroups.com>:
>
>> SPLIT_MODULE is currently experimental, with limited testing.   Trying to
>> backport it to an older version of emscripten, while not impossible, is
>> likely to result in many challenges, and is not really a use case that we
>> want to have to support.   It might just work.. but you will likely need to
>> get down in the weeds to fix any issues that come up.   Your energy may be
>> better spent trying to push unity to upgrade the version of emscripten they
>> support.
>>
>> cheers,
>> sam
>>
>> On Tue, Apr 20, 2021 at 2:45 AM Александр Гурьянов 
>> wrote:
>>
>>> Hi. I am trying to use SPLIT_MODULE with Unity. However unity shipped
>>> with old emscripten that does not know how to deal with SPLIT_MODULE. I
>>> successfully spitted wasm file with wasm-split, but I can't run it because
>>> .js file can't load it.
>>>
>>> Is it possible to regenerate .js file for given wasm, wasm.deferred
>>> file? Or if it is not possible, what I should define for correct work of
>>> SPLIT_MODULE? Currently I even can't start main module, had this error:
>>>
>>>
>>> index.js:1 3943ms |  ERR! RangeError: offset is out of bounds
>>> at Int8Array.set ()
>>> at mergeMemory (eval at value (
>>> http://localhost:3000/dev/web/debug/gamepix-loader.js:6586:98),
>>> :1059:17)
>>> at receiveInstance (eval at value (
>>> http://localhost:3000/dev/web/debug/gamepix-loader.js:6586:98),
>>> :1120:33)
>>> at http://localhost:3000/dev/web/debug/gamepix-loader.js:6743:119
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "emscripten-discuss" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to emscripten-discuss+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/emscripten-discuss/CAKOm%3DVHu%2B5srLKjuitYZLhtpbiFg6RdSjLytNcg6XwzDk3Wf%2Bw%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "emscripten-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to emscripten-discuss+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/emscripten-discuss/CAL_va29o-%2Bu__%2BjOephiNmCKCXD8XxPrhgYuL%3DBEmwn8bYMHHg%40mail.gmail.com
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to emscripten-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/CAKOm%3DVFgBh%2BnriFcmT71tqsc-ooEPeBWzAnZavckM7gwCOo8bQ%40mail.gmail.com.


Re: regenerate wasm.js from preamble.js

2021-04-20 Thread Александр Гурьянов
Yeah pushing emscripten of Unity to new version is a best solution either,
but I think it's impossible. They didn't change emscripten version for many
years, they use 1.38.11. I don't know why, maybe there is some internal
problem, but seems it's not into their priority. They  still use js2wasm to
generate WebAssembly.

I tried to update it manually by replacing emscripten, and hook into build
scripts, however they also uses *.bc files to link into binary. As answered
before, it's not possible to use *.bc files from older version of
emscripten with newer emscripten.

So, I see back porting wasm-split is only solution, btw I hope it will not
be super hard. I did similar stuff with js split. I use wasm file from
unity and split out some functions into js, now I just want to improve my
technology with wasm-split.



ср, 21 апр. 2021 г. в 00:31, 'Sam Clegg' via emscripten-discuss <
emscripten-discuss@googlegroups.com>:

> SPLIT_MODULE is currently experimental, with limited testing.   Trying to
> backport it to an older version of emscripten, while not impossible, is
> likely to result in many challenges, and is not really a use case that we
> want to have to support.   It might just work.. but you will likely need to
> get down in the weeds to fix any issues that come up.   Your energy may be
> better spent trying to push unity to upgrade the version of emscripten they
> support.
>
> cheers,
> sam
>
> On Tue, Apr 20, 2021 at 2:45 AM Александр Гурьянов 
> wrote:
>
>> Hi. I am trying to use SPLIT_MODULE with Unity. However unity shipped
>> with old emscripten that does not know how to deal with SPLIT_MODULE. I
>> successfully spitted wasm file with wasm-split, but I can't run it because
>> .js file can't load it.
>>
>> Is it possible to regenerate .js file for given wasm, wasm.deferred file?
>> Or if it is not possible, what I should define for correct work of
>> SPLIT_MODULE? Currently I even can't start main module, had this error:
>>
>>
>> index.js:1 3943ms |  ERR! RangeError: offset is out of bounds
>> at Int8Array.set ()
>> at mergeMemory (eval at value (
>> http://localhost:3000/dev/web/debug/gamepix-loader.js:6586:98),
>> :1059:17)
>> at receiveInstance (eval at value (
>> http://localhost:3000/dev/web/debug/gamepix-loader.js:6586:98),
>> :1120:33)
>> at http://localhost:3000/dev/web/debug/gamepix-loader.js:6743:119
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "emscripten-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to emscripten-discuss+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/emscripten-discuss/CAKOm%3DVHu%2B5srLKjuitYZLhtpbiFg6RdSjLytNcg6XwzDk3Wf%2Bw%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to emscripten-discuss+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/emscripten-discuss/CAL_va29o-%2Bu__%2BjOephiNmCKCXD8XxPrhgYuL%3DBEmwn8bYMHHg%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to emscripten-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/CAKOm%3DVGrYHRt2A3dWw2wKdDuQK2VecMAv7a5MVrJ02w-%2BYEf9w%40mail.gmail.com.


Re: regenerate wasm.js from preamble.js

2021-04-20 Thread 'Sam Clegg' via emscripten-discuss
SPLIT_MODULE is currently experimental, with limited testing.   Trying to
backport it to an older version of emscripten, while not impossible, is
likely to result in many challenges, and is not really a use case that we
want to have to support.   It might just work.. but you will likely need to
get down in the weeds to fix any issues that come up.   Your energy may be
better spent trying to push unity to upgrade the version of emscripten they
support.

cheers,
sam

On Tue, Apr 20, 2021 at 2:45 AM Александр Гурьянов 
wrote:

> Hi. I am trying to use SPLIT_MODULE with Unity. However unity shipped with
> old emscripten that does not know how to deal with SPLIT_MODULE. I
> successfully spitted wasm file with wasm-split, but I can't run it because
> .js file can't load it.
>
> Is it possible to regenerate .js file for given wasm, wasm.deferred file?
> Or if it is not possible, what I should define for correct work of
> SPLIT_MODULE? Currently I even can't start main module, had this error:
>
>
> index.js:1 3943ms |  ERR! RangeError: offset is out of bounds
> at Int8Array.set ()
> at mergeMemory (eval at value (
> http://localhost:3000/dev/web/debug/gamepix-loader.js:6586:98),
> :1059:17)
> at receiveInstance (eval at value (
> http://localhost:3000/dev/web/debug/gamepix-loader.js:6586:98),
> :1120:33)
> at http://localhost:3000/dev/web/debug/gamepix-loader.js:6743:119
>
> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to emscripten-discuss+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/emscripten-discuss/CAKOm%3DVHu%2B5srLKjuitYZLhtpbiFg6RdSjLytNcg6XwzDk3Wf%2Bw%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to emscripten-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/CAL_va29o-%2Bu__%2BjOephiNmCKCXD8XxPrhgYuL%3DBEmwn8bYMHHg%40mail.gmail.com.


Re: regenerate wasm.js from preamble.js

2021-04-20 Thread Alon Zakai
There is an experimental --post-link option to create a JS file for a given
linked wasm file. However it isn't aware of SPLIT_MODULE so I am not sure
if it will work here.

On Tue, Apr 20, 2021 at 2:45 AM Александр Гурьянов 
wrote:

> Hi. I am trying to use SPLIT_MODULE with Unity. However unity shipped with
> old emscripten that does not know how to deal with SPLIT_MODULE. I
> successfully spitted wasm file with wasm-split, but I can't run it because
> .js file can't load it.
>
> Is it possible to regenerate .js file for given wasm, wasm.deferred file?
> Or if it is not possible, what I should define for correct work of
> SPLIT_MODULE? Currently I even can't start main module, had this error:
>
>
> index.js:1 3943ms |  ERR! RangeError: offset is out of bounds
> at Int8Array.set ()
> at mergeMemory (eval at value (
> http://localhost:3000/dev/web/debug/gamepix-loader.js:6586:98),
> :1059:17)
> at receiveInstance (eval at value (
> http://localhost:3000/dev/web/debug/gamepix-loader.js:6586:98),
> :1120:33)
> at http://localhost:3000/dev/web/debug/gamepix-loader.js:6743:119
>
> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to emscripten-discuss+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/emscripten-discuss/CAKOm%3DVHu%2B5srLKjuitYZLhtpbiFg6RdSjLytNcg6XwzDk3Wf%2Bw%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to emscripten-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/CAEX4NpRL2w5gdbB5-LLi9xSvTeThPdOANub5uwodx2MNovjs-g%40mail.gmail.com.


regenerate wasm.js from preamble.js

2021-04-20 Thread Александр Гурьянов
Hi. I am trying to use SPLIT_MODULE with Unity. However unity shipped with
old emscripten that does not know how to deal with SPLIT_MODULE. I
successfully spitted wasm file with wasm-split, but I can't run it because
.js file can't load it.

Is it possible to regenerate .js file for given wasm, wasm.deferred file?
Or if it is not possible, what I should define for correct work of
SPLIT_MODULE? Currently I even can't start main module, had this error:


index.js:1 3943ms |  ERR! RangeError: offset is out of bounds
at Int8Array.set ()
at mergeMemory (eval at value (
http://localhost:3000/dev/web/debug/gamepix-loader.js:6586:98),
:1059:17)
at receiveInstance (eval at value (
http://localhost:3000/dev/web/debug/gamepix-loader.js:6586:98),
:1120:33)
at http://localhost:3000/dev/web/debug/gamepix-loader.js:6743:119

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to emscripten-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/CAKOm%3DVHu%2B5srLKjuitYZLhtpbiFg6RdSjLytNcg6XwzDk3Wf%2Bw%40mail.gmail.com.