oss-fuzz icon indicating copy to clipboard operation
oss-fuzz copied to clipboard

[infra] Don't build python from scratch

Open jonathanmetzman opened this issue 3 years ago • 11 comments

Fixes: https://github.com/google/oss-fuzz/issues/7914

jonathanmetzman avatar Aug 01 '22 18:08 jonathanmetzman

/gcbrun trial_build.py skcms cpython2 arrow g-apis-py-api-core g-api-py-api-common-protos nfstream xlrd pycrypto urllib3 python-rsa psqlparse protobuf-python bleach g-py-bigquery jsonschema oauth2 msal ansible django g-cloud-logging-py dask pyyaml tensorflow-py pygments openpyxl flask ecdsa-python gcloud-error-py sqlalchemy pyxdg g-api-python-client imageio smart_open pytz jsmin glom cryptography aiohttp sqlalchemy_jsonfield pip g-api-auth-library-python ftfy gcp-python-cloud-storage numpy g-py-crc32c lxml python-lz4 python3-libraries scapy netaddr-py bs4 g-api-resumable-media-python requests httplib2 airflow cpython3 retry psycopg2 g-api-pubsub sqlalchemy-utils ujson ipython presidio g-api-python-cloud-core pillow croniter --sanitizer address --fuzzing-engine libfuzzer

jonathanmetzman avatar Aug 01 '22 18:08 jonathanmetzman

/gcbrun trial_build.py skcms --sanitizer address --fuzzing-engine libfuzzer

jonathanmetzman avatar Aug 01 '22 18:08 jonathanmetzman

/gcbrun trial_build.py skcms cpython2 arrow g-apis-py-api-core g-api-py-api-common-protos nfstream xlrd pycrypto urllib3 python-rsa psqlparse protobuf-python bleach g-py-bigquery jsonschema oauth2 msal ansible django g-cloud-logging-py dask pyyaml tensorflow-py pygments openpyxl flask ecdsa-python gcloud-error-py sqlalchemy pyxdg g-api-python-client imageio smart_open pytz jsmin glom cryptography aiohttp sqlalchemy_jsonfield pip g-api-auth-library-python ftfy gcp-python-cloud-storage numpy g-py-crc32c lxml python-lz4 python3-libraries scapy netaddr-py bs4 g-api-resumable-media-python requests httplib2 airflow cpython3 retry psycopg2 g-api-pubsub sqlalchemy-utils ujson ipython presidio g-api-python-cloud-core pillow croniter --sanitizer address --fuzzing-engine libfuzzer

jonathanmetzman avatar Aug 01 '22 21:08 jonathanmetzman

/gcbrun trial_build.py skcms cpython2 arrow g-apis-py-api-core g-api-py-api-common-protos nfstream xlrd pycrypto urllib3 python-rsa psqlparse protobuf-python bleach g-py-bigquery jsonschema oauth2 msal ansible django g-cloud-logging-py dask pyyaml tensorflow-py pygments openpyxl flask ecdsa-python gcloud-error-py sqlalchemy pyxdg g-api-python-client imageio smart_open pytz jsmin glom cryptography aiohttp sqlalchemy_jsonfield pip g-api-auth-library-python ftfy gcp-python-cloud-storage numpy g-py-crc32c lxml python-lz4 python3-libraries scapy netaddr-py bs4 g-api-resumable-media-python requests httplib2 airflow cpython3 retry psycopg2 g-api-pubsub sqlalchemy-utils ujson ipython presidio g-api-python-cloud-core pillow croniter --sanitizer address --fuzzing-engine libfuzzer

jonathanmetzman avatar Aug 01 '22 22:08 jonathanmetzman

/gcbrun trial_build.py skcms cpython2 arrow g-apis-py-api-core g-api-py-api-common-protos nfstream xlrd pycrypto urllib3 python-rsa psqlparse protobuf-python bleach g-py-bigquery jsonschema oauth2 msal ansible django g-cloud-logging-py dask pyyaml tensorflow-py pygments openpyxl flask ecdsa-python gcloud-error-py sqlalchemy pyxdg g-api-python-client imageio smart_open pytz jsmin glom cryptography aiohttp sqlalchemy_jsonfield pip g-api-auth-library-python ftfy gcp-python-cloud-storage numpy g-py-crc32c lxml python-lz4 python3-libraries scapy netaddr-py bs4 g-api-resumable-media-python requests httplib2 airflow cpython3 retry psycopg2 g-api-pubsub sqlalchemy-utils ujson ipython presidio g-api-python-cloud-core pillow croniter --sanitizer address --fuzzing-engine libfuzzer

jonathanmetzman avatar Aug 01 '22 22:08 jonathanmetzman

/gcbrun trial_build.py skcms cpython2 arrow g-apis-py-api-core g-api-py-api-common-protos nfstream xlrd pycrypto urllib3 python-rsa psqlparse protobuf-python bleach g-py-bigquery jsonschema oauth2 msal ansible django g-cloud-logging-py dask pyyaml tensorflow-py pygments openpyxl flask ecdsa-python gcloud-error-py sqlalchemy pyxdg g-api-python-client imageio smart_open pytz jsmin glom cryptography aiohttp sqlalchemy_jsonfield pip g-api-auth-library-python ftfy gcp-python-cloud-storage numpy g-py-crc32c lxml python-lz4 python3-libraries scapy netaddr-py bs4 g-api-resumable-media-python requests httplib2 airflow cpython3 retry psycopg2 g-api-pubsub sqlalchemy-utils ujson ipython presidio g-api-python-cloud-core pillow croniter --sanitizer address --fuzzing-engine libfuzzer

jonathanmetzman avatar Aug 01 '22 23:08 jonathanmetzman

/gcbrun trial_build.py skcms cpython2 arrow g-apis-py-api-core g-api-py-api-common-protos nfstream xlrd pycrypto urllib3 python-rsa psqlparse protobuf-python bleach g-py-bigquery jsonschema oauth2 msal ansible django g-cloud-logging-py dask pyyaml tensorflow-py pygments openpyxl flask ecdsa-python gcloud-error-py sqlalchemy pyxdg g-api-python-client imageio smart_open pytz jsmin glom cryptography aiohttp sqlalchemy_jsonfield pip g-api-auth-library-python ftfy gcp-python-cloud-storage numpy g-py-crc32c lxml python-lz4 python3-libraries scapy netaddr-py bs4 g-api-resumable-media-python requests httplib2 airflow cpython3 retry psycopg2 g-api-pubsub sqlalchemy-utils ujson ipython presidio g-api-python-cloud-core pillow croniter --sanitizer address --fuzzing-engine libfuzzer

jonathanmetzman avatar Aug 01 '22 23:08 jonathanmetzman

/gcbrun trial_build.py skcms cpython2 arrow g-apis-py-api-core g-api-py-api-common-protos nfstream xlrd pycrypto urllib3 python-rsa psqlparse protobuf-python bleach g-py-bigquery jsonschema oauth2 msal ansible django g-cloud-logging-py dask pyyaml tensorflow-py pygments openpyxl flask ecdsa-python gcloud-error-py sqlalchemy pyxdg g-api-python-client imageio smart_open pytz jsmin glom cryptography aiohttp sqlalchemy_jsonfield pip g-api-auth-library-python ftfy gcp-python-cloud-storage numpy g-py-crc32c lxml python-lz4 python3-libraries scapy netaddr-py bs4 g-api-resumable-media-python requests httplib2 airflow cpython3 retry psycopg2 g-api-pubsub sqlalchemy-utils ujson ipython presidio g-api-python-cloud-core pillow croniter --sanitizer address --fuzzing-engine libfuzzer

jonathanmetzman avatar Aug 02 '22 01:08 jonathanmetzman

/gcbrun trial_build.py skcms cpython2 arrow g-apis-py-api-core g-api-py-api-common-protos nfstream xlrd pycrypto urllib3 python-rsa psqlparse protobuf-python bleach g-py-bigquery jsonschema oauth2 msal ansible django g-cloud-logging-py dask pyyaml tensorflow-py pygments openpyxl flask ecdsa-python gcloud-error-py sqlalchemy pyxdg g-api-python-client imageio smart_open pytz jsmin glom cryptography aiohttp sqlalchemy_jsonfield pip g-api-auth-library-python ftfy gcp-python-cloud-storage numpy g-py-crc32c lxml python-lz4 python3-libraries scapy netaddr-py bs4 g-api-resumable-media-python requests httplib2 airflow cpython3 retry psycopg2 g-api-pubsub sqlalchemy-utils ujson ipython presidio g-api-python-cloud-core pillow croniter --sanitizer address --fuzzing-engine libfuzzer

jonathanmetzman avatar Aug 03 '22 17:08 jonathanmetzman

Getting a lot of errors like this:

x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -O1 -fno-omit-frame-pointer -gline-tables-only -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize-address-use-after-scope -fsanitize=fuzzer-no-link -fno-sanitize=function,leak,vptr, -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.8/src/lxml/etree.o -lxslt -lexslt -lxml2 -lrt -lz -lm -o build/lib.linux-x86_64-3.8/lxml/etree.cpython-38-x86_64-linux-gnu.so
x86_64-linux-gnu-gcc: error: unrecognized debug output level ‘line-tables-only’
x86_64-linux-gnu-gcc: error: unrecognized argument to ‘-fsanitize=’ option: ‘fuzzer-no-link’
x86_64-linux-gnu-gcc: error: unrecognized argument to ‘-fno-sanitize=’ option: ‘function’
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

I need to figure out if there's a way to configure python to use clang for linking. Otherwise we will need to continue compiling python from scratch.

jonathanmetzman avatar Aug 03 '22 19:08 jonathanmetzman

I think I need to change LINK_CC to fix this but not sure if this is allowed. Maybe it is unsafe to use a different compiler than the one used to build python. @ksztyber what do you think? I don't know much about building native modules.

jonathanmetzman avatar Aug 03 '22 19:08 jonathanmetzman

I think we need to build python from scratch if we want to build C/C++ modules with clang.

jonathanmetzman avatar Aug 23 '22 14:08 jonathanmetzman

Sorry for the late response @jonathanmetzman, I was out for the last few weeks. Unfortunately, I don't know much about this either, so I won't be able to help much with this.

ksztyber avatar Aug 24 '22 09:08 ksztyber