Poudriere Simple Tips on $PATH, ccache, & Calling Poudriere command line

Poudriere Simple Tips on $PATH, ccache, &Calling Poudriere command line

 Poudriere Simple Tips

Create a Jail
 poudriere jail -c -j ghostbsd-14-aarch64 -m src=/usr/ghost14/ghostbsd-src
 
Bulk build packages from a previously create jail and a package list file
 poudriere jail -l
 poudriere bulk -j  ghostbsd-14-aarch64 -p ghostbsd_ports -f /usr/local/etc/poudriere.d/pkglist 
 
Bulk build all packages (yes 33,000+)
poudriere bulk -j ghostbsd-14-aarch64  -p ghostbsd_ports -a
 
To create  ghostbsd ports for poudriere
poudriere ports -c -p ghostbsd_ports -m git -U "https://github.com/ghostbsd/ghostbsd-ports" -B main

To update ghostbsd ports source code to latest main version
poudriere ports -u -p ghostbsd_ports -m git -U "https://github.com/ghostbsd/ghostbsd-ports" -B main
 


Set $PATH to match  ccache needs for cc, gcc, c++, g++ alias name symbolic links that call ccache to come first before the real cc, gcc compiler binary executable files, (NOT the alias names!).  I would put /sbin:/bin  then /usr/local/bin;/usr/ports/lang, then everything else that need to run in the PATH environment variable.

PATH=/usr/local/bin:/usr/ports/lang:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/root/bin ; export PATH
echo $PATH              # check the PATH setting.  Fish shell is different at setting the PATH

Look at which login files set the PATH environment variable:
.cshrc .login  .login_conf  /etc/login.conf
https://vermaden.wordpress.com/2023/08/10/freebsd-on-freeipa-idm-with-poudriere-repo/ Freeipa Idm with Poudriere setup; look for ccache setup directions

ccache  set symbolic link from binary ccache to alias /usr/local/bin/gcc
lrwxr-xr-x  1 root wheel 5 Oct  4 17:22 /usr/local/bin/g++ -> g++12
lrwxr-xr-x  1 root wheel 5 Oct  4 17:22 /usr/local/bin/gcc -> gcc12
 
man ccache   from manual page on ccache:
2. Let ccache masquerade as the compiler. This method is most useful
   when you wish to use ccache for all your compilations. To do this,
   create a symbolic link to ccache named as the compiler. For
   example, here is set up ccache to masquerade as gcc and g++:

               cp ccache /usr/local/bin/
               ln -s ccache /usr/local/bin/gcc
               ln -s ccache /usr/local/bin/g++
               ls -lh /usr/local/bin/gcc /usr/local/bin/g++
lrwxr-xr-x  1 root wheel    6B Mar 25 05:30 /usr/local/bin/g++ -> ccache
lrwxr-xr-x  1 root wheel    6B Mar 25 05:30 /usr/local/bin/gcc -> ccache

 
3.  set Environmental Variable   CCACHE_CONFIGPATH
     --config-path PATH
           Let the command line options operate on configuration file PATH
           instead of the default. Using this option has the same effect as
           setting (overriding) the environment variable CCACHE_CONFIGPATH
           temporarily.
CCACHE_CONFIGPATH=/var/ccache ; export CCACHE_CONFIGPATH

       -d, --dir PATH
           Let the command line options operate on cache directory PATH
           instead of the default. For example, to show statistics for a cache
           directory at /shared/ccache you can run ccache -d /shared/ccache
           -s. Using this option has the same effect as setting the
           environment variable CCACHE_DIR temporarily.



CCACHE_DIR=/var/ccache ; export CCACHE_DIR
Test with  set  or printenv  and with  ccache -p  commands
zfs mount
df -h


4.  Edit file /etc/src.conf and add line 
https://github.com/freebsd/freebsd-ports/blob/main/devel/ccache/files/ccache-howto-freebsd.txt.in  CCACHE HowTO FreeBSD text file

-(remember that only GCC and Clang can build world and kernel)
+To use ccache for base add the following to /etc/src.conf file.
+WITH_CCACHE_BUILD=true
 

 Look how to setup a jail environment to use a specific PATH environment variable. To execute an 
alia name "ccache"  before the call to the real gcc or cc clang 'C' compiler
/sbin /bin /usr/local/bin/ /usr/ports/lang /usr/sbin /usr/bin /usr/local/sbin $HOME/bin
 

The FreeBSD version running in the jail can not be newer that the version running in the host.

path - The directory which is to be the root of the jail. Any commands that are run inside the jail, either by jail or from jexec(8), are run from this directory.

  # HOSTNAME/PATH
  host.hostname = "${name}"; 
  path = "/usr/local/jails/containers/${name}"; 

 

 
DF -h ZFS mount commands to see /var/ccache dataset




Error in Line 5 in file /var/ccache/ccache.conf
5: EOF This 3 character line needs deleted with extra EOF
Repaired file through edit, and then Poudriere Bulk Build began to work properly!!
CCACHE_CONFIGPATH = /var/ccache    Set environmental variable to search for executable files

Poudriere Bulk Build Finished with SUCCESS!!  Yeah!
Use 4 cpus for builder,  place the finished packages in directory
/usr/local/etc/poudriere/data/packages/ghostbsd-14-aarch64-ghostbsd_ports

Started with CLI:
poudriere bulk -j  ghostbsd-14-aarch64 -p ghostbsd_ports -f /usr/local/etc/poudriere.d/pkglist

Error could not fine file /usr/ports/Mk/bsd.port.mk
[00:00:00] Starting jail ghostbsd-14-aarch64-ghostbsd_ports
[00:00:00] Will build as nobody:nobody (65534:65534)
[00:00:01] Logs: /usr/local/poudriere/data/logs/bulk/ghostbsd-14-aarch64-ghostbsd_ports/2024-03-25_05h40m16s
[00:00:01] WWW: http://ghostbsdarm64.hopto.org/poudriere/build.html?mastername=ghostbsd-14-aarch64-ghostbsd_ports&build=2024-03-25_05h40m16s
make: cannot open /usr/ports/Mk/bsd.port.mk.
[00:00:01] Error: Error looking up pre-build ports vars

cd /usr/local/poudriere/ports
FIXED problem by  git clone ghostbsd-ports
and by placing a file, bsd.port.mk , inside the jail.  Not sure which is the correct fix.

mkdir -p /usr/local/poudriere/ports/ghostbsd_ports/usr/ports/Mk/
cp -p /usr/ports/Mk/bsd.port.mk  /usr/local/poudriere/ports/ghostbsd_ports/usr/ports/Mk/bsd.port.mk


root@Ghost14-selfbuilt-rpi4B-nginx-tst1:/usr/local/poudriere/ports # pwd
/usr/local/poudriere/ports
root@Ghost14-selfbuilt-rpi4B-nginx-tst1:/usr/local/poudriere/ports # git clone https://github.com/ghostbsd/ghostbsd-ports ghostbsd_ports
Cloning into 'ghostbsd_ports'...
remote: Enumerating objects: 7047859, done.
remote: Counting objects: 100% (330352/330352), done.
remote: Compressing objects: 100% (152406/152406), done.
remote: Total 7047859 (delta 177452), reused 329089 (delta 176273), pack-reused 6717507
Receiving objects: 100% (7047859/7047859), 2.01 GiB | 5.88 MiB/s, done.
Resolving deltas: 100% (3706986/3706986), done.
Checking objects: 100% (16777216/16777216), done.
Updating files: 100% (160061/160061), done.
root@Ghost14-selfbuilt-rpi4B-nginx-tst1:/usr
Restart Poudriere Builder
 poudriere bulk -j  ghostbsd-14-aarch64 -p ghostbsd_ports -f /usr/local/etc/poudriere.d/pkglist


How is Poudriere Builder working for you today?

Comments

Popular posts from this blog

FreeBSD 14.0 Compiling kernel for Raspberry Pi 4B

HDMI Audio sound patches into GhostBSD source code /usr/ghost14/ghostbsd-src SOLVED Jan20 2024

How to install GhostBSD-Arm64 into a USB Flash Drive stick April 24, 2024 update edition.