diff --git a/.circleci/config.yml b/.circleci/config.yml index 29f8e096939b..26b238b793f4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,13 +20,11 @@ jobs: root: ~/project/packages paths: - version - build-cheerp-compiler: - docker: - - image: leaningtech/cheerp_ci_base:20.04 - resource_class: large + build-cheerp-toolchain: + executor: cheerp-large environment: - NINJA_STATUS: "[%u/%r/%f] " - - THREADS: "6" + - THREADS: 6 - CCACHE_DIR: "/ccache" steps: - attach_workspace: @@ -40,31 +38,20 @@ jobs: keys: - cheerp-compiler-<< pipeline.git.branch >>- - cheerp-compiler- - - when: - condition: - equal: [ master, << pipeline.parameters.release-tag >> ] - steps: - shallow-clone: - ref: << pipeline.parameters.cheerp-compiler-commit >> - dir: cheerp-compiler - remote: https://github.com/leaningtech/cheerp-compiler - - when: - condition: - not: - equal: [ master, << pipeline.parameters.release-tag >> ] - steps: - shallow-clone: - ref: << pipeline.parameters.release-tag >> - dir: cheerp-compiler - remote: https://github.com/leaningtech/cheerp-compiler - run: name: Set up environment working_directory: ~/project/cheerp-compiler command: | cat ~/project/packages/version >> $BASH_ENV - - build-internal: - directory: cheerp-compiler - package-name: llvm-clang + - clone-toolchain + - run: + name: Build cheerp + working_directory: ~/project/cheerp-compiler + command: | + dch -b -v "$VERSION_NO-1" "Internal build" -m + dpkg-buildpackage -d -b + mkdir -p ~/project/packages + mv -v ../cheerp-core_*.deb ~/project/packages - save_cache: name: Save ccache key: cheerp-compiler-<< pipeline.git.branch >>-{{ epoch }} @@ -73,213 +60,94 @@ jobs: - run: name: Save build working_directory: ~/project/cheerp-compiler - command: tar -cjf ~/project/packages/cheerp-build.tar.bz2 build cmake third-party llvm clang .git/logs/HEAD + command: ./debian/build.sh tar-compiler ../packages/cheerp-build.tar.bz2 - persist_to_workspace: root: ~/project/packages paths: - - cheerp-llvm-clang_*.deb - cheerp-build.tar.bz2 + - cheerp-core_*.deb llvm-check: parameters: rule: type: string - docker: - - image: leaningtech/cheerp_ci_base:20.04 - resource_class: large + executor: cheerp-large environment: - NINJA_STATUS: "[%u/%r/%f] " + - THREADS: 6 - CCACHE_DISABLE: 1 - steps: - - run-llvm-tests: - rule: << parameters.rule >> - build-libraries: - docker: - - image: leaningtech/cheerp_ci_base:20.04 - resource_class: medium - environment: - - NINJA_STATUS: "[%u/%r/%f] " - - VERBOSE: 1 steps: - attach_workspace: - at: packages - - when: - condition: - equal: [ master, << pipeline.parameters.release-tag >> ] - steps: - - shallow-clone: - ref: << pipeline.parameters.cheerp-compiler-commit >> - dir: cheerp-compiler - remote: https://github.com/leaningtech/cheerp-compiler - - shallow-clone: - ref: << pipeline.parameters.cheerp-utils-commit >> - dir: cheerp-utils - remote: https://github.com/leaningtech/cheerp-utils - - shallow-clone: - ref: << pipeline.parameters.cheerp-musl-commit >> - dir: cheerp-musl - remote: https://github.com/leaningtech/cheerp-musl - - shallow-clone: - ref: << pipeline.parameters.cheerp-libs-commit >> - dir: cheerp-libs - remote: https://github.com/leaningtech/cheerp-libs - - when: - condition: - not: - equal: [ master, << pipeline.parameters.release-tag >> ] - steps: - - shallow-clone: - ref: << pipeline.parameters.release-tag >> - dir: cheerp-compiler - remote: https://github.com/leaningtech/cheerp-compiler - - shallow-clone: - ref: << pipeline.parameters.release-tag >> - dir: cheerp-utils - remote: https://github.com/leaningtech/cheerp-utils - - shallow-clone: - ref: << pipeline.parameters.release-tag >> - dir: cheerp-musl - remote: https://github.com/leaningtech/cheerp-musl - - shallow-clone: - ref: << pipeline.parameters.release-tag >> - dir: cheerp-libs - remote: https://github.com/leaningtech/cheerp-libs + at: ~/project/packages - run: - name: Set up workspace - command: | - cat ~/project/packages/version >> $BASH_ENV - mkdir /opt/cheerp/ - - install-deb: - package-name: llvm-clang - - create-deb: - directory: cheerp-utils - package-name: utils - - create-deb: - directory: cheerp-musl - package-name: musl - - run: - name: Set up for libcxx-libcxxabi + name: Extract build working_directory: ~/project/cheerp-compiler - command: | - rm -rf debian/ - cp -rv runtimes/debian debian/ - - create-deb: - directory: cheerp-compiler - package-name: libcxx-libcxxabi - - build-internal: - directory: cheerp-libs - package-name: libs - - install-deb: - package-name: utils - - install-deb: - package-name: musl - - install-deb: - package-name: libcxx-libcxxabi - - install-deb: - package-name: libs - - run: - name: Setup compiler-rt dependencies - command: | - mkdir tmp - mv ~/project/packages/cheerp-build.tar.bz2 . - tar -xvf cheerp-build.tar.bz2 -C /tmp - mv /tmp/build ~/project/cheerp-compiler/ - - run: - name: Set up for compiler-rt + command: tar -C . -xvf ~/project/packages/cheerp-build.tar.bz2 + - run: + name: Run llvm << parameters.rule >> working_directory: ~/project/cheerp-compiler - command: | - rm -rf debian/ - cp -rv compiler-rt/debian debian/ - - create-deb: - directory: cheerp-compiler - package-name: compiler-rt - - persist_to_workspace: - root: packages - paths: - - cheerp-utils_*.deb - - cheerp-musl_*.deb - - cheerp-compiler-rt_*.deb - - cheerp-libcxx-libcxxabi_*.deb - - cheerp-libs_*.deb + command: ./debian/build.sh run-command << parameters.rule >> test: parameters: target: type: string asan: type: string - docker: - - image: leaningtech/cheerp_ci_base:20.04 - resource_class: large + executor: cheerp-large steps: - - run-cheerp-tests: - target: << parameters.target >> - asan: << parameters.asan >> + - install-toolchain + - clone-cheerp-repo: + remote: https://github.com/leaningtech/cheerp-utils.git + dir: cheerp-utils + ref: << pipeline.parameters.cheerp-utils-commit >> + - run: + name: Run tests + working_directory: ~/project/cheerp-utils/tests + command: ./run_tests.py --<< parameters.target >> << parameters.asan >> --determinism=3 --determinism-probability=0.2 "/opt/cheerp/bin/clang++" node -j4 + no_output_timeout: 30m + - run: + name: Store test results + command: | + mkdir -p ~/project/testResults + mv ~/project/cheerp-utils/tests/testReport.test ~/project/<< parameters.target >><< parameters.asan >>testResults + - store_artifacts: + path: ~/project/<< parameters.target >><< parameters.asan >>testResults run-asan-tests: - docker: - - image: leaningtech/cheerp_ci_base:20.04 - resource_class: large + executor: cheerp-large environment: - VERBOSE: 1 steps: - - attach_workspace: - at: ~/project/packages - - run: mkdir -p /opt/cheerp - - install-deb: - package-name: llvm-clang - - install-deb: - package-name: utils - - install-deb: - package-name: musl - - install-deb: - package-name: compiler-rt - - install-deb: - package-name: libcxx-libcxxabi - - install-deb: - package-name: libs - - run: mkdir ~/project/cheerp-compiler - - when: - condition: - equal: [ master, << pipeline.parameters.release-tag >> ] - steps: - shallow-clone: - ref: << pipeline.parameters.cheerp-compiler-commit >> - dir: cheerp-compiler - remote: https://github.com/leaningtech/cheerp-compiler - - when: - condition: - not: - equal: [ master, << pipeline.parameters.release-tag >> ] - steps: - shallow-clone: - ref: << pipeline.parameters.release-tag >> - dir: cheerp-compiler - remote: https://github.com/leaningtech/cheerp-compiler - - run: - name: Get cmake utilities - command: | - mkdir tmp - mv ~/project/packages/cheerp-build.tar.bz2 . - tar -xvf cheerp-build.tar.bz2 -C /tmp - mv /tmp/build ~/project/cheerp-compiler/ - - run: - name: Build dependencies - command: | - ninja -C ~/project/cheerp-compiler/build llvm-config - ninja -C ~/project/cheerp-compiler/build FileCheck - ninja -C ~/project/cheerp-compiler/build not + - install-toolchain + - clone-cheerp-repo: + remote: https://github.com/leaningtech/cheerp-compiler + dir: cheerp-compiler + ref: << pipeline.parameters.cheerp-compiler-commit >> + - run: + name: Install dependencies + command: | + # ubuntu jammy's llvm version is 14, however cheerp, as of the time of writing this, is based on llvm-16, + # because of this it expects certain utility files to exists, which are not a part of llvm-14, therefore we + # install here a more updated version of llvm, which has those utility files. + apt remove -y clang + apt update && apt install -y clang-15 + + ln -s /usr/lib/llvm-14/bin/not /usr/bin + ln -s /usr/lib/llvm-14/bin/FileCheck /usr/bin + ln -s /usr/lib/llvm-14/bin/llvm-config /usr/bin - run: name: Setup tests working_directory: ~/project/cheerp-compiler/compiler-rt - command: cmake -B build -C CheerpCmakeConf.cmake -DCMAKE_TOOLCHAIN_FILE="/opt/cheerp/share/cmake/Modules/CheerpWasmToolchain.cmake" -DLLVM_DIR="$PWD/../build/lib/cmake/llvm" + command: cmake -B build -C CheerpCmakeConf.cmake -DCMAKE_TOOLCHAIN_FILE="/opt/cheerp/share/cmake/Modules/CheerpWasmToolchain.cmake" - run: name: Check asan working_directory: ~/project/cheerp-compiler/compiler-rt/build command: make -j check-asan - RPM-cheerp-compiler: + RPM-cheerp-toolchain: docker: - - image: leaningtech/cheerp_rpm_base:8 + - image: leaningtech/cheerp_rpm_base:9 resource_class: large environment: - THREADS: 6 + - CCACHE_DISABLE: 1 steps: - attach_workspace: at: ~/ @@ -311,103 +179,45 @@ jobs: echo "export REPO_DIR=$REPO_DIR" >> ~/version - add-yum-configuration - get-rpm-repo - - run: - name: Get sources - command: | - git clone git@github.com:leaningtech/cheerp-internal.git - git clone https://github.com/leaningtech/cheerp-compiler.git cheerp-llvm-clang - cd cheerp-llvm-clang - if [ << pipeline.parameters.release-tag >> != master ]; then - git checkout << pipeline.parameters.release-tag >> - else - git checkout << pipeline.parameters.cheerp-compiler-commit >> - fi + - clone-toolchain + - shallow-clone: + ref: master + dir: cheerp-internal + remote: git@github.com:leaningtech/cheerp-internal.git - set-up-rpm-workspace - - add-rpm-sources: - directory: cheerp-llvm-clang - package-name: llvm-clang - branch-name: << pipeline.parameters.cheerp-compiler-commit >> - - build-deploy-rpm: - directory: cheerp-llvm-clang - package-name: llvm-clang - - persist_to_workspace: - root: ~/ - paths: - - version/ - RPM-libraries: - docker: - - image: leaningtech/cheerp_rpm_base:8 - resource_class: large - steps: - - attach_workspace: - at: ~/ - - run: cat ~/version >> $BASH_ENV - - add_ssh_keys: - fingerprints: - - "86:3b:c9:a6:d1:b9:a8:dc:0e:00:db:99:8d:19:c4:3e" - run: - name: Add known hosts - command: | - echo $GH_HOST >> ~/.ssh/known_hosts - echo $RPM_HOST >> ~/.ssh/known_hosts - - run: - name: Get repos - command: | - git clone git@github.com:leaningtech/cheerp-internal.git - git clone https://github.com/leaningtech/cheerp-compiler.git - git clone https://github.com/leaningtech/cheerp-utils.git - git clone https://github.com/leaningtech/cheerp-libs.git - git clone https://github.com/leaningtech/cheerp-musl.git - if [ << pipeline.parameters.release-tag >> != master ]; then - cd cheerp-compiler && git checkout << pipeline.parameters.release-tag >> && cd .. - cd cheerp-utils && git checkout << pipeline.parameters.release-tag >> && cd .. - cd cheerp-libs && git checkout << pipeline.parameters.release-tag >> && cd .. - cd cheerp-musl && git checkout << pipeline.parameters.release-tag >> - else - cd cheerp-compiler && git checkout << pipeline.parameters.cheerp-compiler-commit >> && cd .. - cd cheerp-utils && git checkout << pipeline.parameters.cheerp-utils-commit >> && cd .. - cd cheerp-libs && git checkout << pipeline.parameters.cheerp-libs-commit >> && cd .. - cd cheerp-musl && git checkout << pipeline.parameters.cheerp-musl-commit >> - fi - - get-rpm-repo - - add-yum-configuration - - set-up-rpm-workspace - - run: dnf install -y cheerp-llvm-clang-${VERSION_NO}-1.el8 - - create-rpm-package: - directory: cheerp-utils - package-name: utils - branch-name: << pipeline.parameters.cheerp-utils-commit >> - - create-rpm-package: - directory: cheerp-musl - package-name: musl - branch-name: << pipeline.parameters.cheerp-musl-commit >> - - run: - name: Set up for libcxx-libcxxabi - working_directory: ~/project/cheerp-compiler - command: | - rm -rf rpmbuild - cp -r runtimes/rpmbuild . - - create-rpm-package: - directory: cheerp-compiler - package-name: libcxx-libcxxabi - branch-name: << pipeline.parameters.cheerp-compiler-commit >> - - create-rpm-package: - directory: cheerp-libs - package-name: libs - branch-name: << pipeline.parameters.cheerp-libs-commit >> - - run: - name: Set up for compiler-rt - working_directory: ~/project/cheerp-compiler - command: | - rm -rf rpmbuild - cp -r compiler-rt/rpmbuild . - - create-rpm-package: - directory: cheerp-compiler - package-name: compiler-rt - branch-name: << pipeline.parameters.cheerp-compiler-commit >> - - build-deploy-rpm: - directory: cheerp-internal/tools/releasing/cheerp-core - package-name: core + name: Setup tarball + command: | + cp -r cheerp-compiler/rpmbuild ~ + mv cheerp-compiler "cheerp-core-$VERSION_NO" + tar -czvf "cheerp-core_$VERSION_NO.orig.tar.gz" \ + "cheerp-core-$VERSION_NO/clang" \ + "cheerp-core-$VERSION_NO/llvm" \ + "cheerp-core-$VERSION_NO/cmake" \ + "cheerp-core-$VERSION_NO/compiler-rt" \ + "cheerp-core-$VERSION_NO/libcxx" \ + "cheerp-core-$VERSION_NO/libcxxabi" \ + "cheerp-core-$VERSION_NO/runtimes" \ + "cheerp-core-$VERSION_NO/third-party" \ + "cheerp-core-$VERSION_NO/cheerp-libs" \ + "cheerp-core-$VERSION_NO/cheerp-musl" \ + "cheerp-core-$VERSION_NO/cheerp-utils" \ + "cheerp-core-$VERSION_NO/debian" + mkdir ~/rpmbuild/SOURCES + mv -v "cheerp-core_$VERSION_NO.orig.tar.gz" ~/rpmbuild/SOURCES + - run: + name: Build cheerp-toolchain + working_directory: ~ + command: | + sed -i "s/Version: .*/Version: $VERSION_NO/" ~/rpmbuild/SPECS/cheerp-core.spec + rpmbuild -ba ~/rpmbuild/SPECS/cheerp-core.spec + rpm --addsign ~/rpmbuild/RPMS/x86_64/cheerp-core-$VERSION_NO-1.el9.x86_64.rpm + - run: + name: Deploy rpm package + command: | + cp ~/rpmbuild/RPMS/x86_64/cheerp-core-$VERSION_NO-1.el9.x86_64.rpm "$REPO_DIR/$CHAN" + . ~/project/cheerp-internal/tools/releasing/rpm_utils.sh + repo_update - when: condition: equal: [ master, << pipeline.parameters.release-tag >> ] @@ -418,27 +228,25 @@ jobs: command: | if [ ${CHAN} == 'nightly' ]; then . ~/project/cheerp-internal/tools/releasing/rpm_utils.sh - repo_remove_old llvm-clang - repo_remove_old utils - repo_remove_old musl - repo_remove_old libcxx-libcxxabi - repo_remove_old compiler-rt - repo_remove_old libs repo_remove_old core repo_update fi + - persist_to_workspace: + root: ~/ + paths: + - version/ PPA: docker: - - image: cimg/base:2021.04 + - image: cimg/base:2022.04 resource_class: medium environment: - LC_ALL: en_US.UTF-8 - LANG: en_US.UTF-8 - LANGUAGE: en_US.UTF-8 - - DISTRO: focal + - DISTRO: jammy steps: - attach_workspace: - at: packages + at: ~/project/packages - run: name: Add environment command: | @@ -449,14 +257,7 @@ jobs: mkdir -p ~/.ssh echo $GH_HOST >> ~/.ssh/known_hosts - run: sudo apt-get update && sudo apt-get install -y debhelper cmake python3-distutils devscripts ninja-build clang lld python3-github - - run: - name: Get repos - command: | - git clone git@github.com:leaningtech/cheerp-internal.git - git clone https://github.com/leaningtech/cheerp-compiler cheerp-compiler - git clone https://github.com/leaningtech/cheerp-utils.git - git clone https://github.com/leaningtech/cheerp-musl.git - git clone https://github.com/leaningtech/cheerp-libs.git + - clone-toolchain - run: name: Set up workspace command: | @@ -466,151 +267,56 @@ jobs: if [ << pipeline.parameters.release-tag >> != 'master' ]; then echo "export CHANGELOG_MESSAGE="Release ${VERSION_NO}"" >> $BASH_ENV echo 'export PPA="ppa:leaningtech-dev/cheerp-ppa"' >> $BASH_ENV - cd cheerp-compiler && git checkout << pipeline.parameters.release-tag >> - cd ../cheerp-utils && git checkout << pipeline.parameters.release-tag >> - cd ../cheerp-musl && git checkout << pipeline.parameters.release-tag >> - cd ../cheerp-libs && git checkout << pipeline.parameters.release-tag >> else echo 'export CHANGELOG_MESSAGE="Nightly build"' >> $BASH_ENV echo 'export PPA="ppa:leaningtech-dev/cheerp-nightly-ppa"' >> $BASH_ENV - cd cheerp-compiler && git checkout << pipeline.parameters.cheerp-compiler-commit >> - cd ../cheerp-utils && git checkout << pipeline.parameters.cheerp-utils-commit >> - cd ../cheerp-musl && git checkout << pipeline.parameters.cheerp-musl-commit >> - cd ../cheerp-libs && git checkout << pipeline.parameters.cheerp-libs-commit >> fi - run: - name: Package cheerp-compiler + name: Create tarballs working_directory: cheerp-compiler command: | - if [ << pipeline.parameters.release-tag >> != 'master' ]; then - ../cheerp-internal/tools/releasing/llvm-clang_debian_archives.sh ${VERSION_NO} << pipeline.parameters.release-tag >> - else - ../cheerp-internal/tools/releasing/llvm-clang_debian_archives.sh ${VERSION_NO} << pipeline.parameters.cheerp-compiler-commit >> - fi - cd ../pkg - tar -xvf cheerp-llvm-clang_${VERSION_NO}.orig.tar.gz > /dev/null - cd cheerp-llvm-clang-${VERSION_NO} - dch -D ${DISTRO} -b -v ${VERSION_NO}-1~${DISTRO} "${CHANGELOG_MESSAGE}" -m - env -i HOME="$HOME" LC_CTYPE="${LC_ALL:-${LC_CTYPE:-$LANG}}" PATH="$PATH" USER="$USER" debuild -sa -S -kB5208673E6848661 --lintian-opts -v - - run: - name: Prepare cheerp-utils sources - working_directory: cheerp-utils - command: | - if [ << pipeline.parameters.release-tag >> != 'master' ]; then - ../cheerp-internal/tools/releasing/utils_debian_archives.sh $VERSION_NO << pipeline.parameters.release-tag >> - else - ../cheerp-internal/tools/releasing/utils_debian_archives.sh $VERSION_NO << pipeline.parameters.cheerp-utils-commit >> - fi - cd ../pkg - tar -xf cheerp-utils_${VERSION_NO}.orig.tar.gz - cd cheerp-utils-${VERSION_NO} - dch -b -v ${VERSION_NO}-1~${DISTRO} "${CHANGELOG_MESSAGE}" -D ${DISTRO} -m - sed -i "s/\${source:Version}/${VERSION_NO}/g" debian/control - debuild -sa -S -kB5208673E6848661 -d + tar -czvf ~/project/packages/cheerp-core_$VERSION_NO.orig-cheerp-libs.tar.gz cheerp-libs/ + tar -czvf ~/project/packages/cheerp-core_$VERSION_NO.orig-cheerp-musl.tar.gz cheerp-musl/ + tar -czvf ~/project/packages/cheerp-core_$VERSION_NO.orig-cheerp-utils.tar.gz cheerp-utils/ + tar -czvf ~/project/packages/cheerp-core_$VERSION_NO.orig.tar.gz clang/ llvm/ cmake/ compiler-rt/ libcxx/ libcxxabi/ \ + runtimes/ third-party/ debian/ - run: - name: Prepare cheerp-musl sources - working_directory: cheerp-musl + name: Package cheerp toolchain command: | - if [ << pipeline.parameters.release-tag >> != 'master' ]; then - ../cheerp-internal/tools/releasing/musl_debian_archives.sh $VERSION_NO << pipeline.parameters.release-tag >> - else - ../cheerp-internal/tools/releasing/musl_debian_archives.sh $VERSION_NO << pipeline.parameters.cheerp-musl-commit >> - fi - cd ../pkg - tar -xf cheerp-musl_${VERSION_NO}.orig.tar.gz - cd cheerp-musl-${VERSION_NO} - dch -b -v ${VERSION_NO}-1~${DISTRO} "${CHANGELOG_MESSAGE}" -D ${DISTRO} -m - sed -i "s/\${source:Version}/${VERSION_NO}/g" debian/control - debuild -sa -S -kB5208673E6848661 -d - - run: - name: Prepare libcxx-libcxxabi sources - working_directory: cheerp-compiler - command: | - if [ << pipeline.parameters.release-tag >> != 'master' ]; then - ../cheerp-internal/tools/releasing/libcxx-libcxxabi_debian_archives.sh $VERSION_NO << pipeline.parameters.release-tag >> - else - ../cheerp-internal/tools/releasing/libcxx-libcxxabi_debian_archives.sh $VERSION_NO << pipeline.parameters.cheerp-compiler-commit >> - fi - cd ../pkg - tar -xf cheerp-libcxx-libcxxabi_${VERSION_NO}.orig.tar.gz - cd cheerp-libcxx-libcxxabi-${VERSION_NO} - rm -rf debian/ - cp -rv runtimes/debian/ debian/ - dch -b -v ${VERSION_NO}-1~${DISTRO} "${CHANGELOG_MESSAGE}" -D ${DISTRO} -m - sed -i "s/\${source:Version}/${VERSION_NO}/g" debian/control - debuild -sa -S -kB5208673E6848661 -d - - run: - name: Prepare cheerp-libs sources - working_directory: cheerp-libs - command: | - if [ << pipeline.parameters.release-tag >> != 'master' ]; then - ../cheerp-internal/tools/releasing/libs_debian_archives.sh ${VERSION_NO} << pipeline.parameters.release-tag >> - else - ../cheerp-internal/tools/releasing/libs_debian_archives.sh ${VERSION_NO} << pipeline.parameters.cheerp-libs-commit >> - fi - cd ../pkg - tar -xf cheerp-libs_${VERSION_NO}.orig.tar.gz - cd cheerp-libs-${VERSION_NO} - dch -b -v ${VERSION_NO}-1~${DISTRO} "${CHANGELOG_MESSAGE}" -D ${DISTRO} -m - sed -i "s/\${source:Version}/${VERSION_NO}/g" debian/control - debuild -sa -S -kB5208673E6848661 -d - - run: - name: Prepare compiler-rt sources - working_directory: cheerp-compiler - command: | - if [ << pipeline.parameters.release-tag >> != 'master' ]; then - ../cheerp-internal/tools/releasing/compiler-rt_debian_archives.sh $VERSION_NO << pipeline.parameters.release-tag >> - else - ../cheerp-internal/tools/releasing/compiler-rt_debian_archives.sh $VERSION_NO << pipeline.parameters.cheerp-compiler-commit >> - fi + rm -rf cheerp-compiler/ + + cp ~/project/packages/cheerp-core_$VERSION_NO.orig-cheerp-libs.tar.gz . + cp ~/project/packages/cheerp-core_$VERSION_NO.orig-cheerp-musl.tar.gz . + cp ~/project/packages/cheerp-core_$VERSION_NO.orig-cheerp-utils.tar.gz . + cp ~/project/packages/cheerp-core_$VERSION_NO.orig.tar.gz . + + mkdir "cheerp-core-$VERSION_NO" + cd "cheerp-core-$VERSION_NO" - cd ../pkg - tar -xf cheerp-compiler-rt_${VERSION_NO}.orig.tar.gz - cd cheerp-compiler-rt-${VERSION_NO} - rm -rf debian/ - cp -rv compiler-rt/debian/ debian/ - dch -b -v ${VERSION_NO}-1~${DISTRO} "${CHANGELOG_MESSAGE}" -D ${DISTRO} -m - sed -i "s/\${source:Version}/${VERSION_NO}/g" debian/control - debuild -sa -S -kB5208673E6848661 -d - - run: - name: Prepare cheerp metapackage sources - working_directory: cheerp-internal/tools/releasing - command: | - GZIP="-n" tar -czf cheerp-core_${VERSION_NO}.orig.tar.gz cheerp-core - cd cheerp-core - dch -b -v ${VERSION_NO}-1~${DISTRO} "${CHANGELOG_MESSAGE}" -D ${DISTRO} -m - sed -i "s/\${source:Version}/${VERSION_NO}/g" debian/control - debuild -sa -S -kB5208673E6848661 -d + tar -xvf ../cheerp-core_$VERSION_NO.orig-cheerp-libs.tar.gz + tar -xvf ../cheerp-core_$VERSION_NO.orig-cheerp-musl.tar.gz + tar -xvf ../cheerp-core_$VERSION_NO.orig-cheerp-utils.tar.gz + tar -xvf ../cheerp-core_$VERSION_NO.orig.tar.gz + + dch -D ${DISTRO} -b -v ${VERSION_NO}-1~${DISTRO} "${CHANGELOG_MESSAGE}" -m + env -i HOME="$HOME" LC_CTYPE="${LC_ALL:-${LC_CTYPE:-$LANG}}" PATH="$PATH" USER="$USER" debuild -sa -S -kB5208673E6848661 --lintian-opts -v + cp ../*.dsc ~/project/packages + cp ../*.changes ~/project/packages + cp ../*.xz ~/project/packages - run: name: Publish - working_directory: pkg - command: | - dput ${PPA} cheerp-llvm-clang*_source.changes - dput ${PPA} cheerp-utils*_source.changes - dput ${PPA} cheerp-musl*_source.changes - dput ${PPA} cheerp-libcxx-libcxxabi*_source.changes - dput ${PPA} cheerp-libs*_source.changes - dput ${PPA} cheerp-compiler-rt*_source.changes - dput ${PPA} ../cheerp-internal/tools/releasing/cheerp-core*_source.changes + command: | + dput "$PPA" cheerp-core_*.changes if [ << pipeline.parameters.release-tag >> != 'master' ]; then - cp cheerp-llvm-clang_${VERSION_NO}.orig.tar.gz cheerp-llvm-clang-${VERSION_NO}.tar.gz - python3 ../cheerp-internal/tools/releasing/github_upload.py << pipeline.parameters.release-tag >> "Cheerp ${VERSION_NO}" cheerp-llvm-clang-${VERSION_NO}.tar.gz cheerp-llvm-clang-${VERSION_NO}.tar.gz - cp cheerp-utils_${VERSION_NO}.orig.tar.gz cheerp-utils-${VERSION_NO}.tar.gz - cp cheerp-musl_${VERSION_NO}.orig.tar.gz cheerp-musl-${VERSION_NO}.tar.gz - cp cheerp-libs_${VERSION_NO}.orig.tar.gz cheerp-libs-${VERSION_NO}.tar.gz - cp cheerp-compiler-rt_${VERSION_NO}.orig.tar.gz cheerp-compiler-rt-${VERSION_NO}.tar.gz - python3 ../cheerp-internal/tools/releasing/github_upload.py << pipeline.parameters.release-tag >> "Cheerp ${VERSION_NO}" cheerp-utils-${VERSION_NO}.tar.gz cheerp-utils-${VERSION_NO}.tar.gz - python3 ../cheerp-internal/tools/releasing/github_upload.py << pipeline.parameters.release-tag >> "Cheerp ${VERSION_NO}" cheerp-musl-${VERSION_NO}.tar.gz cheerp-musl-${VERSION_NO}.tar.gz - python3 ../cheerp-internal/tools/releasing/github_upload.py << pipeline.parameters.release-tag >> "Cheerp ${VERSION_NO}" cheerp-libs-${VERSION_NO}.tar.gz cheerp-libs-${VERSION_NO}.tar.gz - python3 ../cheerp-internal/tools/releasing/github_upload.py << pipeline.parameters.release-tag >> "Cheerp ${VERSION_NO}" cheerp-compiler-rt-${VERSION_NO}.tar.gz cheerp-compiler-rt-${VERSION_NO}.tar.gz + cp cheerp-core_${VERSION_NO}.orig.tar.gz cheerp-core-${VERSION_NO}.tar.gz + python3 ../cheerp-internal/tools/releasing/github_upload.py << pipeline.parameters.release-tag >> "Cheerp ${VERSION_NO}" cheerp-core-${VERSION_NO}.tar.gz cheerp-core-${VERSION_NO}.tar.gz fi build-cheerp-headers-and-libs: - docker: - - image: leaningtech/cheerp_ci_base:20.04 - resource_class: medium + executor: cheerp-medium steps: - attach_workspace: at: packages + - install-toolchain - run: name: Set up workspace command: | @@ -629,41 +335,42 @@ jobs: name: Clone dependencies command: | git clone git@github.com:leaningtech/cheerp-libs-addon.git - - install-deb: - package-name: llvm-clang - - install-deb: - package-name: utils - - install-deb: - package-name: musl - - install-deb: - package-name: libcxx-libcxxabi - - install-deb: - package-name: libs - - run: - name: get cheerp dependencies - working_directory: ~/project + - clone-toolchain + - run: + name: Build libraries + working_directory: ~/project/cheerp-compiler + environment: + - CHEERP_DIR: "/opt/cheerp" + command: | + # see run-asan-tests step for more info + apt remove -y clang + apt update && apt install -y clang-15 + + export CHEERP_DEST="$PWD" + ./debian/build.sh all-libs + ./debian/build.sh install + - run: + name: Add licences + working_directory: ~/project/cheerp-compiler command: | - dpkg -x ~/project/packages/cheerp-utils_${VERSION_NO}-*.deb . - dpkg -x ~/project/packages/cheerp-musl_${VERSION_NO}-*.deb . - dpkg -x ~/project/packages/cheerp-libcxx-libcxxabi_${VERSION_NO}-*.deb . - dpkg -x ~/project/packages/cheerp-libs_${VERSION_NO}-*.deb . - cp -v usr/share/doc/cheerp-libcxx-libcxxabi/LICENSE.TXT.cheerp-libcxx.gz opt/cheerp/LICENSE.TXT.cheerp-libcxx.gz - cp -v usr/share/doc/cheerp-libcxx-libcxxabi/LICENSE.TXT.cheerp-libcxxabi.gz opt/cheerp/LICENSE.TXT.cheerp-libcxxabi.gz - cp -v usr/share/doc/cheerp-musl/COPYRIGHT.gz opt/cheerp/COPYRIGHT.musl.gz - cp -v usr/share/doc/cheerp-libs/LICENSE.TXT.cheerp-libs.gz opt/cheerp/LICENSE.TXT.cheerp-libs.gz + gzip -c libcxx/LICENSE.TXT > opt/cheerp/LICENSE.TXT.cheerp-libcxx.gz + gzip -c libcxxabi/LICENSE.TXT > opt/cheerp/LICENSE.TXT.cheerp-libcxxabi.gz + gzip -c cheerp-musl/COPYRIGHT > opt/cheerp/COPYRIGHT.musl.gz + gzip -c cheerp-libs/LICENSE.TXT > opt/cheerp/LICENSE.TXT.cheerp-libs.gz - run: name: build cheerp-libs-addon working_directory: ~/project/cheerp-libs-addon command: | mkdir build_genericjs cd build_genericjs - cmake -DCMAKE_INSTALL_PREFIX="$PWD/../../opt/cheerp/" -DCMAKE_BUILD_TYPE=Release -DCHEERP_LINEAR_OUTPUT="" -DCMAKE_TOOLCHAIN_FILE=/opt/cheerp/share/cmake/Modules/CheerpToolchain.cmake -DCHEERP_MODE=genericjs .. + cmake -DCMAKE_INSTALL_PREFIX="../cheerp-compiler/opt/cheerp/" -DCMAKE_BUILD_TYPE=Release -DCHEERP_LINEAR_OUTPUT="" -DCMAKE_TOOLCHAIN_FILE=/opt/cheerp/share/cmake/Modules/CheerpToolchain.cmake -DCHEERP_MODE=genericjs .. make make install cd .. mkdir build_asmjs cd build_asmjs - cmake -DCMAKE_INSTALL_PREFIX="$PWD/../../opt/cheerp/" -DCMAKE_BUILD_TYPE=Release -DCHEERP_LINEAR_OUTPUT="" -DCMAKE_TOOLCHAIN_FILE=/opt/cheerp/share/cmake/Modules/CheerpToolchain.cmake -DCHEERP_MODE=asmjs .. + # Using the CheerpToolchain here is intended + cmake -DCMAKE_INSTALL_PREFIX="../cheerp-compiler/opt/cheerp/" -DCMAKE_BUILD_TYPE=Release -DCHEERP_LINEAR_OUTPUT="" -DCMAKE_TOOLCHAIN_FILE=/opt/cheerp/share/cmake/Modules/CheerpToolchain.cmake -DCHEERP_MODE=asmjs .. make make install - when: @@ -679,8 +386,8 @@ jobs: name: Generate libs packages working_directory: ~/project command: | - tar -cvjf packages/cheerp-headers-and-libs-${VERSION_NO}.tar.bz2 -C opt/cheerp . - tar -cvjf packages/cheerp-headers-and-libs-${VERSION_NO}-proprietary.tar.bz2 -C opt/cheerp . + tar -cvjf packages/cheerp-headers-and-libs-${VERSION_NO}.tar.bz2 -C cheerp-compiler/opt/cheerp . + tar -cvjf packages/cheerp-headers-and-libs-${VERSION_NO}-proprietary.tar.bz2 -C cheerp-compiler/opt/cheerp . - persist_to_workspace: root: packages paths: @@ -706,19 +413,18 @@ jobs: command: | mkdir -p ~/.ssh echo $GH_HOST >> ~/.ssh/known_hosts - - run: - name: Clone dependencies - command: | - git clone https://github.com/leaningtech/cheerp-compiler - git clone https://github.com/leaningtech/cheerp-utils - git clone git@github.com:leaningtech/cheerp-internal.git - if [ << pipeline.parameters.release-tag >> != 'master' ]; then - cd cheerp-compiler && git checkout << pipeline.parameters.release-tag >> && cd .. - cd cheerp-utils && git checkout << pipeline.parameters.release-tag >> && cd .. - else - cd cheerp-compiler && git checkout << pipeline.parameters.cheerp-compiler-commit >> && cd .. - cd cheerp-utils && git checkout << pipeline.parameters.cheerp-utils-commit >> - fi + - clone-cheerp-repo: + remote: https://github.com/leaningtech/cheerp-compiler + dir: cheerp-compiler + ref: << pipeline.parameters.cheerp-compiler-commit >> + - clone-cheerp-repo: + remote: https://github.com/leaningtech/cheerp-utils + dir: cheerp-utils + ref: << pipeline.parameters.cheerp-utils-commit >> + - shallow-clone: + remote: git@github.com:leaningtech/cheerp-internal.git + dir: cheerp-internal + ref: master - run: name: Build osxcross working_directory: /osxcross @@ -788,19 +494,18 @@ jobs: command: | mkdir -p ~/.ssh echo $GH_HOST >> ~/.ssh/known_hosts - - run: - name: Clone dependencies - command: | - git clone https://github.com/leaningtech/cheerp-compiler - git clone https://github.com/leaningtech/cheerp-utils - git clone git@github.com:leaningtech/cheerp-internal.git - if [ << pipeline.parameters.release-tag >> != 'master' ]; then - cd cheerp-compiler && git checkout << pipeline.parameters.release-tag >> && cd .. - cd cheerp-utils && git checkout << pipeline.parameters.release-tag >> && cd .. - else - cd cheerp-compiler && git checkout << pipeline.parameters.cheerp-compiler-commit >> && cd .. - cd cheerp-utils && git checkout << pipeline.parameters.cheerp-utils-commit >> - fi + - clone-cheerp-repo: + remote: https://github.com/leaningtech/cheerp-compiler + dir: cheerp-compiler + ref: << pipeline.parameters.cheerp-compiler-commit >> + - clone-cheerp-repo: + remote: https://github.com/leaningtech/cheerp-utils + dir: cheerp-utils + ref: << pipeline.parameters.cheerp-utils-commit >> + - shallow-clone: + remote: git@github.com:leaningtech/cheerp-internal.git + dir: cheerp-internal + ref: master - build-tblgen - run: name: Build cheerp-compiler @@ -923,7 +628,7 @@ jobs: name: Make package for linux working_directory: ~/project/linux command: | - dpkg -x ~/project/packages/cheerp-llvm-clang_${VERSION_NO}-*.deb . + dpkg -x ~/project/packages/cheerp-core_${VERSION_NO}-*.deb . tar -C opt/cheerp -xf ~/project/packages/cheerp-headers-and-libs-${VERSION_NO}-proprietary.tar.bz2 cp -v ~/project/cheerp-internal/tools/releasing/LICENSE.TXT.cheerp-llvm-clang.proprietary opt/cheerp/LICENSE.TXT-cheerp-llvm-clang - run: @@ -1079,130 +784,75 @@ commands: type: string steps: - run: - name: Get git version info - command: git --version - - run: - name: Create repository directory + name: Create directory << parameters.dir >> for repository command: mkdir -p << parameters.dir >> - run: working_directory: << parameters.dir >> - name: Initialize repository + name: Initialize << parameters.dir >> command: | + git --version git init git remote add origin << parameters.remote >> - run: working_directory: << parameters.dir >> - name: Fetch repository - command: git fetch --progress --depth=1 origin << parameters.ref >> + name: Fetch from << parameters.remote >> at ref << parameters.ref >> + command: git fetch --progress --depth=1 origin << parameters.ref >> - run: working_directory: << parameters.dir >> - name: Checkout ref + name: Checkout << parameters.ref >> command: git checkout --progress --force FETCH_HEAD - create-deb: + clone-cheerp-repo: + description: "A helper command that shallowly clones the a cheerp-* repo based on the pipeline parameters" parameters: - directory: + remote: type: string - package-name: + dir: type: string - steps: - - build-internal: - directory: << parameters.directory >> - package-name: << parameters.package-name >> - - install-deb: - package-name: << parameters.package-name >> - run-llvm-tests: - parameters: - rule: + ref: type: string steps: - - attach_workspace: - at: ~/project/packages - - run: - name: Install and setup ccache - command: | - apt update && apt install -y ccache - - run: mkdir ~/project/cheerp-compiler - - run: - name: Extract archive - working_directory: ~/project/cheerp-compiler - command: | - mv ~/project/packages/cheerp-build.tar.bz2 . - tar -xf cheerp-build.tar.bz2 - - run: - name: Run llvm << parameters.rule >> - working_directory: ~/project/cheerp-compiler/build - command: ninja -j6 << parameters.rule >> - run-cheerp-tests: - parameters: - target: - type: string - asan: - type: string + - when: + condition: + equal: [ master, << pipeline.parameters.release-tag >> ] + steps: + - shallow-clone: + ref: << parameters.ref >> + dir: << parameters.dir >> + remote: << parameters.remote >> + - when: + condition: + not: + equal: [ master, << pipeline.parameters.release-tag >> ] + steps: + - shallow-clone: + ref: << pipeline.parameters.release-tag >> + dir: << parameters.dir >> + remote: << parameters.remote >> + clone-toolchain: + steps: + - clone-cheerp-repo: + remote: https://github.com/leaningtech/cheerp-compiler + dir: cheerp-compiler + ref: << pipeline.parameters.cheerp-compiler-commit >> + - clone-cheerp-repo: + remote: https://github.com/leaningtech/cheerp-utils + dir: cheerp-compiler/cheerp-utils + ref: << pipeline.parameters.cheerp-utils-commit >> + - clone-cheerp-repo: + remote: https://github.com/leaningtech/cheerp-musl + dir: cheerp-compiler/cheerp-musl + ref: << pipeline.parameters.cheerp-musl-commit >> + - clone-cheerp-repo: + remote: https://github.com/leaningtech/cheerp-libs + dir: cheerp-compiler/cheerp-libs + ref: << pipeline.parameters.cheerp-libs-commit >> + install-toolchain: steps: - attach_workspace: at: packages - run: - name: Get tests - command: | - git clone https://github.com/leaningtech/cheerp-utils.git - cd cheerp-utils - if [ << pipeline.parameters.release-tag >> != master ]; then - git checkout << pipeline.parameters.release-tag >> - else - git checkout << pipeline.parameters.cheerp-utils-commit >> - fi - - run: mkdir -p /opt/cheerp - - install-deb: - package-name: llvm-clang - - install-deb: - package-name: utils - - install-deb: - package-name: musl - - install-deb: - package-name: compiler-rt - - install-deb: - package-name: libcxx-libcxxabi - - install-deb: - package-name: libs - - run: - name: test - working_directory: ~/project/cheerp-utils/tests - command: ./run_tests.py --<< parameters.target >> << parameters.asan >> --determinism=3 --determinism-probability=0.2 "/opt/cheerp/bin/clang++" "node --experimental-wasm-reftypes" -j4 - no_output_timeout: 30m - - run: - name: Store test results - command: | - mkdir -p ~/project/testResults - mv ~/project/cheerp-utils/tests/testReport.test ~/project/<< parameters.target >><< parameters.asan >>testResults - - store_artifacts: - path: ~/project/<< parameters.target >><< parameters.asan >>testResults - build-internal: - parameters: - directory: - type: string - package-name: - type: string - steps: - - run: - name: Build cheerp-<< parameters.package-name >> - working_directory: ~/project/<< parameters.directory >> - command: | - dch -b -v ${VERSION_NO}-1 "Internal build" -m - dpkg-buildpackage -d -b - mv ../cheerp-<< parameters.package-name >>_*.deb ../packages/ - install-deb: - parameters: - package-name: - type: string - steps: - - run: - name: Set up cheerp-<< parameters.package-name >> - working_directory: ~/project/packages - command: | - mkdir tmp - dpkg -x cheerp-<< parameters.package-name >>_*.deb tmp - cp -rv tmp/opt/cheerp/* /opt/cheerp - rm -rf tmp + name: Install cheerp toolchain + command: dpkg -i ~/project/packages/cheerp-core_*.deb add-yum-configuration: steps: - run: @@ -1249,72 +899,6 @@ commands: working_directory: ~/ command: | rsync -a --delete-after -e 'ssh -p 2223' leaningtech@136.243.170.209:/srv/web/rpm/$CHAN ${REPO_DIR}/ - create-rpm-package: - parameters: - directory: - type: string - package-name: - type: string - branch-name: - type: string - default: master - steps: - - add-rpm-sources: - directory: << parameters.directory >> - package-name: << parameters.package-name >> - branch-name: << parameters.branch-name >> - - build-deploy-rpm: - directory: << parameters.directory >> - package-name: << parameters.package-name >> - add-rpm-sources: - parameters: - directory: - type: string - package-name: - type: string - branch-name: - type: string - default: master - steps: - - run: - name: Add cheerp-<< parameters.package-name >> sources - working_directory: ~/project/<< parameters.directory >> - command: | - if [ << pipeline.parameters.release-tag >> != master ]; then - ../cheerp-internal/tools/releasing/<< parameters.package-name >>_debian_archives.sh ${VERSION_NO} << pipeline.parameters.release-tag >> - else - ../cheerp-internal/tools/releasing/<< parameters.package-name >>_debian_archives.sh ${VERSION_NO} << parameters.branch-name >> - fi - rm -rf rpmbuild/SOURCES - mkdir rpmbuild/SOURCES - mv ../pkg/* rpmbuild/SOURCES - build-deploy-rpm: - parameters: - directory: - type: string - package-name: - type: string - steps: - - run: - name: Build cheerp-<< parameters.package-name >> - working_directory: ~/project/<< parameters.directory >> - command: | - sed -i "s/Version: .*/Version: ${VERSION_NO}/" rpmbuild/SPECS/cheerp-<< parameters.package-name >>.spec - rpmbuild -ba rpmbuild/SPECS/cheerp-<< parameters.package-name >>.spec --define "_topdir ${PWD}/rpmbuild" - rpm --addsign rpmbuild/RPMS/x86_64/cheerp-<< parameters.package-name >>-${VERSION_NO}-1.el8.x86_64.rpm - - run: - name: Deploy cheerp-<< parameters.package-name >> - working_directory: ~/ - command: | - cp ~/project/<< parameters.directory >>/rpmbuild/RPMS/x86_64/cheerp-<< parameters.package-name >>-${VERSION_NO}-1.el8.x86_64.rpm ${REPO_DIR}/${CHAN} - . ~/project/cheerp-internal/tools/releasing/rpm_utils.sh - repo_update - - run: - name: Install cheerp-<< parameters.package-name >>-${VERSION_NO}-1.el8 - working_directory: ~/ - command: | - dnf clean all - dnf install -y cheerp-<< parameters.package-name >>-${VERSION_NO}-1.el8 build-tblgen: steps: - run: @@ -1372,11 +956,21 @@ parameters: type: string default: "master" +executors: + cheerp-large: + docker: + - image: leaningtech/cheerp_ci_base:22.04 + resource_class: large + cheerp-medium: + docker: + - image: leaningtech/cheerp_ci_base:22.04 + resource_class: medium + workflows: - build-cheerp-compiler: + build-cheerp-toolchain: jobs: - define-version-no - - build-cheerp-compiler: + - build-cheerp-toolchain: requires: - define-version-no - llvm-check: @@ -1384,11 +978,7 @@ workflows: parameters: rule: ["check-llvm", "check-clang"] requires: - - build-cheerp-compiler - - build-libraries: - requires: - - define-version-no - - build-cheerp-compiler + - build-cheerp-toolchain - test: matrix: parameters: @@ -1400,33 +990,31 @@ workflows: - target: "preexecute" asan: "--asan" requires: - - build-cheerp-compiler - - build-libraries + - build-cheerp-toolchain - run-asan-tests: requires: - - build-libraries - - RPM-cheerp-compiler: + - build-cheerp-toolchain + - RPM-cheerp-toolchain: requires: - define-version-no - test + - run-asan-tests - llvm-check filters: branches: only: master - - RPM-libraries: - requires: - - RPM-cheerp-compiler - PPA: requires: - define-version-no - test + - run-asan-tests - llvm-check filters: branches: only: master - build-cheerp-headers-and-libs: requires: - - build-libraries + - build-cheerp-toolchain filters: branches: only: master diff --git a/compiler-rt/debian/changelog b/compiler-rt/debian/changelog deleted file mode 100644 index 1b62fbe9f020..000000000000 --- a/compiler-rt/debian/changelog +++ /dev/null @@ -1,5 +0,0 @@ -cheerp-compiler-rt (2.7-1~focal) focal; urgency=low - - * Initial Release - - -- Daan Meijer Tue, 02 Jan 2024 12:00:00 +0200 diff --git a/compiler-rt/debian/compat b/compiler-rt/debian/compat deleted file mode 100644 index 45a4fb75db86..000000000000 --- a/compiler-rt/debian/compat +++ /dev/null @@ -1 +0,0 @@ -8 diff --git a/compiler-rt/debian/control b/compiler-rt/debian/control deleted file mode 100644 index 3e1511ded8ef..000000000000 --- a/compiler-rt/debian/control +++ /dev/null @@ -1,12 +0,0 @@ -Source: cheerp-compiler-rt -Maintainer: Alessandro Pignotti -Section: devel -Priority: optional -Standards-Version: 3.9.2 -Build-Depends: debhelper (>=8), cmake, cheerp-llvm-clang (>=${source:Version}), cheerp-utils (>=${source:Version}), cheerp-musl (>=${source:Version}), cheerp-libcxx-libcxxabi (>=${binary:Version}), python3, ninja-build - -Package: cheerp-compiler-rt -Architecture: any -Conflicts: cheerp -Depends: ${shlibs:Depends}, ${misc:Depends}, cheerp-llvm-clang (>=${binary:Version}), cheerp-utils (>=${binary:Version}), cheerp-musl (>=${binary:Version}), cheerp-libcxx-libcxxabi (>=${binary:Version}) -Description: Compiler runtime libraries for Cheerp diff --git a/compiler-rt/debian/copyright b/compiler-rt/debian/copyright deleted file mode 100644 index a33b14cf44cf..000000000000 --- a/compiler-rt/debian/copyright +++ /dev/null @@ -1,208 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: cheerp-compiler-rt -Copyright: 2011-2023, Leaning Technologies -License: APACHE-2-LLVM-EXCEPTIONS - On Debian systems the full text of the Apache Software License 2.0 can be - found in the `/usr/share/common-licenses/Apache-2.0' file. - . - ---- LLVM Exceptions to the Apache 2.0 License ---- - . - As an exception, if, as a result of your compiling your source code, portions - of this Software are embedded into an Object form of such source code, you - may redistribute such embedded portions in such Object form without complying - with the conditions of Sections 4(a), 4(b) and 4(d) of the License. - . - In addition, if you combine or link compiled forms of this Software with - software that is licensed under the GPLv2 ("Combined Software") and if a - court of competent jurisdiction determines that the patent provision (Section - 3), the indemnity provision (Section 9) or other Section of the License - conflicts with the conditions of the GPLv2, you may retroactively and - prospectively choose to deem waived or otherwise exclude such Section(s) of - the License, but only in their entirety and only with respect to the Combined - Software. - -Files: llvm/Cheerp*/* -Copyright: 2011-2023, Leaning Technologies -License: APACHE-2-LLVM-EXCEPTIONS - On Debian systems the full text of the Apache Software License 2.0 can be - found in the `/usr/share/common-licenses/Apache-2.0' file. - . - ---- LLVM Exceptions to the Apache 2.0 License ---- - . - As an exception, if, as a result of your compiling your source code, portions - of this Software are embedded into an Object form of such source code, you - may redistribute such embedded portions in such Object form without complying - with the conditions of Sections 4(a), 4(b) and 4(d) of the License. - . - In addition, if you combine or link compiled forms of this Software with - software that is licensed under the GPLv2 ("Combined Software") and if a - court of competent jurisdiction determines that the patent provision (Section - 3), the indemnity provision (Section 9) or other Section of the License - conflicts with the conditions of the GPLv2, you may retroactively and - prospectively choose to deem waived or otherwise exclude such Section(s) of - the License, but only in their entirety and only with respect to the Combined - Software. - -Files: llvm/Target/CheerpBackend/* -Copyright: 2011-2023, Leaning Technologies -License: APACHE-2-LLVM-EXCEPTIONS - On Debian systems the full text of the Apache Software License 2.0 can be - found in the `/usr/share/common-licenses/Apache-2.0' file. - . - ---- LLVM Exceptions to the Apache 2.0 License ---- - . - As an exception, if, as a result of your compiling your source code, portions - of this Software are embedded into an Object form of such source code, you - may redistribute such embedded portions in such Object form without complying - with the conditions of Sections 4(a), 4(b) and 4(d) of the License. - . - In addition, if you combine or link compiled forms of this Software with - software that is licensed under the GPLv2 ("Combined Software") and if a - court of competent jurisdiction determines that the patent provision (Section - 3), the indemnity provision (Section 9) or other Section of the License - conflicts with the conditions of the GPLv2, you may retroactively and - prospectively choose to deem waived or otherwise exclude such Section(s) of - the License, but only in their entirety and only with respect to the Combined - Software. - -Files: * -Copyright: 2003-2017 University of Illinois at Urbana-Champaign. -License: APACHE-2-LLVM-EXCEPTIONS - On Debian systems the full text of the Apache Software License 2.0 can be - found in the `/usr/share/common-licenses/Apache-2.0' file. - . - ---- LLVM Exceptions to the Apache 2.0 License ---- - . - As an exception, if, as a result of your compiling your source code, portions - of this Software are embedded into an Object form of such source code, you - may redistribute such embedded portions in such Object form without complying - with the conditions of Sections 4(a), 4(b) and 4(d) of the License. - . - In addition, if you combine or link compiled forms of this Software with - software that is licensed under the GPLv2 ("Combined Software") and if a - court of competent jurisdiction determines that the patent provision (Section - 3), the indemnity provision (Section 9) or other Section of the License - conflicts with the conditions of the GPLv2, you may retroactively and - prospectively choose to deem waived or otherwise exclude such Section(s) of - the License, but only in their entirety and only with respect to the Combined - Software. - -Files: debian/* -Copyright: 2003-2020 Sylvestre Ledru and others -License: APACHE-2-LLVM-EXCEPTIONS - On Debian systems the full text of the Apache Software License 2.0 can be - found in the `/usr/share/common-licenses/Apache-2.0' file. - . - ---- LLVM Exceptions to the Apache 2.0 License ---- - . - As an exception, if, as a result of your compiling your source code, portions - of this Software are embedded into an Object form of such source code, you - may redistribute such embedded portions in such Object form without complying - with the conditions of Sections 4(a), 4(b) and 4(d) of the License. - . - In addition, if you combine or link compiled forms of this Software with - software that is licensed under the GPLv2 ("Combined Software") and if a - court of competent jurisdiction determines that the patent provision (Section - 3), the indemnity provision (Section 9) or other Section of the License - conflicts with the conditions of the GPLv2, you may retroactively and - prospectively choose to deem waived or otherwise exclude such Section(s) of - the License, but only in their entirety and only with respect to the Combined - Software. - -Files: compiler-rt/lib/BlocksRuntime/* - lldb/tools/debugserver/source/MacOSX/stack_logging.h -Copyright: 2008-2010 Apple, Inc. -License: MIT - -Files: llvm/lib/Support/reg* -Copyright: 1992, 1993, 1994 Henry Spencer - 1992, 1993, 1994 The Regents of the University of California -License: BSD-3-clause - -Files: llvm/lib/Support/MD5.cpp llvm/include/llvm/Support/MD5.h -Copyright: 2001 Alexander Peslyak -License: solar-public-domain - This software was written by Alexander Peslyak in 2001. No copyright is - claimed, and the software is hereby placed in the public domain. - In case this attempt to disclaim copyright and place the software in the - public domain is deemed null and void, then the software is - Copyright (c) 2001 Alexander Peslyak and it is hereby released to the - general public under the following terms: - . - Redistribution and use in source and binary forms, with or without - modification, are permitted. - . - * There's ABSOLUTELY NO WARRANTY, express or implied. - -Files: lldb/third_party/Python/module/unittest2* -Copyright: 1999-2003 Steve Purcell - 2003-2010 Python Software Foundation -License: Python - This module is free software, and you may redistribute it and/or modify - it under the same terms as Python itself, so long as this copyright message - and disclaimer are retained in their original form. - . - IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, - SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF - THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGE. - . - THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, - AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, - SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. - -Files: llvm/llvmtest/YAMLParser/* -Copyright: 2006 Kirill Simonov -License: MIT - -Files: llvm/utils/unittest/googletest/* -Copyright: 2006-2008, Google Inc. -License: BSD-3-Clause - -Files: llvm/utils/unittest/googlemock/* -Copyright: 2008, Google Inc. -License: BSD-3-Clause - -Files: clang/lib/Headers/cuda_wrappers/* - clang/lib/Headers/avx512vlvp2intersectintrin.h - clang/lib/Headers/avx512vp2intersectintrin.h -Copyright: 2016-2020, Google Inc. - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - . - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - . - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - - -License: MIT - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - . - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - . - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. diff --git a/compiler-rt/debian/docs b/compiler-rt/debian/docs deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/compiler-rt/debian/rules b/compiler-rt/debian/rules deleted file mode 100755 index a9c3493ac364..000000000000 --- a/compiler-rt/debian/rules +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/make -f - -ifdef CIRCLECI - LLVM_DIR_OPT=-DLLVM_DIR="$(PWD)/build/lib/cmake/llvm" -endif - -%: - dh $@ - -override_dh_auto_configure: - cmake -S compiler-rt -B build_compiler_rt_wasm \ - -C compiler-rt/CheerpCmakeConf.cmake \ - -DCMAKE_BUILD_TYPE=Release ${LLVM_DIR_OPT} \ - -DCMAKE_TOOLCHAIN_FILE="/opt/cheerp/share/cmake/Modules/CheerpWasmToolchain.cmake" - -override_dh_auto_build: - dh_auto_build -Bbuild_compiler_rt_wasm - -override_dh_auto_test: - - -override_dh_auto_install: - dh_auto_install -Bbuild_compiler_rt_wasm - -override_dh_installdocs: - dh_installdocs diff --git a/compiler-rt/debian/source/format b/compiler-rt/debian/source/format deleted file mode 100644 index 163aaf8d82b6..000000000000 --- a/compiler-rt/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/debian/build.sh b/debian/build.sh new file mode 100755 index 000000000000..867f45ffa08d --- /dev/null +++ b/debian/build.sh @@ -0,0 +1,245 @@ +#!/bin/bash + +# This is an utility script for building and installing the entire Cheerp +# toolchain on Linux. +# +# This script expects that the Cheerp repositories have been placed like this: +# cheerp-compiler/ +# cheerp-compiler/cheerp-musl +# cheerp-compiler/cheerp-utils +# cheerp-compiler/cheerp-libs +# +# Cheerp will be installed in $CHEERP_DEST/$CHEERP_PREFIX, you can change these +# variables to what you'd like. +# +# You can set CHEERP_DEST to an already installed Cheerp toolchain and use that +# to build parts of the toolchain separately. +# +# This script will by default try to use as many threads as possible for each +# step. If you're running out of resources while running this script, try +# setting the THREADS environment variable to something lower +# +# You'll probably just want to run this script like this to build and install +# the entire toolchain: +# ./build.sh all +# ./build.sh install + +set -ex + +FLAGS_RELEASE="-DNDEBUG -O2" +USE_CCACHE=Off +ENABLE_LLVM_ASSERTIONS=Off + +BUILD_DIR="$PWD/build" +mkdir -p "$BUILD_DIR" + +if [ -n "$CIRCLECI" ]; then + if [ "$CIRCLE_BRANCH" != "master" ]; then + USE_CCACHE=On + ENABLE_LLVM_ASSERTIONS=On + fi + FLAGS_RELEASE="-O2" +fi + +if [ -z "$CHEERP_DEST" ]; then + export CHEERP_DEST=/ +fi + +if [ -z "$CHEERP_PREFIX" ]; then + echo '$CHEERP_PREFIX not specified, defaulting to /opt/cheerp' >&2 + export CHEERP_PREFIX="/opt/cheerp" +fi + +export TMP_INSTALL="$BUILD_DIR/$CHEERP_PREFIX" + +if [ -z "$CHEERP_DIR" ]; then + export CHEERP_DIR="$TMP_INSTALL" +fi + +llvm_ninja_command() { + JOBS_OPT="" + if [ -n "$THREADS" ]; then + JOBS_OPT="-j$THREADS" + fi + ninja $JOBS_OPT -v -C build_llvm "$1" +} + +build_compiler() { + cmake \ + -C llvm/CheerpCmakeConf.cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_FLAGS_RELEASE="$FLAGS_RELEASE" \ + -DCLANG_VENDOR="Cheerp $deb_version" \ + -DLLVM_ENABLE_PROJECTS=clang \ + llvm/ \ + -GNinja \ + -DLLVM_ENABLE_ASSERTIONS="$ENABLE_LLVM_ASSERTIONS" \ + -DCMAKE_CXX_COMPILER=clang++ \ + -DCMAKE_C_COMPILER=clang \ + -DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=ld \ + -DCMAKE_SHARED_LINKER_FLAGS=-fuse-ld=ld \ + -DCMAKE_MODULE_LINKER_FLAGS=-fuse-ld=ld \ + -DLLVM_CCACHE_BUILD="$USE_CCACHE" \ + -B build_llvm + + export DESTDIR="$BUILD_DIR" + llvm_ninja_command install-distribution + unset DESTDIR +} + +prepare() { + #This is temporary and will be overwritten after install + cmake -B cheerp-utils/build -DCMAKE_INSTALL_PREFIX="$TMP_INSTALL" -DCHEERP_PREFIX="$CHEERP_DIR" cheerp-utils + make -C cheerp-utils/build install +} + +build_musl() { + export RANLIB="$CHEERP_DIR/bin/llvm-ar s" + export AR="$CHEERP_DIR/bin/llvm-ar" + export LD="$CHEERP_DIR/bin/llvm-link" + export CC_GENERICJS="$CHEERP_DIR/bin/clang -target cheerp" + export CC_ASMJS="$CHEERP_DIR/bin/clang -target cheerp-wasm" + export CFLAGS="-Wno-int-conversion" + + MUSL_GENERICJS_DIR=cheerp-musl/build_genericjs + MUSL_ASMJS_DIR=cheerp-musl/build_asmjs + + mkdir -p "$MUSL_GENERICJS_DIR" + (cd "$MUSL_GENERICJS_DIR" && CC="$CC_GENERICJS" ../configure --target=cheerp --disable-shared --prefix="$TMP_INSTALL" \ + --with-malloc=dlmalloc) + make -C "$MUSL_GENERICJS_DIR" install-cheerp -j + + mkdir -p "$MUSL_ASMJS_DIR" + (cd "$MUSL_ASMJS_DIR" && CC="$CC_ASMJS" ../configure --target=cheerp-wasm --disable-shared --prefix="$TMP_INSTALL" \ + --with-malloc=dlmalloc) + make -C "$MUSL_ASMJS_DIR" install-bc -j + + unset CFLAGS +} + +build_runtimes() { + prepare + + LIBCXX_GENERICJS_DIR=build_runtimes_genericjs + LIBCXX_ASMJS_DIR=build_runtimes_asmjs + cmake -DCMAKE_INSTALL_PREFIX="$TMP_INSTALL" -S runtimes -B "$LIBCXX_GENERICJS_DIR" -GNinja -C \ + runtimes/CheerpCmakeConf.cmake -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_TOOLCHAIN_FILE="$CHEERP_DIR/share/cmake/Modules/CheerpToolchain.cmake" + + cmake -DCMAKE_INSTALL_PREFIX="$TMP_INSTALL" -S runtimes -B "$LIBCXX_ASMJS_DIR" -GNinja -C \ + runtimes/CheerpCmakeConf.cmake -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_TOOLCHAIN_FILE="$CHEERP_DIR/share/cmake/Modules/CheerpWasmToolchain.cmake" + + ninja -C "$LIBCXX_GENERICJS_DIR" + ninja -C "$LIBCXX_ASMJS_DIR" + + # We can't install genericjs or asmjs before building the other, because it wouldn't then use the correct headers + ninja -C "$LIBCXX_GENERICJS_DIR" install + ninja -C "$LIBCXX_ASMJS_DIR" install +} + + +build_libraries() { + prepare + + export INSTALL_PREFIX="$TMP_INSTALL" + make -C cheerp-libs/webgles install CHEERP_PREFIX="$CHEERP_DIR" + make -C cheerp-libs/wasm install CHEERP_PREFIX="$CHEERP_DIR" + make -C cheerp-libs/stdlibs install CHEERP_PREFIX="$CHEERP_DIR" + + # SYSTEM + SYS_GENERICJS_DIR="cheerp-libs/system/build_genericjs" + SYS_ASMJS_DIR="cheerp-libs/system/build_asmjs" + + cmake -B "$SYS_GENERICJS_DIR" -DCMAKE_INSTALL_PREFIX="$TMP_INSTALL" \ + -DCMAKE_TOOLCHAIN_FILE="$CHEERP_DIR/share/cmake/Modules/CheerpToolchain.cmake" cheerp-libs/system + cmake --build "$SYS_GENERICJS_DIR" + cmake --install "$SYS_GENERICJS_DIR" + + cmake -B "$SYS_ASMJS_DIR" -DCMAKE_INSTALL_PREFIX="$TMP_INSTALL" \ + -DCMAKE_TOOLCHAIN_FILE="$CHEERP_DIR/share/cmake/Modules/CheerpWasmToolchain.cmake" cheerp-libs/system + cmake --build "$SYS_ASMJS_DIR" + cmake --install "$SYS_ASMJS_DIR" +} + +build_compiler_rt() { + prepare + + if [ -n "$CIRCLECI" ]; then + LLVM_DIR_OPT="-DLLVM_DIR=$PWD/build_llvm/lib/cmake/llvm" + fi + LLVM_DIR_OPT="-DLLVM_DIR=$PWD/build_llvm/lib/cmake/llvm" + + cmake -S compiler-rt -B build_compiler_rt \ + -C compiler-rt/CheerpCmakeConf.cmake \ + -DCMAKE_BUILD_TYPE=Release $LLVM_DIR_OPT \ + -DCMAKE_INSTALL_PREFIX="$TMP_INSTALL" \ + -DCMAKE_TOOLCHAIN_FILE="$CHEERP_DIR/share/cmake/Modules/CheerpWasmToolchain.cmake" + + make -C build_compiler_rt install +} + +install_all() { + # cheerp-utils will install stuff with absolute paths. To fix this, during compilation we'll use a temporary cheerp-utils, + # with the directories pointing to the build dirs, and just before installing, we'll change the paths to the actual install dir + cmake -B cheerp-utils/build -DCMAKE_INSTALL_PREFIX="$TMP_INSTALL" -DCHEERP_PREFIX="$CHEERP_PREFIX" cheerp-utils + make -C cheerp-utils/build install + + mkdir -p "$CHEERP_DEST" + cp -r "$BUILD_DIR/." "$CHEERP_DEST" + cp cheerp-utils/LICENSE.TXT "$CHEERP_DEST/$CHEERP_PREFIX/" + cp cheerp-utils/README "$CHEERP_DEST/$CHEERP_PREFIX/" + cp cheerp-utils/ChangeLog "$CHEERP_DEST/$CHEERP_PREFIX/" +} + +build_all_libraries() { + build_musl + build_runtimes + build_libraries + build_compiler_rt +} + +build_all() { + build_compiler + build_all_libraries +} + +case "$1" in + compiler) + build_compiler + ;; + musl) + build_musl + ;; + runtimes) + build_runtimes + ;; + libs) + build_libraries + ;; + compiler-rt) + build_compiler_rt + ;; + all-libs) + build_all_libraries + ;; + install) + install_all + ;; + tar-compiler) + tar -cvjf "$2" build_llvm debian/build.sh cmake third-party llvm clang .git/logs/HEAD + ;; + tar-install) + tar -cvjf "$2" "$BUILD_DIR/." + ;; + run-command) + llvm_ninja_command "$2" + ;; + all) + build_all + ;; + *) + echo "Unknown command $1" >&2 + exit 1 + ;; +esac diff --git a/debian/changelog b/debian/changelog index 453193cf3c89..3a9f8f891ea1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cheerp-core (3.0-1) focal; urgency=medium + + * New release + + -- Daan Meijer Fri, 19 Jan 2024 10:57:13 +0100 + cheerp-llvm-clang (2.6-1ubuntu1) focal; urgency=medium * New release diff --git a/debian/cheerp-llvm-clang.install b/debian/cheerp-llvm-clang.install deleted file mode 100644 index abfcdf5fdd96..000000000000 --- a/debian/cheerp-llvm-clang.install +++ /dev/null @@ -1,60 +0,0 @@ -opt/cheerp/lib/clang/16/ -opt/cheerp/lib/clang/16/include/ -opt/cheerp/lib/clang/16/include/bmi2intrin.h -opt/cheerp/lib/clang/16/include/stddef.h -opt/cheerp/lib/clang/16/include/pmmintrin.h -opt/cheerp/lib/clang/16/include/fmaintrin.h -opt/cheerp/lib/clang/16/include/float.h -opt/cheerp/lib/clang/16/include/avxintrin.h -opt/cheerp/lib/clang/16/include/wmmintrin.h -opt/cheerp/lib/clang/16/include/rtmintrin.h -opt/cheerp/lib/clang/16/include/cheerpintrin.h -opt/cheerp/lib/clang/16/include/ammintrin.h -opt/cheerp/lib/clang/16/include/xmmintrin.h -opt/cheerp/lib/clang/16/include/xopintrin.h -opt/cheerp/lib/clang/16/include/avx2intrin.h -opt/cheerp/lib/clang/16/include/limits.h -opt/cheerp/lib/clang/16/include/mmintrin.h -opt/cheerp/lib/clang/16/include/module.modulemap -opt/cheerp/lib/clang/16/include/lzcntintrin.h -opt/cheerp/lib/clang/16/include/intrin.h -opt/cheerp/lib/clang/16/include/varargs.h -opt/cheerp/lib/clang/16/include/rdseedintrin.h -opt/cheerp/lib/clang/16/include/tbmintrin.h -opt/cheerp/lib/clang/16/include/prfchwintrin.h -opt/cheerp/lib/clang/16/include/f16cintrin.h -opt/cheerp/lib/clang/16/include/emmintrin.h -opt/cheerp/lib/clang/16/include/tgmath.h -opt/cheerp/lib/clang/16/include/tmmintrin.h -opt/cheerp/lib/clang/16/include/x86intrin.h -opt/cheerp/lib/clang/16/include/stdint.h -opt/cheerp/lib/clang/16/include/iso646.h -opt/cheerp/lib/clang/16/include/mm_malloc.h -opt/cheerp/lib/clang/16/include/bmiintrin.h -opt/cheerp/lib/clang/16/include/stdalign.h -opt/cheerp/lib/clang/16/include/immintrin.h -opt/cheerp/lib/clang/16/include/popcntintrin.h -opt/cheerp/lib/clang/16/include/fma4intrin.h -opt/cheerp/lib/clang/16/include/shaintrin.h -opt/cheerp/lib/clang/16/include/stdnoreturn.h -opt/cheerp/lib/clang/16/include/smmintrin.h -opt/cheerp/lib/clang/16/include/__wmmintrin_aes.h -opt/cheerp/lib/clang/16/include/nmmintrin.h -opt/cheerp/lib/clang/16/include/stdbool.h -opt/cheerp/lib/clang/16/include/altivec.h -opt/cheerp/lib/clang/16/include/cpuid.h -opt/cheerp/lib/clang/16/include/unwind.h -opt/cheerp/lib/clang/16/include/__wmmintrin_pclmul.h -opt/cheerp/lib/clang/16/include/mm3dnow.h -opt/cheerp/lib/clang/16/include/ia32intrin.h -opt/cheerp/lib/clang/16/include/stdarg.h -opt/cheerp/lib/clang/16/include/__stddef_max_align_t.h -opt/cheerp/bin/ -opt/cheerp/bin/clang-16 -opt/cheerp/bin/opt -opt/cheerp/bin/llvm-dis -opt/cheerp/bin/llc -opt/cheerp/bin/llvm-ar -opt/cheerp/bin/llvm-link -opt/cheerp/bin/clang -opt/cheerp/bin/clang++ diff --git a/debian/control b/debian/control index e9a02c31b3e4..5d103e9e3ed9 100644 --- a/debian/control +++ b/debian/control @@ -1,14 +1,13 @@ -Source: cheerp-llvm-clang +Source: cheerp-core Maintainer: Alessandro Pignotti Section: devel Priority: optional Standards-Version: 3.9.2 Build-Depends: debhelper (>=8), cmake, python3, python3-distutils, ninja-build, clang, lld, git -Package: cheerp-llvm-clang +Package: cheerp-core Architecture: i386 amd64 arm64 Depends: ${shlibs:Depends}, ${misc:Depends} -Conflicts: cheerp Description: A C++ compiler for the Web Cheerp is a tool to bring C++ programming to the Web. It can generate a seamless combination of JavaScript, WebAssembly and Asm.js from a single C++ codebase. diff --git a/debian/rules b/debian/rules index b2c50dc7df27..054c2df48f59 100755 --- a/debian/rules +++ b/debian/rules @@ -1,54 +1,10 @@ #!/usr/bin/make -f -deb_version := $(shell dpkg-parsechangelog | sed -n 's/^Version: //p') -ifndef CIRCLECI - FLAGS_RELEASE="-DNDEBUG -O2" - USE_CCACHE=Off - ENABLE_LLVM_ASSERTIONS=Off -else - ifeq (${CIRCLE_BRANCH}, master) - USE_CCACHE=Off - ENABLE_LLVM_ASSERTIONS=Off - else - USE_CCACHE=On - ENABLE_LLVM_ASSERTIONS=On - endif - FLAGS_RELEASE="-O2" -endif - %: - dh $@ --parallel --builddirectory=build - -override_dh_auto_configure: - mkdir -p build - cd build && cmake \ - -C ../llvm/CheerpCmakeConf.cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_CXX_FLAGS_RELEASE=${FLAGS_RELEASE} \ - -DCLANG_VENDOR="Cheerp ${deb_version}" \ - -DLLVM_ENABLE_PROJECTS=clang \ - ../llvm/ \ - -GNinja \ - -DLLVM_ENABLE_ASSERTIONS=${ENABLE_LLVM_ASSERTIONS} \ - -DCMAKE_CXX_COMPILER=clang++ \ - -DCMAKE_C_COMPILER=clang \ - -DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld \ - -DCMAKE_SHARED_LINKER_FLAGS=-fuse-ld=lld \ - -DCMAKE_MODULE_LINKER_FLAGS=-fuse-ld=lld \ - -DLLVM_CCACHE_BUILD=${USE_CCACHE} - -override_dh_auto_install: - cd build && DESTDIR=${PWD}/debian/tmp ninja install-distribution + dh $@ override_dh_auto_build: - ifndef CIRCLECI - cd build && ninja distribution - else - cd build && ninja -j${THREADS} distribution - endif - + ./debian/build.sh all -override_dh_auto_test: - ifndef CIRCLECI - cd build && ninja check - endif +override_dh_auto_install: + CHEERP_DEST=$$(pwd)/debian/cheerp-core ./debian/build.sh install diff --git a/rpmbuild/SPECS/cheerp-core.spec b/rpmbuild/SPECS/cheerp-core.spec new file mode 100644 index 000000000000..fe2059b047bc --- /dev/null +++ b/rpmbuild/SPECS/cheerp-core.spec @@ -0,0 +1,39 @@ +Name: cheerp-core +Version: 3.0 +Release: 1%{?dist} +Summary: A C++ compiler for the web + +License: Apache-2.0 WITH LLVM-exception OR NCSA +URL: https://leaningtech.com/cheerp +Source0: %{NAME}_%{VERSION}.orig.tar.gz + +BuildRequires: clang lld cmake ninja-build python3 + +%description +Cheerp is a tool to bring C++ programming to the Web. It can generate a seamless +combination of JavaScript, WebAssembly and Asm.js from a single C++ codebase. + +%define debug_package %{nil} + +%prep +%autosetup + +%build +./debian/build.sh all + +%install +echo %{buildroot} +CHEERP_DEST=%{buildroot} ./debian/build.sh install + +%files +/opt/cheerp + +%changelog +* Mon Jan 22 2024 Daan Meijer +- Merge packages into a single binary package using new build script +* Fri Mar 03 2023 Yuri Iozzelli +- Update license +* Wed Feb 03 2021 Yuri Iozzelli +- Update to new monorepo +* Tue Dec 10 2019 Yuri Iozzelli +- First RPM version diff --git a/rpmbuild/SPECS/cheerp-llvm-clang.spec b/rpmbuild/SPECS/cheerp-llvm-clang.spec deleted file mode 100644 index 06cee4764907..000000000000 --- a/rpmbuild/SPECS/cheerp-llvm-clang.spec +++ /dev/null @@ -1,62 +0,0 @@ -Name: cheerp-llvm-clang -Version: 3.0 -Release: 1%{?dist} -Summary: A C++ compiler for the Web - -License: Apache-2.0 WITH LLVM-exception OR NCSA -URL: https://leaningtech.com/cheerp -Source0: %{NAME}_%{VERSION}.orig.tar.gz - -BuildRequires: clang lld cmake ninja-build python3 - -%description -Cheerp is a tool to bring C++ programming to the Web. It can generate a seamless -combination of JavaScript, WebAssembly and Asm.js from a single C++ codebase. - -%define debug_package %{nil} -%define circleci %{getenv:CIRCLECI} - -%prep -%autosetup -mkdir -p build -cd build -cmake -C ../llvm/CheerpCmakeConf.cmake \ - -DCMAKE_INSTALL_RPATH:BOOL=";" \ - -DCMAKE_C_COMPILER=clang \ - -DCMAKE_CXX_COMPILER=clang++ \ - -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" \ - -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld" \ - -DCMAKE_MODULE_LINKER_FLAGS="-fuse-ld=lld" \ - -DCLANG_VENDOR="Cheerp %{VERSION}" \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG -O2" \ - -DLLVM_ENABLE_PROJECTS=clang \ - -GNinja \ - ../llvm/ - - -%build -%if "%{circleci}" == "true" -NINJA_STATUS="[%u/%r/%f] " ninja -j${THREADS} -C build distribution -%else -NINJA_STATUS="[%u/%r/%f] " ninja -C build distribution -%endif - -%check - -%install -DESTDIR=%{buildroot} INSTALL="/usr/bin/install -p" ninja -C build install-distribution - -%clean -rm -rf $RPM_BUILD_ROOT - -%files -/opt/cheerp/ - -%changelog -* Fri Mar 03 2023 Yuri Iozzelli -- Update license -* Wed Feb 03 2021 Yuri Iozzelli -- Update to new monorepo -* Tue Dec 10 2019 Yuri Iozzelli -- First RPM version diff --git a/runtimes/CheerpCmakeConf.cmake b/runtimes/CheerpCmakeConf.cmake index 305ebb97dfa8..a2492d806593 100644 --- a/runtimes/CheerpCmakeConf.cmake +++ b/runtimes/CheerpCmakeConf.cmake @@ -17,8 +17,3 @@ set(LIBCXXABI_ENABLE_THREADS OFF CACHE BOOL "") set(LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX OFF CACHE BOOL "") set(LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXXABI OFF CACHE BOOL "") set(LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS ON CACHE BOOL "") -set(CMAKE_C_COMPILER "${CHEERP_PREFIX}/bin/clang" CACHE STRING "") -set(CMAKE_CXX_COMPILER "${CHEERP_PREFIX}/bin/clang++" CACHE STRING "") -set(CMAKE_LINKER "${CHEERP_PREFIX}/bin/llvm-link" CACHE STRING "") -set(CMAKE_SYSTEM_NAME "Cheerp" CACHE INTERNAL "") -