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

Update the emscripten version to 2.0.23 #681

Merged
merged 26 commits into from
Jun 24, 2021
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ac1df54
updated the emsdk version and other minor fix
Devika-Tantry Jun 9, 2021
cae6de8
minor revert
Devika-Tantry Jun 9, 2021
daec43a
space fix and install number fix
Devika-Tantry Jun 9, 2021
e14cc3f
updated dependency version
Devika-Tantry Jun 9, 2021
6ed6c37
test changes will revert it
Devika-Tantry Jun 9, 2021
0f7c84e
updated hash content and updated to 2.023
Devika-Tantry Jun 9, 2021
6dbda06
updated hash content and updated to 2.023
Devika-Tantry Jun 9, 2021
4b959ec
updated commit id to pint to correct value
Devika-Tantry Jun 9, 2021
338a30e
test changes
Devika-Tantry Jun 14, 2021
33207e2
conver of double to int INT as JS clamp
Devika-Tantry Jun 14, 2021
b80bf11
added .vs file to git ignore
Devika-Tantry Jun 14, 2021
fd75eaf
reverted changes in yml file and minor other fix
Devika-Tantry Jun 14, 2021
62260d5
build fail fix
Devika-Tantry Jun 16, 2021
233c79b
build fail fix
Devika-Tantry Jun 16, 2021
71c2cb3
added new line
Devika-Tantry Jun 16, 2021
70ee2f4
node version update
Devika-Tantry Jun 16, 2021
ed04573
python update
Devika-Tantry Jun 16, 2021
943a2ad
added const to variabale as per comment
Devika-Tantry Jun 17, 2021
5e2867f
changes to look exactly like emcc alogorithm
Devika-Tantry Jun 17, 2021
2162727
Reverted cpp and changes and changed tests
Devika-Tantry Jun 21, 2021
29a495d
lint error fix and test fix
Devika-Tantry Jun 21, 2021
5f3ef20
minor comment update and reverted python update
Devika-Tantry Jun 22, 2021
71aa65f
lint fix
Devika-Tantry Jun 22, 2021
91b56d4
node verision revert
Devika-Tantry Jun 22, 2021
eaa80fc
python revert
Devika-Tantry Jun 22, 2021
edce41a
Added author
Devika-Tantry Jun 24, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
# Install lint dependencies
- uses: actions/setup-python@v2
with:
python-version: '3.5'
python-version: '3.9'
rajsite marked this conversation as resolved.
Show resolved Hide resolved
- uses: actions/setup-node@v1
with:
node-version: '12'
node-version: '14'
registry-url: 'https://registry.npmjs.org'
- run: npm ci

Expand All @@ -42,23 +42,23 @@ jobs:
# Install web dependencies
- uses: actions/setup-python@v2
with:
python-version: '3.5'
python-version: '3.9'
- run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- run: nohup python -m httpbin.core --port 64526 --host 0.0.0.0 &
- uses: actions/setup-node@v1
with:
node-version: '12'
node-version: '14'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: |
git clone https://github.com/juj/emsdk.git
cd emsdk
git checkout 369013943283939412fb2807bb0d2ded8ebd5a9e
git checkout f44b84154703d29a946d51ddee08f4e5725a61db
Devika-Tantry marked this conversation as resolved.
Show resolved Hide resolved
- run: |
emsdk/emsdk install 1.39.5-fastcomp
emsdk/emsdk activate 1.39.5-fastcomp
emsdk/emsdk install 2.0.23
emsdk/emsdk activate 2.0.23
- run: . emsdk/emsdk_env.sh && emcc -v

# Build web
Expand Down Expand Up @@ -103,25 +103,25 @@ jobs:
# Install web-windows dependencies
- uses: actions/setup-node@v1
with:
node-version: '12'
node-version: '14'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: chocolatey install make -y
- run: chocolatey install gnuwin32-coreutils.portable -y
- uses: actions/setup-python@v2
with:
python-version: '3.5'
python-version: '3.9'
- run: |
python -m pip install --upgrade pip
pip install tox
- run: Start-Process npm "run httpbin" -PassThru
- run: |
git clone https://github.com/juj/emsdk.git
cd emsdk
git checkout 369013943283939412fb2807bb0d2ded8ebd5a9e
git checkout f44b84154703d29a946d51ddee08f4e5725a61db
Devika-Tantry marked this conversation as resolved.
Show resolved Hide resolved
- run: |
emsdk\emsdk install 1.39.5-fastcomp
emsdk\emsdk activate 1.39.5-fastcomp
emsdk\emsdk install 2.0.23
emsdk\emsdk activate 2.0.23
- run: emsdk\emsdk_env.ps1 && emcc -v

# Build web-windows
Expand Down Expand Up @@ -227,7 +227,7 @@ jobs:
# Install linux dependencies
- uses: actions/setup-node@v1
with:
node-version: '12'
node-version: '14'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: echo gcc -v
Expand Down
3 changes: 3 additions & 0 deletions .vs/ProjectSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"CurrentProjectSetting": "x64-Debug (default)"
}
Binary file added .vs/slnx.sqlite
Binary file not shown.
Binary file added .vs/slnx.sqlite-journal
Binary file not shown.
4 changes: 2 additions & 2 deletions docs/Build.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ The emsdk toolchain is used to cross-compile Vireo to Vireo.js to run in Node.js
3. From the cloned emsdk repository run the following commands:

```console
emsdk install 1.39.5-fastcomp
emsdk activate 1.39.5-fastcomp
emsdk install 2.0.23
emsdk activate 2.0.23
emcc -v # should match the sdk version
```

Expand Down
8 changes: 4 additions & 4 deletions make-it/EmMakefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ EMCC= emcc
EM_OPTFLAG = -O3

ifeq ($(BUILD), debug)
EM_OPTFLAG = -g4 -s ASSERTIONS=2 -s SAFE_HEAP=1
EM_OPTFLAG = -g -s ASSERTIONS=2 -s SAFE_HEAP=1
rajsite marked this conversation as resolved.
Show resolved Hide resolved
endif

ifeq ($(BUILD), profile)
Expand All @@ -92,11 +92,11 @@ ifeq ($(TARGET), asmjs-unknown-emscripten)
endif

ifeq ($(TARGET), wasm32-unknown-emscripten)
TARGET_FLAG = -s WASM=1 -s BINARYEN_TRAP_MODE=js -s ALLOW_MEMORY_GROWTH=1
rajsite marked this conversation as resolved.
Show resolved Hide resolved
TARGET_FLAG = -s WASM=1 -s ALLOW_MEMORY_GROWTH=1
endif

# NO_DYNAMIC_EXECUTION=1 Allows Vireo to be used in CSP environments where eval() is forbidden: https://github.com/kripken/emscripten/blob/master/src/settings.js#L563
EM_OPT = $(EM_OPTFLAGS) $(TARGET_FLAG) -s NO_EXIT_RUNTIME=1 -std=c++14 -fno-exceptions -Werror --memory-init-file 0 -s NO_DYNAMIC_EXECUTION=1 -s MODULARIZE=1 -s EXPORT_NAME=VireoCreateCoreModule -s EXPORT_ES6=1 -s USE_ES6_IMPORT_META=0 --minify 0 -s NO_FILESYSTEM=1 -s ABORTING_MALLOC=0
rajsite marked this conversation as resolved.
Show resolved Hide resolved
EM_OPT = $(EM_OPTFLAGS) $(TARGET_FLAG) -std=c++14 -fno-exceptions -Werror --memory-init-file 0 -s NO_DYNAMIC_EXECUTION=1 -s MODULARIZE=1 -s EXPORT_NAME=VireoCreateCoreModule -s EXPORT_ES6=1 -s USE_ES6_IMPORT_META=0 --minify 0 -s NO_FILESYSTEM=1 -s ABORTING_MALLOC=0
EMFLAGS = -I$(INCDIR) -DkVireoOS_emscripten $(EM_OPT)
EMLIBRARY = --js-library $(CORESOURCEDIR)/library_coreHelpers.js \
--js-library $(CORESOURCEDIR)/library_eventHelpers.js \
Expand All @@ -111,7 +111,7 @@ EM_EXPORTS = -s EXPORTED_FUNCTIONS="[\
'_free' \
]"

EM_RUNTIME_EXPORTS = -s EXTRA_EXPORTED_RUNTIME_METHODS="[\
rajsite marked this conversation as resolved.
Show resolved Hide resolved
EM_RUNTIME_EXPORTS = -s EXPORTED_RUNTIME_METHODS="[\
'lengthBytesUTF8', \
'stackAlloc', \
'stackSave', \
Expand Down
4 changes: 2 additions & 2 deletions make-it/EmMakefile-AAL
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ifeq (,$(wildcard $(ANALYSIS_WRAPPERS_SOURCE_DIRECTORY)/AnalysisWrapper*.cpp))
ANALYSIS_LIBRARY = $(OBJS)/NoAnalysisLibrary.bc
$(OBJS)/NoAnalysisLibrary.bc: | no-analysis
touch $(OBJS)/NoAnalysis.cpp
$(EMCC) $(EM_ANALYSIS_FLAGS) -o $@ $(OBJS)/NoAnalysis.cpp
$(EMCC) $(EM_ANALYSIS_FLAGS) -o $@ $(OBJS)/NoAnalysis.cpp -c
rajsite marked this conversation as resolved.
Show resolved Hide resolved
rm $(OBJS)/NoAnalysis.cpp

no-analysis::
Expand Down Expand Up @@ -94,7 +94,7 @@ help:

EMCC= emcc
EM_OPTFLAG = -Os
EM_OPT= $(EM_OPT_FLAG) -s NO_EXIT_RUNTIME=1 -fno-exceptions --memory-init-file 0
EM_OPT= $(EM_OPT_FLAG) -s -fno-exceptions --memory-init-file 0
EMFLAGS= -I$(INCDIR) -DkVireoOS_emscripten -DVIREO_LEAN $(EM_OPT)
EMLIBRARY= --js-library $(IOSOURCEDIR)/library_canvas2d.js --js-library $(IOSOURCEDIR)/library_httpClient.js
EM_WRAP= --pre-js $(CORESOURCEDIR)/vireo.preamble.js --post-js $(CORESOURCEDIR)/vireo.postamble.js
Expand Down
6 changes: 4 additions & 2 deletions source/core/TypeAndDataManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2637,7 +2637,8 @@ IntMax ReadIntFromMemory(TypeRef type, void* pData)
case 0: value = 0; break;
case 4: {
Single singleVal = RoundToEven(*(Single*)pData);
if (singleVal >= std::numeric_limits<IntMax>::max())
Single intMax = (Single)(std::numeric_limits<IntMax>::max());
Devika-Tantry marked this conversation as resolved.
Show resolved Hide resolved
if (singleVal >= intMax)
// >= is actually correct here because Int64 max isn't representable as a single and rounds up.
value = std::numeric_limits<IntMax>::max();
else if (singleVal <= std::numeric_limits<IntMax>::min())
Expand All @@ -2648,7 +2649,8 @@ IntMax ReadIntFromMemory(TypeRef type, void* pData)
}
case 8: {
Double doubleVal = RoundToEven(*(Double*)pData);
if (doubleVal >= std::numeric_limits<IntMax>::max())
Double intMax = (Double)(std::numeric_limits<IntMax>::max());
Devika-Tantry marked this conversation as resolved.
Show resolved Hide resolved
if (doubleVal >= intMax)
// >= is actually correct here because Int64 max isn't representable as a double and rounds up.
value = std::numeric_limits<IntMax>::max();
else if (doubleVal <= std::numeric_limits<IntMax>::min())
Expand Down
3 changes: 2 additions & 1 deletion source/include/TypeAndDataManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -366,13 +366,14 @@ template <typename TSource, typename TDest>
TDest ConvertFloatToInt(TSource src)
{
TDest dest;
TSource maxDestValue = static_cast<TSource>(std::numeric_limits<TDest>::max());
Devika-Tantry marked this conversation as resolved.
Show resolved Hide resolved
if (std::isnan(src)) {
dest = std::numeric_limits<TDest>::max();
} else if (std::isinf(src)) {
dest = src < 0 ? std::numeric_limits<TDest>::min() : std::numeric_limits<TDest>::max();
} else if (src < std::numeric_limits<TDest>::min()) {
dest = std::numeric_limits<TDest>::min();
} else if (src > std::numeric_limits<TDest>::max()) {
} else if (src > maxDestValue) {
dest = std::numeric_limits<TDest>::max();
} else {
dest = static_cast<TDest>(RoundToEven(src));
Expand Down