diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 338b6bf..64855ab 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -7,8 +7,8 @@ on: jobs: - gnat_gprbuild: - name: GNAT Linux and GPRbuild + gnat: + name: GNAT Linux runs-on: ubuntu-20.04 steps: - name: Checkout Project @@ -38,14 +38,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # for GitHub CLI tool - - name: Build GPRbuild - run: ./anod build gprbuild -v --loglevel DEBUG --enable-cleanup - - - name: Package GPRbuild - run: ./anod build release_package --qualifier=package=gprbuild,do_gh_release -v --loglevel DEBUG - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # for GitHub CLI tool - - uses: actions/upload-artifact@v2 with: name: anod-artifacts @@ -60,19 +52,13 @@ jobs: - gnatcov: - name: GNATcov - needs: gnat_gprbuild + gprbuild_gnatcov: + name: GPRbuild and GNATcov runs-on: ubuntu-20.04 steps: - name: Checkout Project uses: actions/checkout@v2 - - uses: actions/download-artifact@v2 - with: - name: anod-artifacts - path: in_artifacts/ - - name: Set up Python uses: actions/setup-python@v2 with: @@ -83,6 +69,14 @@ jobs: python -m pip install --upgrade pip pip install e3-core==22.1.0 + - name: Build GPRbuild + run: ./anod build gprbuild -v --loglevel DEBUG --enable-cleanup + + - name: Package GPRbuild + run: ./anod build release_package --qualifier=package=gprbuild,do_gh_release -v --loglevel DEBUG + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # for GitHub CLI tool + - name: Build GNATcov run: ./anod build gnatcov -v --loglevel DEBUG --enable-cleanup @@ -104,7 +98,7 @@ jobs: matrix: target: ["arm-elf", "riscv64-elf", "avr-elf"] name: GNAT ${{ matrix.target }}-linux - needs: gnat_gprbuild + needs: gnat runs-on: ubuntu-20.04 steps: - name: Checkout Project @@ -155,7 +149,7 @@ jobs: uses: actions/checkout@v2 with: repository: 'adacore/why3' - ref: 'fsf-13' + ref: 'fsf-14' - name: Use Setup OCaml {{ matrix.ocaml-version }} uses: ocaml/setup-ocaml@v2 @@ -193,7 +187,7 @@ jobs: uses: actions/checkout@v2 with: repository: 'adacore/alt-ergo' - ref: 'master' + ref: 'fsf-14' - name: Use Setup OCaml {{ matrix.ocaml-version }} uses: ocaml/setup-ocaml@v2 diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index bc14613..259a4c4 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -7,8 +7,8 @@ on: jobs: - gnat_gprbuild: - name: GNAT macOS and GPRbuild + gnat: + name: GNAT macOS runs-on: macos-12 steps: - name: Checkout Project @@ -35,14 +35,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # for GitHub CLI tool - - name: Build GPRbuild - run: ./anod build gprbuild -v --loglevel DEBUG --enable-cleanup - - - name: Package GPRbuild - run: ./anod build release_package --qualifier=package=gprbuild,do_gh_release -v --loglevel DEBUG - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # for GitHub CLI tool - - uses: actions/upload-artifact@v2 with: name: anod-artifacts @@ -56,20 +48,13 @@ jobs: retention-days: 5 - - gnatcov: - name: GNATcov - needs: gnat_gprbuild + gprbuild_gnatcov: + name: GPRbuild and GNATcov runs-on: macos-12 steps: - name: Checkout Project uses: actions/checkout@v2 - - uses: actions/download-artifact@v2 - with: - name: anod-artifacts - path: in_artifacts/ - - name: Set up Python uses: actions/setup-python@v2 with: @@ -80,6 +65,15 @@ jobs: python -m pip install --upgrade pip pip install e3-core==22.1.0 + - name: Build GPRbuild + run: ./anod build gprbuild -v --loglevel DEBUG --enable-cleanup + + - name: Package GPRbuild + run: ./anod build release_package --qualifier=package=gprbuild,do_gh_release -v --loglevel DEBUG + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # for GitHub CLI tool + + - name: Build GNATcov run: ./anod build gnatcov -v --loglevel DEBUG --enable-cleanup @@ -101,7 +95,7 @@ jobs: matrix: target: ["arm-elf", "riscv64-elf", "avr-elf"] name: GNAT ${{ matrix.target }}-darwin - needs: gnat_gprbuild + needs: gnat runs-on: macos-12 steps: - name: Checkout Project @@ -151,7 +145,7 @@ jobs: uses: actions/checkout@v2 with: repository: 'adacore/why3' - ref: 'fsf-13' + ref: 'fsf-14' - name: Use Setup OCaml {{ matrix.ocaml-version }} uses: ocaml/setup-ocaml@v2 @@ -190,7 +184,7 @@ jobs: uses: actions/checkout@v2 with: repository: 'adacore/alt-ergo' - ref: 'master' + ref: 'fsf-14' - name: Use Setup OCaml {{ matrix.ocaml-version }} uses: ocaml/setup-ocaml@v2 diff --git a/.github/workflows/macos_arm.yml b/.github/workflows/macos_arm.yml index 48c15a4..0f09772 100644 --- a/.github/workflows/macos_arm.yml +++ b/.github/workflows/macos_arm.yml @@ -4,10 +4,13 @@ on: workflow_dispatch: jobs: - gnat_gprbuild: + gnat: name: GNAT macOS runs-on: macos-14 steps: + - name: Set Xcode 15.3 + run: sudo xcode-select --switch /Applications/Xcode_15.3.app + - name: Checkout Project uses: actions/checkout@v2 @@ -35,14 +38,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # for GitHub CLI tool - - name: Build GPRbuild - run: ./anod build gprbuild -v --loglevel DEBUG --enable-cleanup - - - name: Package GPRbuild - run: ./anod build release_package --qualifier=package=gprbuild,do_gh_release -v --loglevel DEBUG - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # for GitHub CLI tool - - uses: actions/upload-artifact@v2 with: name: anod-artifacts @@ -55,20 +50,65 @@ jobs: path: sbx/*/release_package*/install/* retention-days: 5 + gnat_cross: + strategy: + matrix: + target: ["arm-elf", "riscv64-elf", "avr-elf"] + name: GNAT ${{ matrix.target }}-darwin + needs: gnat + runs-on: macos-14 + steps: + - name: Set Xcode 15.3 + run: sudo xcode-select --switch /Applications/Xcode_15.3.app + + - name: Checkout Project + uses: actions/checkout@v2 + + - uses: actions/download-artifact@v2 + with: + name: anod-artifacts + path: in_artifacts/ + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip + pip install e3-core==22.1.0 + + - name: Build GNAT ${{ matrix.target }} + run: ./anod build gcc -v --loglevel DEBUG --target=${{ matrix.target }} --enable-cleanup + + - name: Build GDB ${{ matrix.target }} + run: ./anod build gdb -v --loglevel DEBUG --target=${{ matrix.target }} --enable-cleanup + + - name: Package GNAT ${{ matrix.target }} + run: ./anod build release_package --qualifier=package=gnat,do_gh_release --target=${{ matrix.target }} -v --loglevel DEBUG + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # for GitHub CLI tool + + - uses: actions/upload-artifact@v2 + with: + name: release-packages + path: sbx/*/release_package*/install/* + retention-days: 5 why3: strategy: matrix: ocaml-compiler: - - 4.12.1 + - 4.11.2 runs-on: macos-14 steps: - name: Checkout code uses: actions/checkout@v2 with: repository: 'adacore/why3' - ref: 'fsf-13' + ref: 'fsf-14' - name: Use Setup OCaml {{ matrix.ocaml-version }} uses: ocaml/setup-ocaml@v2 @@ -99,7 +139,7 @@ jobs: strategy: matrix: ocaml-compiler: - - 4.12.1 + - "4.11.2" runs-on: macos-14 steps: @@ -107,7 +147,7 @@ jobs: uses: actions/checkout@v2 with: repository: 'adacore/alt-ergo' - ref: 'master' + ref: 'fsf-14' - name: Use Setup OCaml {{ matrix.ocaml-version }} uses: ocaml/setup-ocaml@v2 @@ -134,6 +174,9 @@ jobs: - name: Checkout Project uses: actions/checkout@v2 + - name: Set Xcode 15.3 + run: sudo xcode-select --switch /Applications/Xcode_15.3.app + - uses: actions/download-artifact@v2 with: name: alt-ergo diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 92de1fb..da0c97b 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -6,8 +6,8 @@ on: pull_request: jobs: - gnat_gprbuild: - name: GNAT Windows and gprbuild + gnat: + name: GNAT Windows runs-on: windows-2019 env: CONFIG_SHELL: /bin/bash @@ -49,14 +49,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # for GitHub CLI tool - - name: Build GPRbuild - run: mount C:/aaa /aaa && cd /aaa/GNAT-FSF-builds && python3 ./anod build gprbuild -v --loglevel DEBUG --enable-cleanup - - - name: Package GPRbuild - run: mount C:/aaa /aaa && cd /aaa/GNAT-FSF-builds && python3 ./anod build release_package --qualifier=package=gprbuild,do_gh_release -v --loglevel DEBUG - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # for GitHub CLI tool - - uses: actions/upload-artifact@v2 with: name: anod-artifacts @@ -71,9 +63,8 @@ jobs: - gnatcov: - name: GNATcov - needs: gnat_gprbuild + gprbuild_gnatcov: + name: GPRbuild and GNATcov runs-on: windows-2019 env: CONFIG_SHELL: /bin/bash @@ -104,10 +95,14 @@ jobs: # We need a path that is compatible between Windows and Unix world run: df -h; mkdir /c/aaa; mount C:/aaa /aaa ; cd ..; cp -r GNAT-FSF-builds /c/aaa - - uses: actions/download-artifact@v2 - with: - name: anod-artifacts - path: C:/aaa/GNAT-FSF-builds/in_artifacts/ + + - name: Build GPRbuild + run: mount C:/aaa /aaa && cd /aaa/GNAT-FSF-builds && python3 ./anod build gprbuild -v --loglevel DEBUG --enable-cleanup + + - name: Package GPRbuild + run: mount C:/aaa /aaa && cd /aaa/GNAT-FSF-builds && python3 ./anod build release_package --qualifier=package=gprbuild,do_gh_release -v --loglevel DEBUG + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # for GitHub CLI tool - name: Build GNATcov @@ -134,7 +129,7 @@ jobs: matrix: target: ["arm-elf", "riscv64-elf", "avr-elf"] name: GNAT ${{ matrix.target }}-windows - needs: gnat_gprbuild + needs: gnat runs-on: windows-2019 env: CONFIG_SHELL: /bin/bash @@ -200,7 +195,7 @@ jobs: uses: actions/checkout@v2 with: repository: 'adacore/why3' - ref: 'fsf-13' + ref: 'fsf-14' - name: Use Setup OCaml v1 ${{ matrix.ocaml-version }} uses: ocaml/setup-ocaml@v2 @@ -238,7 +233,7 @@ jobs: uses: actions/checkout@v2 with: repository: 'adacore/alt-ergo' - ref: 'master' + ref: 'fsf-14' - name: Use Setup OCaml {{ matrix.ocaml-version }} uses: ocaml/setup-ocaml@v2 diff --git a/specs/adasat.anod b/specs/adasat.anod new file mode 100644 index 0000000..4bdecfc --- /dev/null +++ b/specs/adasat.anod @@ -0,0 +1,71 @@ +from e3.anod.spec import Anod +from e3.anod.loader import spec + +import os + + +class AdaSAT(spec("common")): + @property + def version(self): + return "24.0.0" + + @property + def tarball(self): + return "adasat-%s.tar.gz" % self.version + + @property + def source_pkg_build(self): + return [ + self.HTTPSSourceBuilder( + name=self.tarball, + url="https://github.com/AdaCore/AdaSAT/archive/v%s.tar.gz" + % self.version, + ) + ] + + @property + def build_source_list(self): + return [Anod.Source(name=self.tarball, publish=True, dest="")] + + @property + def build_deps(self): + return [ + Anod.Dependency("base_gcc", track=True), + Anod.Dependency("gprbuild", track=True), + ] + + @Anod.primitive() + def build(self): + for m in self.deps: + self.deps[m].setenv() + + gpr_file = os.path.join(self["SRC_DIR"], "adasat.gpr") + build_mode = "prod" + + for library_type in ["static"]: + self.shell( + "gprbuild", + "-p", + "-P", + gpr_file, + "-j" + str(self.jobs), + "--relocate-build-tree=" + library_type, + "-XADASAT_BUILD_MODE=" + build_mode, + "-XADASAT_LIBRARY_TYPE=" + library_type, + ) + + self.shell( + "gprinstall", + "-f", + "-p", + "-P", + gpr_file, + "--relocate-build-tree=" + library_type, + "--prefix=" + self["INSTALL_DIR"], + "-XADASAT_BUILD_MODE=" + build_mode, + "-XADASAT_LIBRARY_TYPE=" + library_type, + "--build-var=LIBRARY_TYPE", + "--build-name=" + library_type, + ) + + self.clean() diff --git a/specs/base_gcc.anod b/specs/base_gcc.anod index 27b5938..a931fe5 100644 --- a/specs/base_gcc.anod +++ b/specs/base_gcc.anod @@ -8,7 +8,7 @@ from e3.anod.spec import Anod class base_gcc(spec("common")): @property def version(self): - return "13.2.0-2" + return "14.1.0-3" @property def tarball(self): @@ -25,7 +25,7 @@ class base_gcc(spec("common")): with HTTPSession() as http: http.download_file(self.url, self["BUILD_DIR"], self.tarball) - # Exctract the archive + # Extract the archive unpack_archive(self.tarball, self["INSTALL_DIR"], remove_root_dir=True) # Delete the archive diff --git a/specs/binutils.anod b/specs/binutils.anod index 5f649ff..c74f986 100644 --- a/specs/binutils.anod +++ b/specs/binutils.anod @@ -39,16 +39,6 @@ class Binutils(spec("common")): Anod.Dependency("isl", target="host"), ] - if self.env.is_canadian: - deps.append( - Anod.Dependency( - name="gcc", - host="build", - target="host", - local_name="canadian-cross-compiler", - ) - ) - return deps def merge(self, prefix): diff --git a/specs/common.anod b/specs/common.anod index aa6eae4..8684842 100644 --- a/specs/common.anod +++ b/specs/common.anod @@ -104,3 +104,7 @@ class Common(Anod): if Env().main_options.enable_cleanup: rm(self["BUILD_DIR"], recursive=True) rm(self["SRC_DIR"], recursive=True) + + @property + def host_is_macos_arm(self): + return self.env.host.os.name == "darwin" and self.env.host.cpu.name == "aarch64" diff --git a/specs/embedded-runtimes.anod b/specs/embedded-runtimes.anod index a90c88a..aa5ca9d 100644 --- a/specs/embedded-runtimes.anod +++ b/specs/embedded-runtimes.anod @@ -12,7 +12,7 @@ class EmbeddedRuntimes(spec("common")): @property def commit_id(self): - return "4386b1dcd0e995ac9b9e1b221cf386238d3c1537" + return "e59080e0c4b49d12e00538595052dea2dceb5a6e" @property def tarball(self): diff --git a/specs/gcc.anod b/specs/gcc.anod index da4ae76..eb8b805 100644 --- a/specs/gcc.anod +++ b/specs/gcc.anod @@ -27,10 +27,10 @@ class GCC(spec("gh-artifact")): url=( "https://ftp.gnu.org/gnu/gcc/gcc-%s/%s" % (self.version, self.tarball) - if self.env.target.cpu.name == "x86_64" + if not self.host_is_macos_arm else "https://github.com/iains/gcc-14-branch/archive/refs/" - + "tags/gcc-14.1-darwin-r0.tar.gz" + + "tags/gcc-14.1-darwin-r1.tar.gz" ) ), self.LocalSourceBuilder(name=patch_name) @@ -140,10 +140,6 @@ class GCC(spec("gh-artifact")): args.append("--disable-libcilkrts") - # Workaround for Xcode 12.5 bug on Intel - # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100340 - args.append("--without-build-config") - xcode = "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" clu = "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" diff --git a/specs/gdb.anod b/specs/gdb.anod index 8d15431..5794db1 100644 --- a/specs/gdb.anod +++ b/specs/gdb.anod @@ -38,7 +38,7 @@ class GDB(spec("common")): @property def build_deps(self): deps = [ - Anod.Dependency("gcc", target="host"), + Anod.Dependency("base_gcc", target="host"), Anod.Dependency("mpfr", target="host"), Anod.Dependency("mpc", target="host"), Anod.Dependency("gmp", target="host"), @@ -91,6 +91,7 @@ class GDB(spec("common")): "--with-gmp=%s" % unixpath(self.deps["gmp"]["INSTALL_DIR"]), "--with-libgmp=%s" % unixpath(self.deps["gmp"]["INSTALL_DIR"]), "--with-mpc=%s" % unixpath(self.deps["mpc"]["INSTALL_DIR"]), + "--with-python=no" ) if self.env.host.os.name == "windows": diff --git a/specs/gnatcoll-bindings.anod b/specs/gnatcoll-bindings.anod index bf428f1..8fe4422 100644 --- a/specs/gnatcoll-bindings.anod +++ b/specs/gnatcoll-bindings.anod @@ -56,6 +56,7 @@ class GNATcollBindings(spec("common")): "build", "--jobs=" + str(self.jobs), "--reconfigure", + "--library-types", "static", ) self.shell( diff --git a/specs/gnatcov.anod b/specs/gnatcov.anod index ae95d7b..aaeb7c0 100644 --- a/specs/gnatcov.anod +++ b/specs/gnatcov.anod @@ -40,7 +40,7 @@ class GNATcov(spec("common")): @property def build_deps(self): deps = [ - Anod.Dependency("gcc", track=True), + Anod.Dependency("base_gcc", track=True), Anod.Dependency("gprbuild", track=True), Anod.Dependency("libgpr", track=True), Anod.Dependency("gnatcoll", track=True), diff --git a/specs/gnatutil.anod b/specs/gnatutil.anod index dc2ae35..e24f552 100644 --- a/specs/gnatutil.anod +++ b/specs/gnatutil.anod @@ -25,7 +25,7 @@ class GNATUTIL(spec("common")): @property def build_deps(self): return [ - Anod.Dependency("gcc", track=True), + Anod.Dependency("base_gcc", track=True), Anod.Dependency("gprbuild", track=True), ] diff --git a/specs/gnu.anod b/specs/gnu.anod index 0ea82f9..06191d1 100644 --- a/specs/gnu.anod +++ b/specs/gnu.anod @@ -1,6 +1,7 @@ from e3.anod.error import ShellError from e3.anod.spec import Anod from e3.anod.loader import spec +from e3.fs import mkdir, sync_tree import os @@ -20,6 +21,9 @@ class GNU(spec("gh-artifact")): self.env.add_search_path( "LIBRARY_PATH", os.path.join(self["INSTALL_DIR"], "lib") ) + self.env.add_search_path( + "LIBRARY_PATH", os.path.join(self["INSTALL_DIR"], "lib64") + ) def artifact_build(self): # This spec inherit from gh-artifact and therefore has a different @@ -37,4 +41,19 @@ class GNU(spec("gh-artifact")): # Many projects fail when running `make install` with parallel jobs self["make"]("install", jobs=1) + lib_dir = os.path.join(self["INSTALL_DIR"], "lib") + lib64_dir = os.path.join(self["INSTALL_DIR"], "lib64") + if self.env.target.platform == "x86_64-linux": + # On some old x86_64-linux system gcc might changes drastically + # LIBRARY_PATH. For example if this var is set to /mydir/lib:/lib + # gcc might call ld with + # /mydir/lib/../lib64:/lib/../lib64:/mydir/lib:/lib + # The consequence is that sometimes we might pick the library from + # the system instead of the recently built one. So, make sure to + # provide lib64 as well as lib. + + if os.path.isdir(lib_dir) and not os.path.isdir(lib64_dir): + mkdir(lib64_dir) + sync_tree(lib_dir, lib64_dir) + self.clean() diff --git a/specs/gprconfig_kb.anod b/specs/gprconfig_kb.anod index 9380520..16d9a14 100644 --- a/specs/gprconfig_kb.anod +++ b/specs/gprconfig_kb.anod @@ -5,7 +5,7 @@ from e3.anod.loader import spec class GPRconfig_KB(spec("common")): @property def version(self): - return "23.0.0" + return "24.0.0" @property def tarball(self): diff --git a/specs/langkit.anod b/specs/langkit_support.anod similarity index 89% rename from specs/langkit.anod rename to specs/langkit_support.anod index ba70859..c37b7e0 100644 --- a/specs/langkit.anod +++ b/specs/langkit_support.anod @@ -4,14 +4,14 @@ from e3.anod.loader import spec import os -class Langkit(spec("common")): +class LangkikSupport(spec("common")): @property def version(self): - return "22.0.0" + return "24.0.0" @property def tarball(self): - return "langkit-%s.tar.gz" % self.version + return "langkit_support-%s.tar.gz" % self.version @property def source_pkg_build(self): @@ -30,12 +30,13 @@ class Langkit(spec("common")): @property def build_deps(self): return [ - Anod.Dependency("gcc", track=True), + Anod.Dependency("base_gcc", track=True), Anod.Dependency("gprbuild", track=True), Anod.Dependency("libgpr", track=True), Anod.Dependency("gnatcoll", track=True), Anod.Dependency("gnatcoll-bindings", track=True), Anod.Dependency("xmlada", track=True), + Anod.Dependency("adasat", track=True), ] @Anod.primitive() diff --git a/specs/libadalang.anod b/specs/libadalang.anod index cd1e5fd..d328e3a 100644 --- a/specs/libadalang.anod +++ b/specs/libadalang.anod @@ -4,10 +4,10 @@ from e3.anod.loader import spec import os -class Langkit(spec("common")): +class Libadalang(spec("common")): @property def version(self): - return "22.0.0" + return "24.0.0" @property def tarball(self): @@ -30,12 +30,14 @@ class Langkit(spec("common")): @property def build_deps(self): return [ - Anod.Dependency("gcc", track=True), + Anod.Dependency("base_gcc", track=True), Anod.Dependency("gprbuild", track=True), Anod.Dependency("libgpr", track=True), + Anod.Dependency("adasat", track=True), + Anod.Dependency("libgpr2"), Anod.Dependency("gnatcoll", track=True), Anod.Dependency("gnatcoll-bindings", track=True), - Anod.Dependency("langkit", track=True), + Anod.Dependency("langkit_support", track=True), Anod.Dependency("xmlada", track=True), ] diff --git a/specs/libgpr2.anod b/specs/libgpr2.anod new file mode 100644 index 0000000..830326f --- /dev/null +++ b/specs/libgpr2.anod @@ -0,0 +1,139 @@ +from e3.os.fs import touch +from e3.anod.helper import Make, text_replace +from e3.anod.spec import Anod +from e3.anod.loader import spec +from e3.fs import cp, sync_tree +from e3.diff import patch +import os +from datetime import date + +class LibGPR2(spec("common")): + + @property + def is_next(self): + return 'next' in self.parsed_qualifier + + @property + def version(self): + if self.is_next: + return "24.2.0-next" + else: + return "24.0.0" + + @property + def lk_version(self): + return "24.0.0" + + @property + def tarball(self): + return "gpr-%s.tar.gz" % self.version + + @property + def lk_tarball(self): + return "langkit-py-%s.tar.gz" % self.lk_version + + @property + def build_space_name(self): + if self.is_next: + return "%s-next" % (self.name) + else: + return self.name + + @property + def source_pkg_build(self): + return [ + self.HTTPSSourceBuilder( + name=self.tarball, + url="https://github.com/AdaCore/gpr/archive/v%s.tar.gz" + % ( self.version), + ), + self.HTTPSSourceBuilder( + name=self.lk_tarball, + url="https://github.com/AdaCore/langkit/archive/v%s.tar.gz" + % self.lk_version, + ) + ] + + @property + def build_source_list(self): + return [ + Anod.Source(name=self.tarball, publish=True, dest=""), + Anod.Source(name=self.lk_tarball, publish=True, dest="langkit_src"), + Anod.Source(name=self.deps["gprconfig_kb"].tarball, publish=True, + dest="gprconfig_kb", + ), + ] + + @property + def build_deps(self): + return [ + Anod.Dependency("base_gcc", track=True), + Anod.Dependency("gprbuild", track=True), + Anod.Dependency("libgpr", track=True), + Anod.Dependency("xmlada", track=True), + Anod.Dependency("gnatcoll", track=True), + Anod.Dependency("gnatcoll-bindings", track=True), + Anod.Dependency("langkit_support", track=True), + Anod.Dependency("gprconfig_kb", require="source_pkg", track=True), + ] + + def update_version(self): + text_replace( + os.path.join(self["SRC_DIR"], "src", "lib", "gpr2-version.ads"), + [ + ( + "Build_Type : constant GNAT_Build_Type.*", + "Build_Type : constant GNAT_Build_Type := FSF;", + ), + ( + "Short_Value : constant String.*", + 'Short_Value : constant String := "%s";' % self.version, + ), + ( + "Date : constant String.*", + 'Date : constant String := "%s-gpr2";' % str(date.today()), + ), + ( + "Current_Year : constant String.*", + 'Current_Year : constant String := "%s";' % str(date.today().year), + ), + ], + ) + + @Anod.primitive() + def build(self): + for m in self.deps: + if m != "gprconfig_kb": + self.deps[m].setenv() + + self.update_version() + + # The SOURCE_DIR detection doesn't work on macOS, so we replace it with + # an absolute path. + print(os.path.join(self["SRC_DIR"], "Makefile")) + text_replace(os.path.join(self["SRC_DIR"], "Makefile"), + [("SOURCE_DIR := .*", + "SOURCE_DIR := " + self["SRC_DIR"])]) + + self.env.add_search_path("PYTHONPATH", os.path.join(self["SRC_DIR"], "langkit_src")) + + make = Make(self, + makefile=os.path.join(self["SRC_DIR"], "Makefile"), + exec_dir=self["BUILD_DIR"], + jobs=1) + + make.set_var("prefix", self["INSTALL_DIR"]) + make.set_var("GPR2_BUILD", "release") + make.set_var("FORCE_PARSER_GEN", "force") + make.set_var("GPR2KBDIR", os.path.join(self["SRC_DIR"], "gprconfig_kb", "db")) + + for build_kind in ["static"]: + make("build-lib-%s" % build_kind) + make("install-lib-%s" % build_kind) + sync_tree( + os.path.join(self["SRC_DIR"], "examples"), + os.path.join(self["INSTALL_DIR"], "share", "examples", "gpr2"), + delete=True, + ) + + self.clean() diff --git a/specs/libiconv.anod b/specs/libiconv.anod index b43cfa7..8ca7e3a 100644 --- a/specs/libiconv.anod +++ b/specs/libiconv.anod @@ -30,7 +30,7 @@ class LibIconv(spec("common")): @property def build_deps(self): - return [Anod.Dependency("gcc")] + return [Anod.Dependency("base_gcc")] def setenv(self): self.env.add_search_path( @@ -47,7 +47,8 @@ class LibIconv(spec("common")): configure = Configure(self) configure.add("--prefix=%s" % unixpath(self["INSTALL_DIR"])) - configure.add("--enable-static") + configure.add("--enable-static=yes") + configure.add("--enable-shared=no") configure.add("--enable-extra-encodings") configure.add("--disable-rpath") configure.add("--enable-silent-rules") diff --git a/specs/release_package.anod b/specs/release_package.anod index fc46f1c..0e2925c 100644 --- a/specs/release_package.anod +++ b/specs/release_package.anod @@ -54,13 +54,13 @@ class ReleasePackage(spec("common")): return "1" elif package == "gnat": if self.env.target.triplet == "arm-eabi": - return "2" + return "3" elif self.env.target.triplet == "riscv64-elf": - return "2" + return "3" elif self.env.target.triplet == "avr-elf": - return "2" + return "3" else: - return "2" + return "3" @property def release_name(self): diff --git a/specs/spark2014.anod b/specs/spark2014.anod index f12392b..b2ead9d 100644 --- a/specs/spark2014.anod +++ b/specs/spark2014.anod @@ -10,7 +10,7 @@ import os class SPARK2014(spec("common")): @property def version(self): - return "13.2.0" + return "14.1.0" @property def tarball(self): @@ -28,29 +28,33 @@ class SPARK2014(spec("common")): return "gcc-%s.tar.gz" % self.version @property - def cvc5_binary(self): + def sparklib_tarball(self): + return "sparkib-%s.tar.gz" % self.version + + @property + def cvc5_zip(self): if self.env.host.os.name == "windows": - fn = "cvc5-Win64.exe" + fn = "cvc5-Win64-static.zip" elif self.env.host.os.name == "darwin" and \ self.env.target.cpu.name == "x86_64": - fn = "cvc5-macOS" + fn = "cvc5-macOS-static.zip" elif self.env.host.os.name == "darwin": - fn = "cvc5-macOS-arm64" + fn = "cvc5-macOS-arm64-static.zip" else: - fn = "cvc5-linux" + fn = "cvc5-linux-static.zip" return fn @property def z3_zip(self): if self.env.host.os.name == "windows": - fn = "z3-4.12.2-x64-win.zip" + fn = "z3-4.13.0-x64-win.zip" elif self.env.host.os.name == "darwin" and \ self.env.target.cpu.name == "x86_64": - fn = "z3-4.12.2-x64-osx-10.16.zip" + fn = "z3-4.13.0-x64-osx-11.7.10.zip" elif self.env.host.os.name == "darwin": - fn = "z3-4.12.2-arm64-osx-11.0.zip" + fn = "z3-4.13.0-arm64-osx-11.0.zip" else: - fn = "z3-4.12.2-x64-glibc-2.31.zip" + fn = "z3-4.13.0-x64-glibc-2.31.zip" return fn @property @@ -63,16 +67,20 @@ class SPARK2014(spec("common")): ), self.HTTPSSourceBuilder( name=self.tarball, - url="https://github.com/adacore/spark2014/tarball/fsf-13", + url="https://github.com/adacore/spark2014/tarball/fsf-14", + ), + self.HTTPSSourceBuilder( + name=self.sparklib_tarball, + url="https://github.com/adacore/sparklib/tarball/d4f3dc1c6c8ce441472b1bd5df00777eec799eb2", ), self.HTTPSSourceBuilder( - name=self.cvc5_binary, - url="https://github.com/cvc5/cvc5/releases/download/cvc5-1.0.5/%s" - % self.cvc5_binary, + name=self.cvc5_zip, + url="https://github.com/cvc5/cvc5/releases/download/cvc5-1.1.2/%s" + % self.cvc5_zip, ), self.HTTPSSourceBuilder( name=self.z3_zip, - url="https://github.com/Z3Prover/z3/releases/download/z3-4.12.2/%s" + url="https://github.com/Z3Prover/z3/releases/download/z3-4.13.0/%s" % self.z3_zip, ), ] @@ -82,9 +90,8 @@ class SPARK2014(spec("common")): return [ Anod.Source(name=self.tarball, publish=True, dest=""), Anod.Source(name=self.gcc_tarball, publish=True, dest="gcc"), - Anod.Source( - name=self.cvc5_binary, publish=True, unpack_cmd=cp, dest="cvc5" - ), + Anod.Source(name=self.sparklib_tarball, publish=True, dest="include"), + Anod.Source(name=self.cvc5_zip, publish=True, dest="cvc5"), Anod.Source(name=self.z3_zip, publish=True, dest="z3"), ] @@ -96,12 +103,24 @@ class SPARK2014(spec("common")): Anod.Dependency("base_gcc"), Anod.Dependency("why3"), Anod.Dependency("alt-ergo"), - Anod.Dependency("gmp", qualifier="shared_lib"), + Anod.Dependency("gmp"), + Anod.Dependency("gmp", + qualifier="shared_lib", + local_name="gmp_shared"), Anod.Dependency("gprbuild"), Anod.Dependency("gnatcoll"), + Anod.Dependency("gnatcoll-bindings"), Anod.Dependency("xmlada"), + Anod.Dependency("libgpr2", qualifier="next"), Anod.Dependency("libgpr"), + Anod.Dependency("langkit_support"), + Anod.Dependency("adasat", track=True), + Anod.Dependency("libadalang"), ] + + if self.env.target.os.name == "windows": + deps.append(Anod.Dependency("libiconv")) + return deps @Anod.primitive() @@ -117,7 +136,8 @@ class SPARK2014(spec("common")): jobs=self.jobs ) for dep in self.deps: - self.deps[dep].setenv() + if dep not in ["gmp_shared"]: + self.deps[dep].setenv() make("all-nightly", jobs=1) self.install() @@ -145,7 +165,6 @@ class SPARK2014(spec("common")): if ( not os.path.basename(f).startswith("gnatbind") and not os.path.basename(f).startswith("gnatls") - and not os.path.basename(f).startswith("gnat_server") and not os.path.basename(f).startswith("gnatwhy3") ): rm(f) @@ -153,15 +172,10 @@ class SPARK2014(spec("common")): sync_tree(self.deps["why3"]["INSTALL_DIR"], libexec_spark, delete=False) sync_tree(self.deps["alt-ergo"]["INSTALL_DIR"], libexec_spark, delete=False) sync_tree(self.deps["gprbuild"]["INSTALL_DIR"], libexec_spark, delete=False) - sync_tree(self.deps["gmp"]["INSTALL_DIR"], libexec_spark, delete=False) + sync_tree(self.deps["gmp_shared"]["INSTALL_DIR"], libexec_spark, delete=False) sync_tree(os.path.join(self["SRC_DIR"], "z3"), libexec_spark, delete=False) - cvc5_binary_name = "cvc5.exe" if self.env.host.os.name == "windows" else "cvc5" - cvc5_binary_name = os.path.join(libexec_spark_bin, cvc5_binary_name) - cp( - os.path.join(self["SRC_DIR"], "cvc5", self.cvc5_binary), - cvc5_binary_name - ) + sync_tree(os.path.join(self["SRC_DIR"], "cvc5"), libexec_spark, delete=False) for fn in [ "gnat2why", @@ -182,7 +196,7 @@ class SPARK2014(spec("common")): for dir in ["alt-ergo", "alt-ergo-lib", "alt-ergo-parsers"]: rm(os.path.join(libexec_spark, "lib", dir), True) - for exe in ["cvc5", "gnat_server", "gnatwhy3", "alt-ergo"]: + for exe in ["cvc5", "gnatwhy3", "alt-ergo"]: chmod("a+x", os.path.join(libexec_spark_bin, (exe + (".exe" if self.env.host.os.name == "windows" diff --git a/utils/gen_gnat_manifests.py b/utils/gen_gnat_manifests.py index f67fa91..84ba17f 100755 --- a/utils/gen_gnat_manifests.py +++ b/utils/gen_gnat_manifests.py @@ -7,8 +7,8 @@ import os import shutil -PKG_VERSION = "13.2.0-1" -CRATE_VERSION = "13.2.1" +PKG_VERSION = "14.1.0-3" +CRATE_VERSION = "14.1.3" targets = { "x86_64": {"crate": "gnat_native", "description": "Native"}, @@ -69,6 +69,31 @@ def check_sha256(package): windows_sha256 = check_sha256(windows_package) macos_sha256 = check_sha256(macos_package) + if target == "x86_64": + environment = """ +[environment."case(os)".linux."case(host-arch)".x86-64] +PATH.prepend = "${CRATE_ROOT}/bin" +LIBRARY_PATH.prepend = "${CRATE_ROOT}/lib64" +LD_LIBRARY_PATH.prepend = "${CRATE_ROOT}/lib64" +LD_RUN_PATH.prepend = "${CRATE_ROOT}/lib64" + +[environment."case(os)".windows."case(host-arch)".x86-64] +PATH.prepend = "${CRATE_ROOT}/bin" +LIBRARY_PATH.prepend = "${CRATE_ROOT}/lib" +LD_LIBRARY_PATH.prepend = "${CRATE_ROOT}/lib" +LD_RUN_PATH.prepend = "${CRATE_ROOT}/lib" + +[environment."case(os)".macos."case(host-arch)".x86-64] +PATH.prepend = "${CRATE_ROOT}/bin" +LIBRARY_PATH.prepend = "${CRATE_ROOT}/lib" +LD_LIBRARY_PATH.prepend = "${CRATE_ROOT}/lib" +LD_RUN_PATH.prepend = "${CRATE_ROOT}/lib" +""" + else: + environment = """ +[environment] +PATH.prepend = "${CRATE_ROOT}/bin" +""" MANIFEST_CONTENT = f""" name = "{CRATE}" version = "{CRATE_VERSION}" @@ -82,19 +107,19 @@ def check_sha256(package): [configuration] disabled = true - -[environment] -PATH.prepend = "${{CRATE_ROOT}}/bin" - +{environment} [origin."case(os)".linux."case(host-arch)".x86-64] +binary = true url = "https://github.com/alire-project/GNAT-FSF-builds/releases/download/gnat-{PKG_VERSION}/{linux_package}" hashes = ["sha256:{linux_sha256}"] [origin."case(os)".windows."case(host-arch)".x86-64] +binary = true url = "https://github.com/alire-project/GNAT-FSF-builds/releases/download/gnat-{PKG_VERSION}/{windows_package}" hashes = ["sha256:{windows_sha256}"] [origin."case(os)".macos."case(host-arch)".x86-64] +binary = true url = "https://github.com/alire-project/GNAT-FSF-builds/releases/download/gnat-{PKG_VERSION}/{macos_package}" hashes = ["sha256:{macos_sha256}"] """