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

Upgrade emscripten to 2.0.29 #1539

Merged
merged 2 commits into from
Sep 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
35 changes: 17 additions & 18 deletions cpp/perspective/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -226,17 +226,7 @@ if (PSP_WASM_BUILD)
--source-map-base ./build/ \
--memory-init-file 0 \
-Wall \
-s NO_EXIT_RUNTIME=1 \
-fcolor-diagnostics \
-s NO_FILESYSTEM=1 \
-s ALLOW_MEMORY_GROWTH=1 \
-s MODULARIZE=1 \
-s EXPORT_NAME=\"load_perspective\" \
-s EXPORT_ES6=1 \
-s MAXIMUM_MEMORY=4gb \
-s WASM_BIGINT=1 \
-s USE_ES6_IMPORT_META=0 \
-s EXPORTED_FUNCTIONS=\"['_main']\" \
")

if(CMAKE_BUILD_TYPE_LOWER STREQUAL debug)
Expand All @@ -247,15 +237,11 @@ if (PSP_WASM_BUILD)
-s WARN_UNALIGNED=1 \
-Wcast-align \
-Wover-aligned \
-s DISABLE_EXCEPTION_CATCHING=0 \
-s ASSERTIONS=2 \
-s DEMANGLE_SUPPORT=1 \
")
else()
set(OPT_FLAGS " \
-O3 \
-g0 \
-s AGGRESSIVE_VARIABLE_ELIMINATION=1 \
")

# TODO: -flto
Expand Down Expand Up @@ -579,24 +565,37 @@ endif()
message("${BUILD_MESSAGE}\n")

if (PSP_WASM_BUILD)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} \
-s EXPORT_ES6=1 \
-s NO_EXIT_RUNTIME=1 \
-s NO_FILESYSTEM=1 \
-s ALLOW_MEMORY_GROWTH=1 \
-s MODULARIZE=1 \
-s EXPORT_NAME=\"load_perspective\" \
-s MAXIMUM_MEMORY=4gb \
-s WASM_BIGINT=1 \
-s USE_ES6_IMPORT_META=0 \
-s EXPORTED_FUNCTIONS=\"['_main']\" \
")

add_library(psp ${WASM_SOURCE_FILES})
target_compile_definitions(psp PRIVATE PSP_ENABLE_WASM=1)
set_target_properties(psp PROPERTIES COMPILE_FLAGS "")
target_link_libraries(psp arrow)

# "esm/erspective.cpp.js" from CMAKE_EXECUTABLE_SYNTAX
add_executable(perspective_esm src/cpp/emscripten.cpp)
target_link_libraries(perspective_esm psp "-s ENVIRONMENT=worker -s EXPORT_ES6=1")
target_link_libraries(perspective_esm psp)
target_link_options(perspective_esm PRIVATE -s ENVIRONMENT=worker)
target_compile_definitions(perspective_esm PRIVATE PSP_ENABLE_WASM=1)
set_target_properties(perspective_esm PROPERTIES COMPILE_FLAGS "-s ENVIRONMENT=worker -s EXPORT_ES6=1")
set_target_properties(perspective_esm PROPERTIES RUNTIME_OUTPUT_DIRECTORY "./esm/")
set_target_properties(perspective_esm PROPERTIES OUTPUT_NAME "perspective.cpp")

# "cjs/perspective.cpp.js" from CMAKE_EXECUTABLE_SYNTAX
add_executable(perspective_cjs src/cpp/emscripten.cpp)
target_link_libraries(perspective_cjs psp "-s ENVIRONMENT=node")
target_link_libraries(perspective_cjs psp)
target_link_options(perspective_cjs PRIVATE -s ENVIRONMENT=node)
target_compile_definitions(perspective_cjs PRIVATE PSP_ENABLE_WASM=1)
set_target_properties(perspective_cjs PROPERTIES COMPILE_FLAGS "-s ENVIRONMENT=node")
set_target_properties(perspective_cjs PROPERTIES RUNTIME_OUTPUT_DIRECTORY "./cjs/")
set_target_properties(perspective_cjs PROPERTIES OUTPUT_NAME "perspective.cpp")
elseif(PSP_CPP_BUILD OR PSP_PYTHON_BUILD)
Expand Down
2 changes: 2 additions & 0 deletions cpp/perspective/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const stdio = "inherit";
const env = process.PSP_DEBUG ? "debug" : "release";
const cwd = path.join(process.cwd(), "dist", env);

delete process.env.NODE;

try {
execSync(`mkdirp ${cwd}`, {stdio});
process.env.CLICOLOR_FORCE = 1;
Expand Down
5 changes: 3 additions & 2 deletions cpp/perspective/src/cpp/computed_expression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,15 +384,16 @@ t_computed_expression_parser::get_dtype(
}

t_tscalar v = expr_definition.value();
t_dtype dtype = v.get_dtype();

if (v.m_status == STATUS_CLEAR) {
if (v.m_status == STATUS_CLEAR || dtype == DTYPE_NONE) {
error.m_error_message = "Type Error - inputs do not resolve to a valid expression.";
error.m_line = 0;
error.m_column = 0;
return DTYPE_NONE;
}

return v.get_dtype();
return dtype;
}

t_validated_expression_map::t_validated_expression_map() {}
Expand Down
3 changes: 3 additions & 0 deletions cpp/perspective/src/cpp/table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ Table::validate_expressions(
const std::string& expression_alias = std::get<0>(expr);
const std::string& expression_string = std::get<1>(expr);
const std::string& parsed_expression_string = std::get<2>(expr);

t_expression_error error;
error.m_line = -1;
error.m_column = -1;

// Cannot overwrite a "real" column with an expression column
if (gnode_schema.has_column(expression_alias)) {
Expand Down
4 changes: 2 additions & 2 deletions cpp/perspective/src/include/perspective/computed_expression.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ namespace perspective {
*/
struct PERSPECTIVE_EXPORT t_expression_error {
std::string m_error_message;
t_uindex m_line;
t_uindex m_column;
t_index m_line;
t_index m_column;
};

/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"internal": "Internal"
}
},
"emscripten": "2.0.6",
"emscripten": "2.0.29",
"engines": {
"node": ">=8.12.0"
},
Expand Down
10 changes: 6 additions & 4 deletions packages/perspective/test/js/expressions/functionality.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ module.exports = (perspective) => {
expect(validate.errors).toEqual({
'if ("w" > 1) 5': {
column: 0,
error_message: "",
line: 8,
error_message:
"Type Error - inputs do not resolve to a valid expression.",
line: 0,
},
'if ("w" > 1) 5;': {
column: 0,
error_message: "",
line: 8,
error_message:
"Type Error - inputs do not resolve to a valid expression.",
line: 0,
},
});

Expand Down
10 changes: 0 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3147,11 +3147,6 @@
"@types/istanbul-lib-coverage" "*"
"@types/istanbul-lib-report" "*"

"@types/jest@^23.3.9":
version "23.3.14"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-23.3.14.tgz#37daaf78069e7948520474c87b80092ea912520a"
integrity sha512-Q5hTcfdudEL2yOmluA1zaSyPbzWPmJ3XfSWeP3RyoYvS9hnje1ZyagrZOuQ6+1nQC1Gw+7gap3pLNL3xL6UBug==

"@types/jquery@*":
version "3.5.5"
resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-3.5.5.tgz#2c63f47c9c8d96693d272f5453602afd8338c903"
Expand Down Expand Up @@ -3201,11 +3196,6 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.21.tgz#d934aacc22424fe9622ebf6857370c052eae464e"
integrity sha512-cHYfKsnwllYhjOzuC5q1VpguABBeecUp24yFluHpn/BQaVxB1CuQ1FSRZCzrPxrkIfWISXV2LbeoBthLWg0+0A==

"@types/node@^11.11.0":
version "11.15.44"
resolved "https://registry.yarnpkg.com/@types/node/-/node-11.15.44.tgz#5c3463a489ddd6d1d9f6717dff84e15097b0b362"
integrity sha512-fHAcNn2FlzDMA9rV5KP73r1cMZdbommWic2foHAEWoa/LITi91AueHDsJpnqjBEJ7bYoT2WC+KN1RL0vsM20zA==

"@types/normalize-package-data@^2.4.0":
version "2.4.0"
resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e"
Expand Down