pyodide/emsdk/Makefile

28 lines
951 B
Makefile
Raw Normal View History

2019-01-10 12:40:01 +00:00
PYODIDE_ROOT=$(abspath ..)
include ../Makefile.envs
2018-07-20 00:33:56 +00:00
all: emsdk/.complete
2018-03-30 17:08:06 +00:00
emsdk/.complete: ../Makefile.envs $(wildcard patches/*.patch)
if [ -d emsdk ]; then rm -rf emsdk; fi
2021-01-07 08:01:25 +00:00
git clone --depth 1 https://github.com/emscripten-core/emsdk.git
cd emsdk && ./emsdk install --build=Release $(PYODIDE_EMSCRIPTEN_VERSION)
cd emsdk/upstream/emscripten/ && cat ../../../patches/*.patch | patch -p1 --verbose
cd emsdk && ./emsdk install --build=Release $(PYODIDE_EMSCRIPTEN_VERSION) ccache-git-emscripten-64bit
cd emsdk && ./emsdk activate --embedded --build=Release $(PYODIDE_EMSCRIPTEN_VERSION)
ENH Rework streams handling (#4035) This fixes a number problems with the old stream handling: 1. Not possible to set a custom errno (necessary for proper interrupt handling and possibly for other things) 2. Inefficient: in a lot of cases we have data in one buffer and we need it placed into a different buffer, but we have to implement a function that gets one byte out of the source buffer and then call it repeatedly to move one byte at a time to the target buffer. 3. Ease of implementation: in many cases we already have perfectly good buffer manipulation APIs, so if we have direct access to the true source or target buffer we can just use these. See: the node IO code, which got much simpler. This is backwards compatible, so you can still use the old input mechanism or use buffered or raw output. But it adds a new method of directly implementing read/write. For simplicity, we insure that the source/destination buffers are always `Uint8Array` views that point to exactly the region that is meant to be read/written. The old mechanisms are faster than before and can correctly support keyboard interrupts. Other than that I think the original behavior is unchanged. I added a lot more test coverage to ensure backwards compatibility since there was pretty anemic coverage before. I think the read/write APIs are mostly pretty simple to use, with the exception that someone might forget to return the number of bytes read. JavaScript's ordinary behavior coerces the `undefined` to a 0, which leads to an infinite loop where the filesystem repeatedly asks to read/write the same data since it sees no progress. I added a check that writes an error message to the console and sets EIO when undefined is returned so the infinite loop is prevented and the problem is explained.
2023-08-21 06:41:44 +00:00
# Check that generated_struct_info is up to date.
cmp --silent emsdk/upstream/emscripten/src/generated_struct_info32.json ../src/js/generated_struct_info32.json || \
( \
echo "" && \
echo "The vendored copy of generated_struct_info32.json does not match the copy in Emscripten" && \
exit 1 \
)
touch emsdk/.complete
2018-03-30 17:08:06 +00:00
ENH Rework streams handling (#4035) This fixes a number problems with the old stream handling: 1. Not possible to set a custom errno (necessary for proper interrupt handling and possibly for other things) 2. Inefficient: in a lot of cases we have data in one buffer and we need it placed into a different buffer, but we have to implement a function that gets one byte out of the source buffer and then call it repeatedly to move one byte at a time to the target buffer. 3. Ease of implementation: in many cases we already have perfectly good buffer manipulation APIs, so if we have direct access to the true source or target buffer we can just use these. See: the node IO code, which got much simpler. This is backwards compatible, so you can still use the old input mechanism or use buffered or raw output. But it adds a new method of directly implementing read/write. For simplicity, we insure that the source/destination buffers are always `Uint8Array` views that point to exactly the region that is meant to be read/written. The old mechanisms are faster than before and can correctly support keyboard interrupts. Other than that I think the original behavior is unchanged. I added a lot more test coverage to ensure backwards compatibility since there was pretty anemic coverage before. I think the read/write APIs are mostly pretty simple to use, with the exception that someone might forget to return the number of bytes read. JavaScript's ordinary behavior coerces the `undefined` to a 0, which leads to an infinite loop where the filesystem repeatedly asks to read/write the same data since it sees no progress. I added a check that writes an error message to the console and sets EIO when undefined is returned so the infinite loop is prevented and the problem is explained.
2023-08-21 06:41:44 +00:00
2018-03-30 17:08:06 +00:00
clean:
rm -rf emsdk