From b340771cb8663507809d607ee99e546c020440a6 Mon Sep 17 00:00:00 2001 From: Liviu Ionescu Date: Sat, 24 Oct 2020 17:46:25 +0300 Subject: [PATCH] prepare for 8.3.0-2.3, with embedded Python 3 --- CHANGELOG.md | 4 + README-BUILD.md | 386 ++++---------- README-DEVELOP.md | 0 README-RELEASE.md | 585 ++++++++++++++++++--- README.md | 4 +- patches/python37-config.sh | 4 +- scripts/VERSION | 2 +- scripts/common-functions-source.sh | 3 - scripts/common-versions-source.sh | 96 ++-- scripts/container-apps-functions-source.sh | 84 +-- 10 files changed, 679 insertions(+), 489 deletions(-) create mode 100644 README-DEVELOP.md diff --git a/CHANGELOG.md b/CHANGELOG.md index c1bb1ce..c290e8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ Releases in reverse chronological order. +### 2020-10-24 + +- v8.3.0-2.3 prepared + ### 2020-10-13 - v8.3.0-2.2.1 published on npmjs.com diff --git a/README-BUILD.md b/README-BUILD.md index 06af142..76c9416 100644 --- a/README-BUILD.md +++ b/README-BUILD.md @@ -1,4 +1,4 @@ -# How to build the xPack GNU RISC-V Embedded GCC +# How to build the xPack GNU RISC-V Embedded GCC binaries ## Introduction @@ -49,6 +49,21 @@ original FSF repository is used: However, to accommodate the custom prefix, a separate branch is created in `xpack-dev-tools/riscv-binutils-gdb`. +## Branches + +- `xpack` - the updated content, used during builds +- `xpack-develop` - the updated content, used during development +- `master` - empty, not used. + +## Prerequisites + +The prerequisites are common to all binary builds. Please follow the +instructions from the separate +[Prerequisites for building xPack binaries](https://xpack.github.io/xbb/prerequisites/) +page and return when ready. + +Note: Building the Arm binaries requires an Arm machine. + ## Download the build scripts repo The build scripts are available in the `scripts` folder of the @@ -64,8 +79,8 @@ $ curl --fail -L https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/r This small script issues the following two commands: ```console -$ rm -rf ~/Downloads/riscv-none-embed-gcc-xpack.git -$ git clone --recurse-submodules https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack.git \ +$ rm -rf ~/Downloads/riscv-none-embed-gcc-xpack.git; \ + git clone --recurse-submodules https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack.git \ ~/Downloads/riscv-none-embed-gcc-xpack.git ``` @@ -82,8 +97,8 @@ $ curl --fail -L https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/r which is a shortcut for: ```console -$ rm -rf ~/Downloads/riscv-none-embed-gcc-xpack.git -$ git clone --recurse-submodules --branch xpack-develop https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack.git \ +$ rm -rf ~/Downloads/riscv-none-embed-gcc-xpack.git; \ + git clone --recurse-submodules --branch xpack-develop https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack.git \ ~/Downloads/riscv-none-embed-gcc-xpack.git ``` @@ -94,6 +109,15 @@ folder in the user home. Although not recommended, if for any reasons you need to change the location of the `Work` folder, you can redefine `WORK_FOLDER_PATH` variable before invoking the script. +## Spaces in folder names + +Due to the limitations of `make`, builds started in folders with +spaces in names are known to fail. + +If on your system the work folder is in such a location, redefine it in a +folder without spaces and set the `WORK_FOLDER_PATH` variable before invoking +the script. + ## Customizations There are many other settings that can be redefined via @@ -103,202 +127,33 @@ either passed to Docker or sourced to shell. The Docker syntax **is not** identical to shell, so some files may not be accepted by bash. -## Prerequisites - -The prerequisites are common to all binary builds. Please follow the -instructions from the separate -[Prerequisites for building xPack binaries](https://xpack.github.io/xbb/prerequisites/) -page and return when ready. - -## Prepare release - -### Check `README.md` - -Normally `README.md` should not need changes, but better check. -Information related to the new version should not be included here, -but in the version specific file (below). - -### Identify SiFive commit IDs - -- check the [SiFive Releases](https://github.com/sifive/freedom-tools/releases) -for new releases -- identify the tag of the latest release (like `v2019.08.0`) -- switch to Code view and select the tag -- open the `src` folder to identify the commit IDs used for the linked repos -- copy/paste the submodule links to common-versions-sources.sh -- get binutils version from binutils/CHANGELOG -- get gcc version from gcc/BASE_VER (gcc/ChangeLog) -- get newlib version from newlib/configure, VERSION= (newlib/README) -- get gdb version from gdb/VERSION.in (gdb/ChangeLog) - -### Identify the main GCC version - -Determine the GCC version (like `8.3.0`) and update the `scripts/VERSION` - file; the format is `8.3.0-2.2`. The fourth digit is the number of the - SiFive release of the same GCC version, and the fifth digit is the xPack - GNU RISC-V Embedded GCC release number of this version. +## Versioning -### Create `README-.md` +The version string is an extension to semver, the format looks like `8.3.0-2.3`. +It includes the three digits with the original GCC version, a fourth +digit with the SiFive release, a fifth digit with the xPack release number. -In the `scripts` folder create a copy of the previous version one. +When publishing on the **npmjs.com** server, a sixth digit is appended. -From the the `src` folder, follow the linked module links for -binutils/gcc/newlib and copy/paste them. -Also update the short IDs and dates. +## Changes -Check the GDB commit ID (not linked, since it points to external repo). +Compared to the original SiFive distribution, there should be no +major functional changes, perhaps only bug fixes. -### Update binutils +The actual changes for each version are documented in the corresponding +release pages: -With Sourcetree in -[xpack-dev-tools/riscv-binutils-gdb](https://github.com/xpack-dev-tools/riscv-binutils-gdb) +- https://xpack.github.io/arm-none-eabi-gcc/releases/ -Check if there is a `sifive` remote pointing to -https://github.com/sifive/riscv-binutils-gdb. +## How to build local/native binaries -If the changes apply to an existing branch: - -- checkout the current SiFive branch (like `sifive-binutils-2.32`) -- merge the commit with the desired ID from the corresponding branch in -the `sifive` remote -- checkout the corresponding xpack branch (like `sifive-binutils-2.32-xpack`) -- merge the previous merge -- check the differences from the non-xpack branch; it should be only the -addition of `embed)` in `config.sub` - -If the changes are on a new branch (most likely): - -- from the `sifive` remote -checkout the new SiFive branch (like `sifive-binutils-2.32`) into a new local -branch -- identify the commit ID and switch to it -- create a new branch with a similar name, but suffixed by `-xpack` -(like `sifive-binutils-2.32-xpack`) -- identify the commit which adds the xPack specific changes -- cherry pick it; do not commit immediately -- check the uncommited changes; there should be one file `config.sub` -which adds `-embed)` -- commit as **add support for riscv-none-embed-*** +### README-DEVELOP.md -In both cases: +The details on how to prepare the development environment for native build +are in the +[`README-DEVELOP.md`](https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/blob/xpack/README-DEVELOP.md) file. -- push the two modified branches (like `sifive-binutils-2.32` and -`sifive-binutils-2.32-xpack`) -- add a tag with the current version (like `v8.3.0-2.2`), and push -it to `origin` - -- copy/paste the branch name and commit id tp common-versions-source.sh - -### Update gcc - -With Sourcetree in -[xpack-dev-tools/riscv-gcc](https://github.com/xpack-dev-tools/riscv-gcc) - -Check if there is a `sifive` remote pointing to -https://github.com/sifive/riscv-gcc. - -If the changes apply to an existing branch: - -- checkout the current SiFive branch (like `sifive-gcc-8.3.0`) -- merge the commit with the desired ID from the corresponding branch in -the `sifive` remote -- checkout the corresponding xpack branch (like `sifive-gcc-8.3.0-xpack`) -- merge the previous merge -- check the differences from the non-xpack branch; there should be tree files: - - `elf-embed.h` with the `LIB_SPEC` definitions without libgloss - - `config.gcc` with `tm_file` definition that uses `elf-embed.h` - - `config.sub` which adds `riscv0*)` and `-embed)` - -If this is a new branch: - -- from the `sifive` remote -checkout the new SiFive branch (like `sifive-gcc-8.3.0`) into a new local -branch -- identify the commit ID and switch to it -- create a new branch with a similar name, but suffixed by `-xpack` -(like `sifive-gcc-8.3.0-xpack`) -- identify the commit which adds the xPaack specific changes -- cherry pick it; do not commit immediately -- check the uncommited changes; there should be tree files: - - `elf-embed.h` with the `LIB_SPEC` definitions without libgloss - - `config.gcc` with `tm_file` definition that uses `elf-embed.h` - - `config.sub` which adds `riscv0*)` and `-embed)` -- commit as **add support for riscv-none-embed-*** - -In both cases: - -- push the two modified branches (like `sifive-gcc-8.3.0` and -`sifive-gcc-8.3.0-xpack`) -- add a tag with the current version (like `v8.3.0-2.2`), and push -it to `origin`. - -### Update newlib - -With Sourcetree in -[xpack-dev-tools/riscv-newlib](https://github.com/xpack-dev-tools/riscv-newlib) - -Check if there is a `sifive` remote pointing to -https://github.com/sifive/riscv-newlib. - -If the changes apply to an existing branch: - -- checkout the current SiFive branch (like `master`) -- merge the commit with the desired ID from the corresponding branch in -the `sifive` remote -- checkout the corresponding xpack branch (like `sifive-binutils-2.32-xpack`) -- merge the previous merge -- check the differences from the non-xpack branch; it should be only the -addition of `embed)` in `config.sub` - -- from the `sifive` remote -checkout the new SiFive branch (like `master`) into a new local -branch (like `sifive-master`) -- identify the commit ID and switch to it -- create a new branch with a similar name, but suffixed by `-xpack` -(like `sifive-master-xpack`) -- identify the commit which adds the xPack specific changes -- cherry pick it; do not commit immediately -- check the uncommited changes; there should be one file `config.sub` -which adds `-embed)` -- commit as **add support for riscv-none-embed-*** - -In both cases: - -- push the two modified branches (like `sifive--master` and -`sifive--master-xpack`) -- add a tag with the current version (like `v8.3.0-2.2`), and push -it to `origin`. - -### Update gdb - -With Sourcetree in -[xpack-dev-tools/riscv-binutils-gdb](https://github.com/xpack-dev-tools/riscv-binutils-gdb) - -Check if there is a `gdb` remote pointing to -git://sourceware.org/git/binutils-gdb.git. - -For GDB, it is a bit tricky, since it must identify the GNU code in line -with what was used by SiFive; create a branch like `sifive-gdb-8.3` - -- branch it into `sifive-gdb-8.3-xpack` and edit the prefix code -- add a tag like `v8.3.0-2.2-gdb` - -### Update container-build.sh - -- add a new set of definitions in the `scripts/container-build.sh`, with - the versions of various components; -- update `GH_RELEASE` to the new version (like `8.3.0-2.2`, without `v`) -- in [SiFive Releases](https://github.com/sifive/freedom-tools/releases) -for new releases -- identify the tag of the latest release (like `v2019.08.0`) -- switch to Code view and select the tag -- open the `Makefile` file to identify the `MULTILIBS_GEN` definition; -- copy/paste it into `GCC_MULTILIB` (mind the tabs!) -- add `rv32imaf-ilp32f--` after `rv32imf-` (already in for recent versions) - -## Update `CHANGELOG.md` - -Check `CHANGELOG.md` and add the new release. +## How to build distributions ## Build @@ -311,7 +166,7 @@ separately. The current platform for Intel GNU/Linux and Windows production builds is a Debian 10, running on an Intel NUC8i7BEH mini PC with 32 GB of RAM -and 512 GB of fast M.2 SSD. +and 512 GB of fast M.2 SSD. The machine name is `xbbi`. ```console $ ssh xbbi @@ -330,7 +185,7 @@ $ docker run hello-world ``` Before running a build for the first time, it is recommended to preload the -docker images. +docker images, since they are pretty large. ```console $ bash ~/Downloads/riscv-none-embed-gcc-xpack.git/scripts/build.sh preload-images @@ -362,33 +217,27 @@ To remove unused files: $ docker system prune --force ``` -To download the build scripts: - -```console -$ curl --fail -L https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/raw/xpack/scripts/git-clone.sh | bash -``` - -To build both the 32/64-bit Windows and GNU/Linux versions, use `--all`; to -build selectively, use `--linux64 --win64` or `--linux32 --win32` (GNU/Linux -can be built alone; Windows also requires the GNU/Linux build). - Since the build takes a while, use `screen` to isolate the build session from unexpected events, like a broken network connection or a computer entering sleep. ```console $ screen -S riscv - -$ sudo rm -rf ~/Work/riscv-none-embed-gcc-* -$ bash ~/Downloads/riscv-none-embed-gcc-xpack.git/scripts/build.sh --all ``` -or, for development builds: +Run the development builds on the development machine (`wks`): ```console $ bash ~/Downloads/riscv-none-embed-gcc-xpack.git/scripts/build.sh --disable-multilib --develop --disable-tests --without-pdf --linux64 --linux32 --win64 --win32 ``` +When ready, run the build on the production machine (`xbbi`): + +```console +$ sudo rm -rf ~/Work/riscv-none-embed-gcc-* +$ bash ~/Downloads/riscv-none-embed-gcc-xpack.git/scripts/build.sh --all +``` + To detach from the session, use `Ctrl-a` `Ctrl-d`; to reattach use `screen -r riscv`; to kill the session use `Ctrl-a` `Ctrl-\` and confirm. @@ -398,22 +247,14 @@ their SHA signatures, created in the `deploy` folder: ```console $ ls -l ~/Work/riscv-none-embed-gcc-*/deploy total 1346668 --rw-rw-r-- 1 ilg ilg 347985751 Oct 10 14:22 xpack-riscv-none-embed-gcc-8.3.0-2.2-linux-x32.tar.gz --rw-rw-r-- 1 ilg ilg 120 Oct 10 14:22 xpack-riscv-none-embed-gcc-8.3.0-2.2-linux-x32.tar.gz.sha --rw-rw-r-- 1 ilg ilg 343458303 Oct 10 11:55 xpack-riscv-none-embed-gcc-8.3.0-2.2-linux-x64.tar.gz --rw-rw-r-- 1 ilg ilg 120 Oct 10 11:55 xpack-riscv-none-embed-gcc-8.3.0-2.2-linux-x64.tar.gz.sha --rw-rw-r-- 1 ilg ilg 337016277 Oct 10 14:58 xpack-riscv-none-embed-gcc-8.3.0-2.2-win32-x32.zip --rw-rw-r-- 1 ilg ilg 117 Oct 10 14:58 xpack-riscv-none-embed-gcc-8.3.0-2.2-win32-x32.zip.sha --rw-rw-r-- 1 ilg ilg 350502092 Oct 10 12:28 xpack-riscv-none-embed-gcc-8.3.0-2.2-win32-x64.zip --rw-rw-r-- 1 ilg ilg 117 Oct 10 12:28 xpack-riscv-none-embed-gcc-8.3.0-2.2-win32-x64.zip.sha -``` - -To copy the files from the build machine to the current development -machine, either use NFS to mount the entire folder, or open the `deploy` -folder in a terminal and use `scp`: - -```console -$ (cd ~/Work/riscv-none-embed-gcc-*/deploy; scp * ilg@wks:Downloads/xpack-binaries/riscv) +-rw-rw-r-- 1 ilg ilg 347985751 Oct 10 14:22 xpack-riscv-none-embed-gcc-8.3.0-2.3-linux-x32.tar.gz +-rw-rw-r-- 1 ilg ilg 120 Oct 10 14:22 xpack-riscv-none-embed-gcc-8.3.0-2.3-linux-x32.tar.gz.sha +-rw-rw-r-- 1 ilg ilg 343458303 Oct 10 11:55 xpack-riscv-none-embed-gcc-8.3.0-2.3-linux-x64.tar.gz +-rw-rw-r-- 1 ilg ilg 120 Oct 10 11:55 xpack-riscv-none-embed-gcc-8.3.0-2.3-linux-x64.tar.gz.sha +-rw-rw-r-- 1 ilg ilg 337016277 Oct 10 14:58 xpack-riscv-none-embed-gcc-8.3.0-2.3-win32-x32.zip +-rw-rw-r-- 1 ilg ilg 117 Oct 10 14:58 xpack-riscv-none-embed-gcc-8.3.0-2.3-win32-x32.zip.sha +-rw-rw-r-- 1 ilg ilg 350502092 Oct 10 12:28 xpack-riscv-none-embed-gcc-8.3.0-2.3-win32-x64.zip +-rw-rw-r-- 1 ilg ilg 117 Oct 10 12:28 xpack-riscv-none-embed-gcc-8.3.0-2.3-win32-x64.zip.sha ``` #### Build the Arm GNU/Linux binaries @@ -425,7 +266,7 @@ The supported Arm architectures are: The current platform for Arm GNU/Linux production builds is a Debian 9, running on an ROCK Pi 4 SBC with 4 GB of RAM -and 256 GB of fast M.2 SSD. +and 256 GB of fast M.2 SSD. The machine name is `xbba`. ```console $ ssh xbba @@ -438,7 +279,7 @@ $ docker info ``` Before running a build for the first time, it is recommended to preload the -docker images. +docker images, since they are pretty large. ```console $ bash ~/Downloads/riscv-none-embed-gcc-xpack.git/scripts/build.sh preload-images @@ -454,27 +295,27 @@ ilegeul/ubuntu arm64v8-16.04-xbb-v3.2 db95609ffb69 37 ho hello-world latest a29f45ccde2a 5 months ago 9.14kB ``` -To download the build scripts: - -```console -$ curl -L https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/raw/xpack/scripts/git-clone.sh | bash -``` - Since the build takes a while, use `screen` to isolate the build session from unexpected events, like a broken network connection or a computer entering sleep. ```console $ screen -S riscv +``` + +Run the development builds on the development machine (`wks`): +```console $ sudo rm -rf ~/Work/riscv-none-embed-gcc-* -$ bash ~/Downloads/riscv-none-embed-gcc-xpack.git/scripts/build.sh --all +$ bash ~/Downloads/riscv-none-embed-gcc-xpack.git/scripts/build.sh --disable-multilib --develop --disable-tests --without-pdf --arm32 --arm64 ``` -or, for development builds: +When ready, run the build on the production machine (`xbba`): ```console -$ bash ~/Downloads/riscv-none-embed-gcc-xpack.git/scripts/build.sh --disable-multilib --develop --disable-tests --without-pdf --arm32 --arm64 +$ sudo rm -rf ~/Work/riscv-none-embed-gcc-* +$ bash ~/Downloads/riscv-none-embed-gcc-xpack.git/scripts/build.sh --all +``` To detach from the session, use `Ctrl-a` `Ctrl-d`; to reattach use `screen -r arm`; to kill the session use `Ctrl-a` `Ctrl-k` and confirm. @@ -485,48 +326,42 @@ archives and their SHA signatures, created in the `deploy` folder: ```console $ ls -l ~/Work/riscv-none-embed-gcc-*/deploy total 667980 --rw-rw-r-- 1 ilg ilg 343409720 Oct 10 14:55 xpack-riscv-none-embed-gcc-8.3.0-2.2-linux-arm64.tar.gz --rw-rw-r-- 1 ilg ilg 122 Oct 10 14:55 xpack-riscv-none-embed-gcc-8.3.0-2.2-linux-arm64.tar.gz.sha --rw-rw-r-- 1 ilg ilg 340579759 Oct 10 22:10 xpack-riscv-none-embed-gcc-8.3.0-2.2-linux-arm.tar.gz --rw-rw-r-- 1 ilg ilg 120 Oct 10 22:10 xpack-riscv-none-embed-gcc-8.3.0-2.2-linux-arm.tar.gz.sha +-rw-rw-r-- 1 ilg ilg 343409720 Oct 10 14:55 xpack-riscv-none-embed-gcc-8.3.0-2.3-linux-arm64.tar.gz +-rw-rw-r-- 1 ilg ilg 122 Oct 10 14:55 xpack-riscv-none-embed-gcc-8.3.0-2.3-linux-arm64.tar.gz.sha +-rw-rw-r-- 1 ilg ilg 340579759 Oct 10 22:10 xpack-riscv-none-embed-gcc-8.3.0-2.3-linux-arm.tar.gz +-rw-rw-r-- 1 ilg ilg 120 Oct 10 22:10 xpack-riscv-none-embed-gcc-8.3.0-2.3-linux-arm.tar.gz.sha ``` -To copy the files from the build machine to the current development -machine, either use NFS to mount the entire folder, or open the `deploy` -folder in a terminal and use `scp`: - -```console -$ (cd ~/Work/riscv-none-embed-gcc-*/deploy; scp * ilg@wks:Downloads/xpack-binaries/riscv) -``` - -### Build the macOS binary +### Build the macOS binaries The current platform for macOS production builds is a macOS 10.10.5 -running on a MacBookPro with 16 GB of RAM and a fast SSD. +running on a MacBookPro with 16 GB of RAM and a fast SSD. The machine +name is `xbbm`. ```console $ ssh xbbm ``` -To download them, the following shortcut is available: +Since the build takes a while, use `screen` to isolate the build session +from unexpected events, like a broken +network connection or a computer entering sleep. ```console -$ curl --fail -L https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/raw/xpack/scripts/git-clone.sh | bash +$ screen -S riscv ``` -To build the latest macOS version: +Run the development builds on the development machine (`wks`): ```console -$ screen -S riscv - $ sudo rm -rf ~/Work/riscv-none-embed-gcc-* -$ caffeinate bash ~/Downloads/riscv-none-embed-gcc-xpack.git/scripts/build.sh --osx +$ caffeinate bash ~/Downloads/riscv-none-embed-gcc-xpack.git/scripts/build.sh --disable-multilib --develop --disable-tests --without-pdf --osx ``` -or, for development builds: +When ready, run the build on the production machine (`xbbm`): ```console -$ caffeinate bash ~/Downloads/riscv-none-embed-gcc-xpack.git/scripts/build.sh --disable-multilib --develop --disable-tests --without-pdf --osx +$ sudo rm -rf ~/Work/riscv-none-embed-gcc-* +$ caffeinate bash ~/Downloads/riscv-none-embed-gcc-xpack.git/scripts/build.sh --osx ``` To detach from the session, use `Ctrl-a` `Ctrl-d`; to reattach use @@ -538,39 +373,10 @@ and its SHA signature, created in the `deploy` folder: ```console $ ls -l ~/Work/riscv-none-embed-gcc-*/deploy total 666560 --rw-r--r-- 1 ilg staff 341272214 Oct 10 14:23 xpack-riscv-none-embed-gcc-8.3.0-2.2-darwin-x64.tar.gz --rw-r--r-- 1 ilg staff 121 Oct 10 14:23 xpack-riscv-none-embed-gcc-8.3.0-2.2-darwin-x64.tar.gz.sha -``` - -To copy the files from the build machine to the current development -machine, either use NFS to mount the entire folder, or open the `deploy` -folder in a terminal and use `scp`: - -```console -$ (cd ~/Work/riscv-none-embed-gcc-*/deploy; scp * ilg@wks:Downloads/xpack-binaries/riscv) -``` - -## Run a test build - -Before starting the builds on the dedicated machines, run a quick test on -the local development workstation. - -```console -$ caffeinate bash ~/Downloads/riscv-none-embed-gcc-xpack.git/scripts/build.sh --disable-multilib --develop --disable-tests --without-pdf --osx +-rw-r--r-- 1 ilg staff 341272214 Oct 10 14:23 xpack-riscv-none-embed-gcc-8.3.0-2.3-darwin-x64.tar.gz +-rw-r--r-- 1 ilg staff 121 Oct 10 14:23 xpack-riscv-none-embed-gcc-8.3.0-2.3-darwin-x64.tar.gz.sha ``` -or on the build machine: - -```console -$ bash ~/Downloads/riscv-none-embed-gcc-xpack.git/scripts/build.sh --disable-multilib --develop --disable-tests --without-pdf --linux64 -``` - -This should check the commit IDs and the tag names in all the refered -repositories, and the build scripts. - -It is _quick_ because it does not build the multilibs. Even so, on a -fast machine, it may take 30-60 minutes. - ## Subsequent runs ### Separate platform specific builds @@ -649,7 +455,7 @@ program from there. For example on macOS the output should look like: ```console -$ /Users/ilg/Downloads/xPacks/riscv-none-embed-gcc/8.3.0-2.2/bin/riscv-none-embed-gcc --version +$ /Users/ilg/Downloads/xPacks/riscv-none-embed-gcc/8.3.0-2.3/bin/riscv-none-embed-gcc --version riscv-none-embed-gcc (xPack RISC-V Embedded GCC, 64-bit) 8.3.0 ``` @@ -666,8 +472,8 @@ After install, the package should create a structure like this (only the first two depth levels are shown): ```console -$ tree -L 2 /Users/ilg/opt/xPacks/riscv-none-embed-gcc/8.3.0-2.2 -/Users/ilg/opt/gnu-mcu-eclipse/riscv-none-embed-gcc/8.3.0-2.2 +$ tree -L 2 /Users/ilg/opt/xPacks/riscv-none-embed-gcc/8.3.0-2.3 +/Users/ilg/opt/gnu-mcu-eclipse/riscv-none-embed-gcc/8.3.0-2.3 ├── README.md ├── riscv-none-embed │   ├── bin diff --git a/README-DEVELOP.md b/README-DEVELOP.md new file mode 100644 index 0000000..e69de29 diff --git a/README-RELEASE.md b/README-RELEASE.md index 660ca0a..f156ff2 100644 --- a/README-RELEASE.md +++ b/README-RELEASE.md @@ -1,13 +1,221 @@ -# How to publish the xPack GNU RISC-V Embedded GCC binaries +# How to make a new release (maintainer info) -## Build +## Prepare the build + +Before starting the build, perform some checks and tweaks. + +### Check Git + +- switch to the `xpack-develop` branch +- if needed, merge the `xpack` branch -Before starting the build, perform some checks. +### Identify SiFive commit IDs + +- check the [SiFive Releases](https://github.com/sifive/freedom-tools/releases) +for new releases +- identify the tag of the latest release (like `v2019.08.0`) +- switch to Code view and select the tag +- open the `src` folder to identify the commit IDs used for the linked repos +- copy/paste the submodule links to common-versions-sources.sh +- get binutils version from binutils/CHANGELOG +- get gcc version from gcc/BASE_VER (gcc/ChangeLog) +- get newlib version from newlib/configure, VERSION= (newlib/README) +- get gdb version from gdb/VERSION.in (gdb/ChangeLog) + +### Identify the main GCC version + +Determine the GCC version (like `8.3.0`) and update the `scripts/VERSION` + file; the format is `8.3.0-2.3`. The fourth digit is the number of the + SiFive release of the same GCC version, and the fifth digit is the xPack + GNU RISC-V Embedded GCC release number of this version. + +### Update binutils + +With Sourcetree in +[xpack-dev-tools/riscv-binutils-gdb](https://github.com/xpack-dev-tools/riscv-binutils-gdb) + +Check if there is a `sifive` remote pointing to +https://github.com/sifive/riscv-binutils-gdb. + +If the changes apply to an existing branch: + +- checkout the current SiFive branch (like `sifive-binutils-2.32`) +- merge the commit with the desired ID from the corresponding branch in +the `sifive` remote +- checkout the corresponding xpack branch (like `sifive-binutils-2.32-xpack`) +- merge the previous merge +- check the differences from the non-xpack branch; it should be only the +addition of `embed)` in `config.sub` + +If the changes are on a new branch (most likely): + +- from the `sifive` remote +checkout the new SiFive branch (like `sifive-binutils-2.32`) into a new local +branch +- identify the commit ID and switch to it +- create a new branch with a similar name, but suffixed by `-xpack` +(like `sifive-binutils-2.32-xpack`) +- identify the commit which adds the xPack specific changes +- cherry pick it; do not commit immediately +- check the uncommited changes; there should be one file `config.sub` +which adds `-embed)` +- commit as **add support for riscv-none-embed-*** + +In both cases: + +- push the two modified branches (like `sifive-binutils-2.32` and +`sifive-binutils-2.32-xpack`) +- add a tag with the current version (like `v8.3.0-2.3`), and push +it to `origin` + +- copy/paste the branch name and commit id tp common-versions-source.sh + +### Update gcc + +With Sourcetree in +[xpack-dev-tools/riscv-gcc](https://github.com/xpack-dev-tools/riscv-gcc) + +Check if there is a `sifive` remote pointing to +https://github.com/sifive/riscv-gcc. + +If the changes apply to an existing branch: + +- checkout the current SiFive branch (like `sifive-gcc-8.3.0`) +- merge the commit with the desired ID from the corresponding branch in +the `sifive` remote +- checkout the corresponding xpack branch (like `sifive-gcc-8.3.0-xpack`) +- merge the previous merge +- check the differences from the non-xpack branch; there should be tree files: + - `elf-embed.h` with the `LIB_SPEC` definitions without libgloss + - `config.gcc` with `tm_file` definition that uses `elf-embed.h` + - `config.sub` which adds `riscv0*)` and `-embed)` + +If this is a new branch: + +- from the `sifive` remote +checkout the new SiFive branch (like `sifive-gcc-8.3.0`) into a new local +branch +- identify the commit ID and switch to it +- create a new branch with a similar name, but suffixed by `-xpack` +(like `sifive-gcc-8.3.0-xpack`) +- identify the commit which adds the xPaack specific changes +- cherry pick it; do not commit immediately +- check the uncommited changes; there should be tree files: + - `elf-embed.h` with the `LIB_SPEC` definitions without libgloss + - `config.gcc` with `tm_file` definition that uses `elf-embed.h` + - `config.sub` which adds `riscv0*)` and `-embed)` +- commit as **add support for riscv-none-embed-*** + +In both cases: + +- push the two modified branches (like `sifive-gcc-8.3.0` and +`sifive-gcc-8.3.0-xpack`) +- add a tag with the current version (like `v8.3.0-2.3`), and push +it to `origin`. + +### Update newlib + +With Sourcetree in +[xpack-dev-tools/riscv-newlib](https://github.com/xpack-dev-tools/riscv-newlib) + +Check if there is a `sifive` remote pointing to +https://github.com/sifive/riscv-newlib. + +If the changes apply to an existing branch: + +- checkout the current SiFive branch (like `master`) +- merge the commit with the desired ID from the corresponding branch in +the `sifive` remote +- checkout the corresponding xpack branch (like `sifive-binutils-2.32-xpack`) +- merge the previous merge +- check the differences from the non-xpack branch; it should be only the +addition of `embed)` in `config.sub` + +- from the `sifive` remote +checkout the new SiFive branch (like `master`) into a new local +branch (like `sifive-master`) +- identify the commit ID and switch to it +- create a new branch with a similar name, but suffixed by `-xpack` +(like `sifive-master-xpack`) +- identify the commit which adds the xPack specific changes +- cherry pick it; do not commit immediately +- check the uncommited changes; there should be one file `config.sub` +which adds `-embed)` +- commit as **add support for riscv-none-embed-*** + +In both cases: + +- push the two modified branches (like `sifive--master` and +`sifive--master-xpack`) +- add a tag with the current version (like `v8.3.0-2.3`), and push +it to `origin`. + +### Update gdb + +With Sourcetree in +[xpack-dev-tools/riscv-binutils-gdb](https://github.com/xpack-dev-tools/riscv-binutils-gdb) + +Check if there is a `gdb` remote pointing to +git://sourceware.org/git/binutils-gdb.git. + +For GDB, it is a bit tricky, since it must identify the GNU code in line +with what was used by SiFive; create a branch like `sifive-gdb-8.3` + +- branch it into `sifive-gdb-8.3-xpack` and edit the prefix code +- add a tag like `v8.3.0-2.3-gdb` + +### Increase the version + +Determine the GCC version (like `8.3.0`) and update the `scripts/VERSION` +file; the format is `8.3.0-2.3`. The fourth number is the xPack release number +of this version. A fifth number will be added when publishing +the package on the `npm` server. + +### Fix possible open issues + +Check GitHub issues and pull requests: + +- https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/issues + +and fix them; assign them to a milestone (like `8.3.0-2.3`). + +### Check `README.md` + +Normally `README.md` should not need changes, but better check. +Information related to the new version should not be included here, +but in the version specific file (below). + +## Update `CHANGELOG.md` + +- open the `CHANGELOG.md` file +- check if all previous fixed issues are in +- add a new entry like _v8.3.0-2.3 prepared_ +- commit commit with a message like _CHANGELOG: prepare v8.3.0-2.3_ -### Check possible open issues +Note: if you missed to update the `CHANGELOG.md` before starting the build, +edit the file and rerun the build, it should take only a few minutes to +recreate the archives with the correct file. + +### Update the version specific code + +- open the `common-versions-source.sh` file +- add a new `if` with the new version before the existing code +- update `GH_RELEASE` to the new version (like `8.3.0-2.3`, without `v`) +- in SiFive [releases](https://github.com/sifive/freedom-tools/releases) +for new releases +- identify the tag of the latest release (like `v2019.08.0`) +- switch to Code view and select the tag +- open the `Makefile` file to identify the `MULTILIBS_GEN` definition; +- copy/paste it into `GCC_MULTILIB` (mind the tabs!) +- add `rv32imaf-ilp32f--` after `rv32imf-` (already in for recent versions) -Check GitHub [issues](https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/issues) -and fix them; do not close them yet. +### Update helper + +With Sourcetree, go to the helper repo and update to the latest master commit. + +## Build + +Before starting the build, perform some checks. ### Check if repos are up-to-date @@ -19,61 +227,205 @@ Be sure everything is committed and pushed ### Check tags -The names should look like `v8.3.0-2.2`. +The names should look like `v8.3.0-2.3`. -For the binutils-gdb repo, a separate tag like `v8.3.0-2.2-gdb` should be -present, for the gdb build. +For the binutils-gdb repo, a separate tag like `v8.3.0-2.3-gdb` should be +present, for the GDB build. -### Check the `CHANGELOG.md` file +### Development run the build scripts -Open the `CHANGELOG.txt` file and check if -all new entries are in. +Before the real build, run a test build on the development machine (`wks`): -Note: if you missed to update the `CHANGELOG.md` before starting the build, -edit the file and rerun the build, it should take only a few minutes to -recreate the archives with the correct file. +```bash +sudo rm -rf ~/Work/riscv-none-embed-gcc-* -### Check the version +caffeinate bash ~/Downloads/riscv-none-embed-gcc-xpack.git/scripts/build.sh --develop --without-pdf --disable-tests --disable-multilib --linux64 --win64 --linux32 --win32 +``` -The `VERSION` file should refer to the actual release. +Work on the scripts until all 4 platforms pass the build. ### Push the build scripts -In this Git repo: +- push the `xpack-develop` branch to GitHub +- possibly push the helper project too -- if necessary, merge the `xpack-develop` branch into `xpack` -- push it to GitHub. -- possibly push the helper project too. +From here it'll be cloned on the production machines. -### Clean the destination folder +### Run the build scripts without multilibs + +Move to the three production machines. + +On the macOS build machine (`xbbm`): + +- empty the trash bin +- create three new terminals + +Connect to the Intel Linux (`xbbi`): + +```bash +caffeinate ssh xbbi +``` + +Connect to the Arm Linux (`xbba`): + +```bash +caffeinate ssh xbba +``` + +On all machines, clone the `xpack-develop` branch: + +```bash +rm -rf ~/Downloads/riscv-none-embed-gcc-xpack.git; \ + git clone \ + --recurse-submodules \ + --branch xpack-develop \ + https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack.git \ + ~/Downloads/riscv-none-embed-gcc-xpack.git +``` + +On all machines, remove any previous build: + +```bash +sudo rm -rf ~/Work/riscv-none-embed-gcc-* +``` + +On the macOS machine (`xbbm`): + +```bash +caffeinate bash ~/Downloads/riscv-none-embed-gcc-xpack.git/scripts/build.sh --osx --disable-multilib +``` + +A typical run takes about 80 minutes. + +On both Linux machines (`xbbi` and `xbba`): + +```bash +bash ~/Downloads/riscv-none-embed-gcc-xpack.git/scripts/build.sh --all --disable-multilib +``` + +A typical run on the Intel machine takes about 105 minutes; +on the Arm machine it takes about 370 minutes. + +### Clean the destination folder for the test binaries -Clear the folder where the binaries from all build machines will be collected. +On the development machine (`wks`) clear the folder where binaries from all +build machines will be collected. + +```bash +rm -f ~/Downloads/xpack-binaries/riscv* +``` + +Note: this step is very important, to avoid using test binaries! + +### Copy the test binaries to the development machine + +On all three machines: ```console -$ rm -f ~/Downloads/xpack-binaries/riscv/* +(cd ~/Work/riscv-none-embed-gcc-*/deploy; scp * ilg@wks:Downloads/xpack-binaries/riscv) +``` + +## Publish the binaries as pre-release/experimental + +For really new versions, test before making the release. + +Use the [experimental pre-release](https://github.com/xpack-dev-tools/pre-releases/releases/tag/experimental) +to publish the binaries, to run the Travis tests and to allow for +others to test them. + +## Run the pre-release Travis tests + +In the `tests/scripts/trigger-travis-*.sh` files, check and update the +URL to use something like + +``` +base_url="https://github.com/xpack-dev-tools/pre-releases/releases/download/experimental/" ``` -### Run the build scripts +Trigger the stable and latest Travis builds (on a Mac by double-clicking +on the command scripts): + +- `trigger-travis-quick.mac.command` (optional) +- `trigger-travis-stable.mac.command` +- `trigger-travis-latest.mac.command` + +The test results are available from: -When everything is ready, follow the instructions from the -[build](https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/blob/xpack/README-BUILD.md) -page. +- https://travis-ci.org/github/xpack-dev-tools/riscv-none-embed-gcc-xpack -## Test +### Run the build scripts with multilibs + +On all machines, clone the `xpack-develop` branch: + +```bash +rm -rf ~/Downloads/riscv-none-embed-gcc-xpack.git; \ + git clone \ + --recurse-submodules \ + --branch xpack-develop \ + https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack.git \ + ~/Downloads/riscv-none-embed-gcc-xpack.git +``` + +On all machines, remove any previous build: + +```bash +sudo rm -rf ~/Work/riscv-none-embed-gcc-* +``` + +Empty trash. + +On the macOS machine (`xbbm`): + +```bash +caffeinate bash ~/Downloads/riscv-none-embed-gcc-xpack.git/scripts/build.sh --osx +``` + +A typical run takes about 225 minutes. + +On both Linux machines (`xbbi` and `xbba`): + +```bash +bash ~/Downloads/riscv-none-embed-gcc-xpack.git/scripts/build.sh --all +``` + +A typical run on the Intel machine takes about 290 minutes; +on the Arm machine it takes about 875 minutes. + +### Clean the destination folder + +On the development machine (`wks`) clear the folder where binaries from all +build machines will be collected. + +```bash +rm -f ~/Downloads/xpack-binaries/riscv* +``` + +### Copy the binaries to the development machine + +On all three machines: + +```console +(cd ~/Work/riscv-none-embed-gcc-*/deploy; scp * ilg@wks:Downloads/xpack-binaries/riscv) +``` + +## Testing Install the binaries on all supported platforms and check if they are functional. For this, on each platform (Mac, GNU/Linux 64/32, Windows 64/32): -- unpack the archive in `Desktop` or in `Downloads`, and rename the version +- unpack the archive in `Desktop` or in `Downloads`, and rename the version folder, by replacing a dash with a space; this will test paths with spaces; on Windows the current paths always use spaces, so renaming is not needed; - clone this repo locally; on Windows use the Git console; -```console -$ git clone --recurse-submodules https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack.git \ -~/Downloads/riscv-none-embed-gcc-xpack.git +```bash +git clone \ + --recurse-submodules \ + --branch xpack-develop \ + https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack.git \ + ~/Downloads/riscv-none-embed-gcc-xpack.git ``` - in a separate workspace, Import → General → Existing Projects into Workspace @@ -101,16 +453,17 @@ $ git clone --recurse-submodules https://github.com/xpack-dev-tools/riscv-none-e ## Create a new GitHub pre-release - in `CHANGELOG.md`, add release date -- commit and push the repo -- go to the [GitHub Releases](https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases) page +- commit and push the `xpack-develop` branch +- go to the GitHub [releases](https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases) page - click **Draft a new release** -- name the tag like **v8.3.0-2.2** (mind the dash in the middle!) +- name the tag like **v8.3.0-2.3** (mind the dash in the middle!) - select the target branch (like sifive-gcc-8.3.0-gme) -- name the release like **xPack GNU RISC-V Embedded GCC v8.3.0-2.2** +- name the release like **xPack GNU RISC-V Embedded GCC v8.3.0-2.3** (mind the dash and the space) - as description - - add a downloads badge like `![Github Releases (by Release)](https://img.shields.io/github/downloads/xpack-dev-tools/riscv-none-embed-gcc-xpack/v8.3.0-2.2/total.svg)`; use empty URL for now + - add a downloads badge like `![Github Releases (by Release)](https://img.shields.io/github/downloads/xpack-dev-tools/riscv-none-embed-gcc-xpack/v8.3.0-2.3/total.svg)`; use empty URL for now - draft a short paragraph explaining what are the main changes + - add _At this moment these binaries are provided for tests only!_ - **attach binaries** and SHA (drag and drop from the archives folder will do it) - **enable** the **pre-release** button - click the **Publish Release** button @@ -118,31 +471,37 @@ $ git clone --recurse-submodules https://github.com/xpack-dev-tools/riscv-none-e Note: at this moment the system should send a notification to all clients watching this project. -## Run the Travis tests +## Run the release Travis tests + +Using the scripts in `tests/scripts/`, start: + +- `trigger-travis-quick.mac.command` (optional) +- `trigger-travis-stable.mac.command` +- `trigger-travis-latest.mac.command` -Run the tests on **stable** and **latest** platforms. This may take about 30 -minutes. +The test results are available from: -The test results are available at -[Travis](https://travis-ci.org/github/xpack-dev-tools/riscv-none-embed-gcc-xpack/builds/). +- https://travis-ci.org/github/xpack-dev-tools/riscv-none-embed-gcc-xpack For more details, see `tests/scripts/README.md`. ## Prepare a new blog post -In the `xpack.github.io` web Git: +In the `xpack/web-jekyll` GitHub repo: -- add a new file to `_posts/releases/riscv-none-embed-gcc` -- name the file like `2020-10-13-riscv-none-embed-gcc-v8-3-0-2-2-released.md` -- name the post like: **xPack GNU RISC-V Embedded GCC v8.3.0-2.2 released**. -- as `download_url` use the tagged URL like -`https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases/tag/v8.3.0-2.2/` +- select the `xpack-develop` branch +- add a new file to `_posts/riscv-none-embed-gcc/releases` +- name the file like `2020-07-03-riscv-none-embed-gcc-v8-3-0-2-2-released.md` +- name the post like: **xPack GNU RISC-V Embedded GCC v8.3.0-2.3 released** +- as `download_url` use the tagged URL like `https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases/tag/v8.3.0-2.3/` - update the `date:` field with the current date -- copy the list of commit IDs from the `README-.sh` file -- generate the list of multilibs and copy/paste +- update the Travis URLs using the actual test pages +- update the SHA sums via copy/paste from the original build machines +(it is very important to use the originals!) -If any, close [issues](https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/issues) -on the way. Refer to them as: +If any, refer to closed +[issues](https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/issues) +as: - **[Issue:\[#1\]\(...\)]**. @@ -155,81 +514,143 @@ Copy/paste the build report at the end of the post as: The SHA-256 hashes for the files are: 2009f256e59291e1025cc099e4300d7662dda040b304fe3462b4cb7c35c71378 -xpack-riscv-none-embed-gcc-8.3.0-2.2-darwin-x64.tar.gz +xpack-riscv-none-embed-gcc-8.3.0-2.3-darwin-x64.tar.gz 751f28a28148ddaec8cfcbf7eb794a70d24ee6650dc29da91e6aa672b9deae52 -xpack-riscv-none-embed-gcc-8.3.0-2.2-linux-arm64.tar.gz +xpack-riscv-none-embed-gcc-8.3.0-2.3-linux-arm64.tar.gz 63f232cbeddbe968130f4c8386cca24c5e1410cc2551738d071b279a94cd8b75 -xpack-riscv-none-embed-gcc-8.3.0-2.2-linux-arm.tar.gz +xpack-riscv-none-embed-gcc-8.3.0-2.3-linux-arm.tar.gz 1d99730d6e1e5d3a60fa0ccfbbcf0276e77dd83d58b6d8d1543cef40a1dd96ca -xpack-riscv-none-embed-gcc-8.3.0-2.2-linux-x32.tar.gz +xpack-riscv-none-embed-gcc-8.3.0-2.3-linux-x32.tar.gz 079a88d7f7c18cfd735a9ed1f0eefa28ab28d3007b5f7591920ab25225c89248 -xpack-riscv-none-embed-gcc-8.3.0-2.2-linux-x64.tar.gz +xpack-riscv-none-embed-gcc-8.3.0-2.3-linux-x64.tar.gz 8e7e98117900f3eed717b20555b346c2473dcbb9090e05c456412008f39fb62d -xpack-riscv-none-embed-gcc-8.3.0-2.2-win32-x32.zip +xpack-riscv-none-embed-gcc-8.3.0-2.3-win32-x32.zip 5b7a4e3a2bb22566fed951972d726d10ff43bc35db17f9287eed52766e80ecee -xpack-riscv-none-embed-gcc-8.3.0-2.2-win32-x64.zip +xpack-riscv-none-embed-gcc-8.3.0-2.3-win32-x64.zip ``` -If you missed this, `cat` the content of the `.sha` files: +## Check the SHA sums -```console -$ cd ~Downloads/xpack-binaries/riscv -$ cat *.sha +On the development machine (`wks`): + +```bash +cd ~Downloads/xpack-binaries/riscv +cat *.sha ``` -## Update the Web +## Update the preview Web -- commit the `xpack.github.io` web Git; use a message - like **xPack GNU RISC-V Embedded GCC v8.3.0-2.2 released** +- commit the `develop` branch of `xpack/web-jekyll` GitHub repo; use a message + like **xPack GNU RISC-V Embedded GCC v8.3.0-2.3 released** - adjust timestamps - wait for the GitHub Pages build to complete -- remember the post URL, since it must be updated in the release page +- the preview web is https://xpack.github.io/web-preview/ ## Publish on the npmjs.com server -- open [GitHub Releases](https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases) - and select the latest release -- update the `baseUrl:` with the file URLs (including the tag/version) +- select the `xpack-develop` branch +- open the `package.json` file +- open the GitHub [releases](https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases) + page and select the latest release +- check the download counter, it should match the number of tests +- update the `baseUrl:` with the file URLs (including the tag/version); + no terminating `/` is required - from the release, copy the SHA & file names +- compare the SHA sums with those shown by `cat *.sha` - check the executable names -- commit all changes, use a message like `package.json: update urls for 8.3.0-2.2 release` (without `v`) +- commit all changes, use a message like + `package.json: update urls for 8.3.0-2.3 release` (without `v`) - check the latest commits `npm run git-log` - update `CHANGELOG.md`; commit with a message like - _CHANGELOG: prepare npm v8.3.0-2.2.1_ -- `npm version 8.3.0-2.2.1`; the first 5 numbers are the same as the + _CHANGELOG: prepare npm v8.3.0-2.3.1_ +- `npm version 8.3.0-2.3.1`; the first 5 numbers are the same as the GitHub release; the sixth number is the npm specific version -- `npm pack` and check the content of the archive -- push all changes to GitHub -- `npm publish --tag next` (use `--access public` when publishing for the first time) +- `npm pack` and check the content of the archive, which should list + only the `package.json`, the `README.md`, `LICENSE` and `CHANGELOG.md` +- push the `xpack-develop` branch to GitHub +- `npm publish --tag next` (use `--access public` when publishing for + the first time) -## Test the npm binaries with xpm +The version is visible at: + +- https://www.npmjs.com/package/@xpack-dev-tools/riscv-none-embed-gcc?activeTab=versions + +## Test if the npm binaries can be installed with xpm Run the `tests/scripts/trigger-travis-xpm-install.sh` file, this will install the package on Intel Linux 64-bit, macOS and Windows 64-bit. +The test results are available from: + +- https://travis-ci.org/github/xpack-dev-tools/riscv-none-embed-gcc-xpack + For 32-bit Windows, 32-bit Intel GNU/Linux and 32-bit Arm, install manually. ```console $ xpm install --global @xpack-dev-tools/riscv-none-embed-gcc@next ``` +## Test the npm binaries + +Install the binaries on all platforms. + +```bash +xpm install --global @xpack-dev-tools/riscv-none-embed-gcc@next +``` + +On GNU/Linux systems, including Raspberry Pi, use the following commands: + +```bash +~/opt/xPacks/@xpack-dev-tools/riscv-none-embed-gcc/8.3.0-2.3.1/.content/bin/riscv-none-embed-gcc --version + +TODO +``` + +On macOS, use: + +```bash +~/Library/xPacks/@xpack-dev-tools/riscv-none-embed-gcc/8.3.0-2.3.1/.content/bin/riscv-none-embed-gcc --version + +TODO +``` + +On Windows use: + +``` +%HOMEPATH%\AppData\Roaming\xPacks\@xpack-dev-tools\riscv-none-embed-gcc\8.3.0-2.3.1\.content\bin\riscv-none-embed-gcc --version + +TODO +``` + +## Update the repo + +- merge `xpack-develop` into `xpack` +- push + ## Tag the npm package as `latest` When the release is considered stable, promote it as `latest`: - `npm dist-tag ls @xpack-dev-tools/riscv-none-embed-gcc` -- `npm dist-tag add @xpack-dev-tools/riscv-none-embed-gcc@8.3.0-2.2.1 latest` +- `npm dist-tag add @xpack-dev-tools/riscv-none-embed-gcc@8.3.0-2.3.1 latest` - `npm dist-tag ls @xpack-dev-tools/riscv-none-embed-gcc` -## Create a final GitHub release +## Update the Web + +- in the `master` branch, merge the `develop` branch +- wait for the GitHub Pages build to complete +- the result is in https://xpack.github.io/news/ +- remember the post URL, since it must be updated in the release page + +## Create the final GitHub release -- go to the [GitHub Releases](https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases) page +- go to the GitHub [releases](https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases) page - check the download counter, it should match the number of tests - add a link to the Web page `[Continue reading »]()`; use an same blog URL - **disable** the **pre-release** button @@ -239,7 +660,7 @@ When the release is considered stable, promote it as `latest`: - in a separate browser windows, open [TweetDeck](https://tweetdeck.twitter.com/) - using the `@xpack_project` account -- paste the release name like **xPack GNU RISC-V Embedded GCC v8.3.0-2.2 released** +- paste the release name like **xPack GNU RISC-V Embedded GCC v8.3.0-2.3 released** - paste the link to the Web Page release - click the **Tweet** button diff --git a/README.md b/README.md index 7f9abea..ab6d886 100644 --- a/README.md +++ b/README.md @@ -78,14 +78,14 @@ For all platforms, the **xPack GNU RISC-V Embedded GCC** binaries are released as portable archives that can be installed in any location. The archives can be downloaded from the -[GitHub Releases](https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases/) page. +GitHub [releases](https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases/) page. For more details please read the [Install](https://xpack.github.io/riscv-none-embed-gcc/install/) page. ## Maintainer info - [How to build](https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/blob/xpack/README-BUILD.md) -- [How to publish](https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/blob/xpack/README-PUBLISH.md) +- [How to make new releases](https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/blob/xpack/README-RELEASE.md) ## Support diff --git a/patches/python37-config.sh b/patches/python37-config.sh index 115efc5..d6dcf05 100755 --- a/patches/python37-config.sh +++ b/patches/python37-config.sh @@ -26,7 +26,9 @@ do case ${opt} in --prefix|--exec-prefix) - prefix="${SOURCES_FOLDER_PATH}/${PYTHON3_WIN_SRC_FOLDER_NAME}" + # prefix="${SOURCES_FOLDER_PATH}/${PYTHON3_WIN_SRC_FOLDER_NAME}" + # Must have a common part to force PYTHON_PATH_RELOCATABLE + prefix="${APP_PREFIX}" echo "${opt} -> [${prefix}]" >&2 echo "${prefix}" ;; diff --git a/scripts/VERSION b/scripts/VERSION index a58c463..bb91c63 100644 --- a/scripts/VERSION +++ b/scripts/VERSION @@ -1 +1 @@ -8.3.0-2.2 +8.3.0-2.3 diff --git a/scripts/common-functions-source.sh b/scripts/common-functions-source.sh index 51a6291..25d7f3d 100644 --- a/scripts/common-functions-source.sh +++ b/scripts/common-functions-source.sh @@ -110,9 +110,6 @@ function add_linux_install_path() export PATH="${WORK_FOLDER_PATH}/${LINUX_INSTALL_RELATIVE_PATH}/${APP_LC_NAME}/bin:${PATH}" echo ${PATH} - - # export LD_LIBRARY_PATH="${WORK_FOLDER_PATH}/${LINUX_INSTALL_RELATIVE_PATH}/${APP_LC_NAME}/bin:${LD_LIBRARY_PATH}" - # echo ${LD_LIBRARY_PATH} } # ----------------------------------------------------------------------------- diff --git a/scripts/common-versions-source.sh b/scripts/common-versions-source.sh index 5afbfc6..6a4211c 100644 --- a/scripts/common-versions-source.sh +++ b/scripts/common-versions-source.sh @@ -158,7 +158,7 @@ function build_versions() rv64imfd-lp64d--c \ rv64iafd-lp64d-rv64imafd,rv64iafdc- \ rv64imafdc-lp64d-- \ - "} + "} GCC_MULTILIB_FILE=${GCC_MULTILIB_FILE:-"t-elf-multilib"} @@ -170,11 +170,11 @@ function build_versions() # Be sure there is no `v`, it is added in the URL. GH_RELEASE="8.3.0-2.1" - if [ "${RELEASE_VERSION}" == "8.3.0-2.2" ] + if [[ "${RELEASE_VERSION}" =~ 8\.3\.0-2\.[1] ]] then - BINUTILS_GH_RELEASE=${BINUTILS_GH_RELEASE:-"8.3.0-2.2"} - else BINUTILS_GH_RELEASE=${BINUTILS_GH_RELEASE:-"${GH_RELEASE}"} + else + BINUTILS_GH_RELEASE=${BINUTILS_GH_RELEASE:-"8.3.0-2.2"} fi GCC_GH_RELEASE=${GCC_GH_RELEASE:-"${GH_RELEASE}"} NEWLIB_GH_RELEASE=${NEWLIB_GH_RELEASE:-"${GH_RELEASE}"} @@ -184,11 +184,11 @@ function build_versions() else BINUTILS_GIT_BRANCH=${BINUTILS_GIT_BRANCH:-"sifive-binutils-2.32-cache-control-patch-xpack"} - if [ "${RELEASE_VERSION}" == "8.3.0-2.2" ] + if [[ "${RELEASE_VERSION}" =~ 8\.3\.0-2\.[1] ]] then - BINUTILS_GIT_COMMIT=${BINUTILS_GIT_COMMIT:-"c46d3912cd901db4bdc331bd394aa97d85ac1746"} - else BINUTILS_GIT_COMMIT=${BINUTILS_GIT_COMMIT:-"d005a513ac8469bf23a1a7655a6d372a7f470dd3"} + else + BINUTILS_GIT_COMMIT=${BINUTILS_GIT_COMMIT:-"c46d3912cd901db4bdc331bd394aa97d85ac1746"} fi GCC_GIT_BRANCH=${GCC_GIT_BRANCH:-"sifive-gcc-8.3.0-xpack"} @@ -229,14 +229,27 @@ function build_versions() # More libraries. # Fails on mingw ## build_libelf "0.8.13" + build_libmpdec "2.5.0" # Used by Python build_expat "2.2.5" build_libiconv "1.15" build_xz "5.2.3" build_gettext "0.19.8.1" - if [ "${TARGET_PLATFORM}" != "win32" ] + if [ "${TARGET_PLATFORM}" == "win32" ] then + if [ "${WITH_GDB_PY3}" == "y" ] + then + if [[ "${RELEASE_VERSION}" =~ 8\.3\.0-2\.[3] ]] + then + # Shortcut, use the existing pyton.exe instead of building + # if from sources. It also downloads the sources. + download_python3_win "${PYTHON3_VERSION}" + + add_python3_win_syslibs + fi + fi + else # linux or darwin # Used by ncurses. Fails on macOS. if [ "${TARGET_PLATFORM}" == "linux" ] then @@ -244,22 +257,34 @@ function build_versions() fi build_ncurses "6.2" - build_readline "8.0" # requires ncurses - build_bzip2 "1.0.8" - build_libffi "3.3" + if [[ "${RELEASE_VERSION}" =~ 8\.3\.0-2\.[3] ]] + then + build_readline "8.0" # requires ncurses - # Required by a Python 3 module. - build_sqlite "3.32.3" + build_bzip2 "1.0.8" + build_libffi "3.3" - # We cannot rely on a python shared library in the system, even - # the custom build from sources does not have one. - if [ "${WITH_GDB_PY3}" == "y" ] - then - # Replacement for the old libcrypt.so.1; required by Python 3. - build_libxcrypt "4.4.17" - build_python3 "${PYTHON3_VERSION}" + # We cannot rely on a python shared library in the system, even + # the custom build from sources does not have one. + + if [ "${WITH_GDB_PY3}" == "y" ] + then + # Required by a Python 3 module. + build_sqlite "3.32.3" + + # Replacement for the old libcrypt.so.1; required by Python 3. + build_libxcrypt "4.4.17" + build_openssl "1.1.1h" + + build_python3 "${PYTHON3_VERSION}" + + if [[ "${RELEASE_VERSION}" =~ 8\.3\.0-2\.[3] ]] + then + add_python3_syslibs + fi + fi fi fi @@ -305,11 +330,6 @@ function build_versions() if [ "${WITH_GDB_PY3}" == "y" ] then - if [ "${TARGET_PLATFORM}" == "win32" ] - then - download_python3_win "${PYTHON3_VERSION}" - fi - build_gdb "-py3" fi @@ -728,15 +748,7 @@ function build_versions() # ------------------------------------------------------------------------- - ZLIB_VERSION="1.2.8" - GMP_VERSION="6.1.2" - MPFR_VERSION="3.1.6" - MPC_VERSION="1.0.3" - ISL_VERSION="0.18" - LIBELF_VERSION="0.8.13" - EXPAT_VERSION="2.2.5" - LIBICONV_VERSION="1.15" - XZ_VERSION="5.2.3" + # LIBELF_VERSION="0.8.13" WITH_GDB_PY2="y" PYTHON2_VERSION="2.7.13" @@ -751,20 +763,20 @@ function build_versions() # For better control, without it some components pick the lib packed # inside the archive. - build_zlib "${ZLIB_VERSION}" + build_zlib "1.2.8" # The classical GCC libraries. - build_gmp "${GMP_VERSION}" - build_mpfr "${MPFR_VERSION}" - build_mpc "${MPC_VERSION}" - build_isl "${ISL_VERSION}" + build_gmp "6.1.2" + build_mpfr "3.1.6" + build_mpc "1.0.3" + build_isl "0.18" # More libraries. # Fails on mingw ## do_libelf - build_expat "${EXPAT_VERSION}" - build_libiconv "${LIBICONV_VERSION}" - build_xz "${XZ_VERSION}" + build_expat "2.2.5" + build_libiconv "1.15" + build_xz "5.2.3" build_gettext "0.19.8.1" diff --git a/scripts/container-apps-functions-source.sh b/scripts/container-apps-functions-source.sh index 664b0a4..10cf4a7 100644 --- a/scripts/container-apps-functions-source.sh +++ b/scripts/container-apps-functions-source.sh @@ -355,7 +355,7 @@ function build_gcc_first() --without-headers \ --with-gnu-as \ --with-gnu-ld \ - --with-python-dir=share/gcc-${GCC_TARGET} \ + --with-python-dir="share/gcc-${GCC_TARGET}" \ --with-sysroot="${APP_PREFIX}/${GCC_TARGET}" \ \ ${MULTILIB_FLAGS} \ @@ -1182,24 +1182,7 @@ function build_gdb() CONFIG_PYTHON_PREFIX="" local extra_python_opts="--with-python=no" - if [ "$1" == "-py" ] - then - if [ "${TARGET_PLATFORM}" == "win32" ] - then - extra_python_opts="--with-python=${BUILD_GIT_PATH}/patches/python27-config.sh" - else - extra_python_opts="--with-python=${LIBS_INSTALL_FOLDER_PATH}/bin/python2.7" - - if [ "${TARGET_PLATFORM}" == "darwin" ] - then - # Use the custom path, 2.7 will be removed from future macOS. - CONFIG_PYTHON_PREFIX="/Library/Frameworks/Python.framework/Versions/2.7" - elif [ "${TARGET_PLATFORM}" == "linux" ] - then - CONFIG_PYTHON_PREFIX="/usr/local" - fi - fi - elif [ "$1" == "-py3" ] + if [ "$1" == "-py3" ] then if [ "${TARGET_PLATFORM}" == "win32" ] then @@ -1213,13 +1196,7 @@ function build_gdb() else extra_python_opts="--with-python=${LIBS_INSTALL_FOLDER_PATH}/bin/python3.${PYTHON3_VERSION_MINOR}" - if [ "${TARGET_PLATFORM}" == "darwin" ] - then - CONFIG_PYTHON_PREFIX="/Library/Frameworks/Python.framework/Versions/3.${PYTHON3_VERSION_MINOR}" - elif [ "${TARGET_PLATFORM}" == "linux" ] - then - CONFIG_PYTHON_PREFIX="/usr/local" - fi + CONFIG_PYTHON_PREFIX="${APP_PREFIX}" fi fi @@ -1373,48 +1350,6 @@ function test_gdb() show_libs "${APP_PREFIX}/bin/${GCC_TARGET}-gdb${suffix}" - # The original Python in Ubunutu XBB is too old and the test fails. - # Use the XBB modern Python. - if [ "${suffix}" == "-py" ] - then - if [ "${TARGET_PLATFORM}" == "win32" ] - then - # There is no simple way to create a Windows Python2 environment to - # run the tests, so... - echo "skipped..." - return 0 - # export PYTHONPATH="${SOURCES_FOLDER_PATH}/${PYTHON2_WIN_SRC_FOLDER_NAME}/python27.zip;${SOURCES_FOLDER_PATH}/${PYTHON2_WIN_SRC_FOLDER_NAME}" - else - echo - python2.${PYTHON2_VERSION_MINOR} --version - python2.${PYTHON2_VERSION_MINOR} -c 'import sys; import os; print(os.pathsep.join(sys.path))' - - export PYTHONHOME="$(python2.${PYTHON2_VERSION_MINOR} -c 'import sys; print(sys.prefix)')" - export PYTHONPATH="$(python2.${PYTHON2_VERSION_MINOR} -c 'import sys; import os; print(os.pathsep.join(sys.path))')" - fi - elif [ "${suffix}" == "-py3" ] - then - if [ "${TARGET_PLATFORM}" == "win32" ] - then - export PYTHONPATH="${SOURCES_FOLDER_PATH}/${PYTHON3_WIN_SRC_FOLDER_NAME}/python37.zip;${SOURCES_FOLDER_PATH}/${PYTHON3_WIN_SRC_FOLDER_NAME}" - else - echo - python3.${PYTHON3_VERSION_MINOR} --version - python3.${PYTHON3_VERSION_MINOR} -c 'import sys; import os; print(os.pathsep.join(sys.path))' - - export PYTHONHOME="$(python3.${PYTHON3_VERSION_MINOR} -c 'import sys; print(sys.prefix)')" - export PYTHONPATH="$(python3.${PYTHON3_VERSION_MINOR} -c 'import sys; import os; print(os.pathsep.join(sys.path))')" - fi - fi - - if [ "${suffix}" != "" ] - then - set +u - echo "PYTHONHOME=${PYTHONHOME}" - echo "PYTHONPATH=${PYTHONPATH}" - set -u - fi - run_app "${APP_PREFIX}/bin/${GCC_TARGET}-gdb${suffix}" --version run_app "${APP_PREFIX}/bin/${GCC_TARGET}-gdb${suffix}" --config @@ -1425,6 +1360,19 @@ function test_gdb() -ex='show language' \ -ex='set language auto' \ -ex='quit' + + + if [ "${suffix}" == "-py3" ] + then + # Show Python paths. + run_app "${APP_PREFIX}/bin/${GCC_TARGET}-gdb${suffix}" \ + --nh \ + --nx \ + -ex='set pagination off' \ + -ex='python import sys; print(sys.prefix)' \ + -ex='python import sys; import os; print(os.pathsep.join(sys.path))' \ + -ex='quit' + fi ) }