jruizgit / rules

Durable Rules Engine
MIT License
1.14k stars 207 forks source link

Durable rules in AWS Lambda #329

Open michal-adamkiewicz opened 4 years ago

michal-adamkiewicz commented 4 years ago

I'm trying currently to install durable rules inside AWS Lambda (Python3.7 and serverless-framework). I have put requirements as usual into requirements.txt (durable_rules==2.0.27)

But unfortunatelly build is failing with such output:

Running setup.py install for durable-rules: finished with status 'error'
      Complete output from command /usr/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-to3anhc0/durable-rules/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-o8sx7oqc-record/install-record.txt --single-version-externally-managed --compile --home=/tmp/tmpw7s3whmj:
      running install
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.7
      creating build/lib.linux-x86_64-3.7/durable
      copying libpy/durable/lang.py -> build/lib.linux-x86_64-3.7/durable
      copying libpy/durable/engine.py -> build/lib.linux-x86_64-3.7/durable
      copying libpy/durable/__init__.py -> build/lib.linux-x86_64-3.7/durable
      running build_clib
      building 'durable_rules_engine_py' library
      creating build/temp.linux-x86_64-3.7
      creating build/temp.linux-x86_64-3.7/src
      creating build/temp.linux-x86_64-3.7/src/rules
      x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -std=c99 -D_GNU_SOURCE -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -c src/rules/json.c -o build/temp.linux-x86_64-3.7/src/rules/json.o
      x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -std=c99 -D_GNU_SOURCE -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -c src/rules/rete.c -o build/temp.linux-x86_64-3.7/src/rules/rete.o
      x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -std=c99 -D_GNU_SOURCE -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -c src/rules/state.c -o build/temp.linux-x86_64-3.7/src/rules/state.o
      x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -std=c99 -D_GNU_SOURCE -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -c src/rules/events.c -o build/temp.linux-x86_64-3.7/src/rules/events.o
      x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -std=c99 -D_GNU_SOURCE -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -c src/rules/regex.c -o build/temp.linux-x86_64-3.7/src/rules/regex.o
      x86_64-linux-gnu-gcc-ar rcs build/temp.linux-x86_64-3.7/libdurable_rules_engine_py.a build/temp.linux-x86_64-3.7/src/rules/json.o build/temp.linux-x86_64-3.7/src/rules/rete.o build/temp.linux-x86_64-3.7/src/rules/state.o build/temp.linux-x86_64-3.7/src/rules/events.o build/temp.linux-x86_64-3.7/src/rules/regex.o
      running build_ext
      building 'durable_rules_engine' extension
      creating build/temp.linux-x86_64-3.7/src/rulespy
      x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -std=c99 -D_GNU_SOURCE -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Isrc/rules -I/usr/include/python3.7m -c src/rulespy/rules.c -o build/temp.linux-x86_64-3.7/src/rulespy/rules.o
      src/rulespy/rules.c:1:10: fatal error: Python.h: No such file or directory
       #include <Python.h>
                ^~~~~~~~~~
      compilation terminated.
      error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

      ----------------------------------------

I was trying to install all possible "potential" prerequisites like: python3-dev python3-setuptools python-dev build-essential libssl-dev libffi-dev libxml2-dev libxslt1-dev zlib1g-dev

but without results:/

Are there any particular requirements for library to be satisfied?

jruizgit commented 4 years ago

Hi, thanks for asking the question. In theory the only requirement is Python3.7. Let me look into this.

Zeinabalmowafy commented 3 years ago

I seem to have the same issue, is it solved at all? Thanks