Skip to content
jrmarino edited this page Aug 15, 2023 · 37 revisions

Steps to upgrade port compiler and binutils

These instructions assume ravenadm has already been updated with the last ports compiler and/or binutils and that the task is to rebuild a fresh set of packages on a supported platform. Obviously this package set includes updated compiler/binutils/toolchain packages.

Latest procedure

  1. Update ravensource

    The ravensource is required because ravensys-gcc is temporarily modified to speed up the process. Also building ravenadm from source may prevent a version warning, potentially having to disable the ncurses option to allow the build

    cd <ravensource repo location>
    git pull
    
  2. Rebuild ravenadm

    eval `ravenadm dev jump ravenadm`
    ravenadm dev buildsheet . save
    ravenadm force ravenadm
    
  3. Install the latest ravenadm

    ravensw add --force /path/to/profile/packages/All/ravenadm-single-standard-<version>.tzst
    
  4. Update conspiracy

    ravenadm update-ports
    
  5. Modify ports compiler buildsheet

    eval `ravenadm dev jump ravensys-gcc`
    vi specification
    

    add the following to the CONFIGURE_ARGS list:

    --disable-bootstrap
    --disable-cc1
    
  6. Build the latest ports compiler

    ravenadm dev buildsheet . save
    ravenadm force ravensys-gcc
    
  7. If binutils have been updated, build those as well

    ravenadm force ravensys-binutils
    
  8. Package the new toolchain

    ravenadm force ravensys-toolchain
    
  9. Make a copy of the current sysroot and toolchain just in case

    cd /raven/share
    cp -a raven raven.backup
    
  10. Replace the current toolchain with the updated one

    ravensw remove "ravensys-toolchain-*"  (answer yes)
    ravensw add /var/ravenports/primary/packages/All/ravensys-toolchain-single-standard-5.0.tzst  (example)
    
  11. Set SKIPCCRUN in environment

    vi ~/.profile         (as non-root user)
    
    • add "export SKIPCCRUN=yes" and save (:wq)
    • "exit" to log off
    • log back as the regular user
    • "su" to become root
    • "env" to confirm SKIPCCRUN is defined in the environment
  12. Create new profile in ravenadm and activate it

    ravenadm configure
    

    The purpose of this is to preserve the original packages. Just duplicate the current profile and change the profile directory the packages directory and the compiler ccache directory (if set).

    One trick is to bring up /raven/etc/ravenadm/ravenadm.ini in a text editor, copy the profile block and make the adjustments in the editor. Don't forget to activate the new profile, either with "ravenadm configure" or expertly by altering "profile_selected=" line.

  13. Create a new ccache directory

    This should match the new profile. You may want to copy "ccache.conf" file from the previous profile's ccache directory.

  14. Rebuild the toolchain with SKIPCCRUN set

    ravenadm force ravensys-binutils
    ravenadm force ravensys-gcc
    ravenadm force ravensys-toolchain
    

Second generation

  1. Remove toolchain

    ravensw remove "ravensys-toolchain-*"  (answer yes)
    
  2. Install newly-built toolchain

    ravensw add /var/ravenports/nextgen/packages/All/ravensys-toolchain-single-standard-5.0.tzst  (example)
    
  3. Rename the packages directory of the new profile

    mv /var/ravenports/nextgen/packages /var/ravenports/nextgen/packages.1g  (example)
    
  4. Recreate the packaged directory

    mkdir /var/ravenports/nextgen/packages  (example)
    
  5. Remove SKIPCCRUN from environment

    From the non-root user:

    vi ~/.profile
    

    Comment out the export SKIPCCRUN file and save.

  6. Log out and back in again

    Log out, then back in as non-root user, then "su" to become root again. Run "env" to verify SKIPCCRUN is no longer set in environment.

  7. Rebuild toolchain

    ravenadm force ravensys-binutils
    ravenadm force ravensys-gcc
    ravenadm force ravensys-toolchain
    

Third generation

  1. Remove toolchain
    ravensw remove "ravensys-toolchain-*"  (answer yes)
    
  2. Install newly-built toolchain
    ravensw add /var/ravenports/nextgen/packages/All/ravensys-toolchain-single-standard-5.0.tzst  (example)
    
  3. Rename the packages directory of the new profile
    mv /var/ravenports/nextgen/packages /var/ravenports/nextgen/packages.2g  (example)
    
  4. Recreate the packaged directory
    mkdir /var/ravenports/nextgen/packages  (example)
    
  5. Remove modifications to ravensys-gcc
    eval `ravenadm dev jump ravensys-gcc`
    git checkout .
    ravenadm dev buildsheet . save
    
  6. Rebuild toolchain
    ravenadm force ravensys-binutils
    ravenadm force ravensys-gcc
    ravenadm force ravensys-toolchain
    
  7. Build ravensys-root
    ravenadm build ravensys-root:<variant>
    

Final generation

  1. Remove toolchain
    ravensw remove "ravensys-toolchain-*"  (answer yes)
    
  2. Install newly-built toolchain
    ravensw add /var/ravenports/nextgen/packages/All/ravensys-toolchain-5.0.tzst  (example)
    
  3. Remove system root
    ravenadm remove "ravensys-root-*"  (answer yes)
    
  4. Install newly-built system root
    ravensw add /var/ravenports/nextgen/packages/All/ravensys-root-single-netbsd_amd64-3.4.tzst  (example)
    
  5. Rename the packages directory of the new profile
    mv /var/ravenports/nextgen/packages /var/ravenports/nextgen/packages.3g  (example)
    
  6. Recreate the packaged directory
    mkdir /var/ravenports/nextgen/packages  (example)
    
  7. Build everything

Steps to upgrade ports compiler and binutils (previous (last generation); archived)

  1. Upgrade binutils and/or compiler
    1. Update Scripts/Ravenports_Mk/raven.information.mk
      1. GCC[X]_POINT
      2. GCC[X]_SNAPSHOT
      3. CURRENT_GCC
      4. CURRENT_GCC_VERSION
      5. BINUTILS_VERSION
    2. regenerate conspiracy (to replace raven.information.mk)
    3. Run Scripts/miscellaneous/full_regen_by_list.sh with gcc.list
      1. remove bucket_3E/ravensys-toolchain/distfile (should be empty)
    4. build binutils:ravensys (if necessary)
      1. regen patches
      2. fix plist
    5. build gcc (if necessary)
      1. update patches (probably not necessary)
    6. rebuild ravensys-toolchain
      1. bump version or revisions
  2. Update ravenadm
    1. go to github repository definitions and update
      1. compiler_version
      2. previous_compiler
      3. binutils_version
      4. previous_binutils
      5. ravenadm version
    2. Tag release
    3. Update ravenadm port to build new release
    4. Build ravenadm
  3. use ravensw(8) to replace ravensys-toolchain with newly built version
  4. rename profile's package directory and create an empty directory in its place
  5. clear ccache
    1. relocate directory
    2. create new directory in it's place
    3. copy ccache.conf back to new directory
    4. delete old cache later
  6. build ravensys-root:[opsys]
    1. bump version first
  7. use ravensw(8) to replace ravensys-root-[opsys] with newly built version
  8. rename profile's package directory again, and create empty directory in its place
  9. final toolchain generation
    1. force-build binutils:ravensys
    2. force-build gccX
    3. build ravensys-toolchain
    4. use ravensw(8) to replace ravensys-toolchain with newly built version
  10. build-everything

Steps to upgrade ports compiler and binutils (previous (2 generations ago); archived)

  1. Update ravenadm
    1. go to definitions and update
      1. compiler_version
      2. previous_compiler
      3. binutils_version
      4. previous_binutils
    2. Also bump version
    3. Release
    4. Update ravenadm port to build new release
    5. set-options to build without ncurses
    6. build ravenadm (no ncurses)
  2. Replace ravenadm with new version
  3. Update Scripts/Ravenports_Mk/raven.information.mk
    1. GCC[X]_POINT
    2. GCC[X]_SNAPSHOT
    3. CURRENT_GCC
    4. CURRENT_GCC_VERSION
    5. BINUTILS_VERSION
  4. Copy raven.information.mk to [conspiracy]/Mk/
  5. Run Scripts/miscellaneous/full_regen_by_list.sh with gcc.list
    1. remove bucket_3E/ravensys-toolchain/distfile (should be empty)
  6. build binutils (if necessary)
  7. build gcc (if necessary)
    1. regen patches
  8. build ravensys-toolchain with SKIPCCRUN=1 in the environment
    1. update COMPILER_VER DEF
    2. update GCC_VERSION DEF
    3. update GCC_BRANCH
    4. bump version (regen buildsheet)
  9. replace ravensys-toolchain with newly built version
  10. rename profile's package directory and create an empty directory in its place
  11. build ravensys-root:[opsys]
    1. bump version first
  12. use ravensw(8) to replace ravensys-root-[opsys] with newly built version
  13. rename profile's package directory again, and create empty directory in its place
  14. clear ccache
    1. relocate directory
    2. create new directory in it's place
    3. copy ccache.conf back to new directory
    4. delete old cache later
  15. unset SKIPCCRUN if it's in environment
  16. rebuild binutils
  17. rebuild gccX
  18. rebuild ravensys-toolchain
  19. replace ravensys-toolchain
  20. rebuild ravensys-root-[opsys]
  21. replace ravensys-root-[opsys]
  22. set-options on ravenadm to build with ncurses again (this doesn't work. Remove options file, e.g. rm /var/ravenports/primary/options/ravenadm)
  23. build everything