Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Nov 2024 10:32:33 -0500
From:      Dennis Clarke <dclarke@blastwave.org>
To:        riscv@freebsd.org
Subject:   Re: Help wanted improving Rust support for RISC-V
Message-ID:  <cf610608-bd4d-4ccf-95c6-c70371cac5bb@blastwave.org>
In-Reply-To: <a5e0991c-9609-4347-b2bf-79e71fd309c2@blastwave.org>
References:  <CAOtMX2iUfMktVkYrnc5ufQ460PpnqG2YP2DYmavAoDQz%2BOWk9g@mail.gmail.com> <fca8a77e-99b2-4615-a7d3-1dae4d2d3565@app.fastmail.com> <CAOtMX2g838YdPnfL2Jo31jHNTnoPC_RpxC6M2de5pvquO=cnCA@mail.gmail.com> <0408D5F2-C44C-4000-941C-244B3BBC6C2A@freebsd.org> <RM0Rce4nVMermQhdVskqRd-vb-IVUGL1CYEKh5x3Rlvgk2PcroXRGSUe2ZjoCEvHHfqbPl-YJLu2FmNd-hqbhbFCyzvf-InncVRn9wwZxQs=@protonmail.com> <CAOtMX2jgsUWuC4i_0RRajRKCsRQSzSODxiqK6EA7EMkdwrO_Yg@mail.gmail.com> <a5e0991c-9609-4347-b2bf-79e71fd309c2@blastwave.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 11/17/24 06:00, Dennis Clarke wrote:
> On 11/16/24 13:49, Alan Somers wrote:
>> That's a very generous offer, and I'll take you up on it if I can't
>> find an option that doesn't involve moving actual stuff around the
>> planet.  I'm trying QEMU right now, but it's painfully slow.  And I've
>> inquired with Scaleway too.
> 
> Slow ?
> 
> I emailed you off list to help...

Going back on-list as it is not polite to work silently in the dark when
others may benefit. Certainly when the conversation began on a maillist.

On 11/17/24 11:38, Alan Somers wrote:
 > That sounds super-helpful.  How about I wait until EoD Monday ...
.
.
.
 > BTW, do you have any advice for getting riscv packages quickly?

     There is no such thing as "quickly" with RISC-V. Period.

     I have poudriere in place and lang/rust takes days to fail.

 > Right now I'm trying to run a riscv VM in QEMU, but it's super-slow.

     Yes, that is RISC-V in 2024 or 2025. Slowly. Everywhere.

 > Compiling ports-mgmt/pkg took over an hour even with 16 CPUs.

     Sixteen CPU's emulated by QEMU. I would guess that four real CPU
     cores on the SiFive board would be quicker. Maybe. We should get
     that dog sled race setup and then place bets. Even better I shall
     run the experiment on the SiFive UnMatched Rev B unit here and then
     watch the blue led flash.

 > And I have a lot of packages to build before I can do real work,
 > including big ones like cmake and rust.

     Same issue here. I suggest you embrace your inner engineer from the
   mid-1970's or even the early 1980's and just know that there is an old
   systems operator that needs to load in your card stack, or mount your
   6250 tape reel. Later in the day. Maybe later that night. Your process
   will be in the batch schedule and may run in the next day. May. Result
   of that batch process will be in a printed stack available that day or
   the next.  I have plenty of experience with that process and these new
   RISC-V boards remind me to embrace those memories.

   Consider this little dumb question here :

https://lists.freebsd.org/archives/freebsd-riscv/2024-November/000422.html

   With the result of that good help being :

enceladus# /usr/bin/time -p idprio 0 poudriere jail -c -j 150rv64 \
  -a riscv.riscv64 -b -m src=/usr/src -f rv64/poudriere/jails/150rv64 \
  -v main
[00:00:00] Creating 150rv64 fs at /poudriere/jails/150rv64... done
[00:00:00] Copying /usr/src to /poudriere/jails/150rv64/usr/src... done
[00:04:27] Starting make buildworld with 4 jobs
--- buildworld ---
make[1]: "/poudriere/jails/150rv64/usr/src/Makefile.inc1" line 362: 
SYSTEM_COMPILER: Determined that CC=/usr/local/bin/ccache cc matches the 
source tree.  Not bootstrapping a cross-compiler.
make[1]: "/poudriere/jails/150rv64/usr/src/Makefile.inc1" line 367: 
SYSTEM_LINKER: Determined that LD=ld matches the source tree.  Not 
bootstrapping a cross-linker.
--- buildworld_prologue ---
--------------------------------------------------------------
 >>> World build started on Tue Nov 12 22:30:27 UTC 2024
--------------------------------------------------------------
--- _cleanworldtmp ---
 >>> Deleting stale files in build tree...
        24.39 real         9.08 user        19.94 sys
rm -rf 
/usr/obj/poudriere/jails/150rv64/usr/src/riscv.riscv64/tmp/legacy/usr/include
if [ -x 
/usr/obj/poudriere/jails/150rv64/usr/src/riscv.riscv64/tmp/usr/bin/cc ]; 
then  inum=$(ls -i 
/usr/obj/poudriere/jails/150rv64/usr/src/riscv.riscv64/tmp/usr/bin/cc); 
find /usr/obj/poudriere/jails/150rv64/usr/src/riscv.riscv64/tmp/usr/bin 
-inum ${inum%% *} -delete;  fi
if [ -x 
/usr/obj/poudriere/jails/150rv64/usr/src/riscv.riscv64/tmp/usr/bin/c++ 
]; then  inum=$(ls -i 
/usr/obj/poudriere/jails/150rv64/usr/src/riscv.riscv64/tmp/usr/bin/c++); 
  find 
/usr/obj/poudriere/jails/150rv64/usr/src/riscv.riscv64/tmp/usr/bin -inum 
${inum%% *} -delete;  fi
--- _worldtmp ---
--------------------------------------------------------------
 >>> Rebuilding the temporary build tree
--------------------------------------------------------------
.
.
.
.
--------------------------------------------------------------
 >>> stage 1.1: legacy release compatibility shims
--------------------------------------------------------------
--------------------------------------------------------------
 >>> stage 1.2: bootstrap tools
--------------------------------------------------------------
 >>> Deleting stale dependencies...
 >>> Deleting stale dependencies...
--------------------------------------------------------------
 >>> stage 2.3: build tools
--------------------------------------------------------------
--------------------------------------------------------------
 >>> stage 3: cross tools
--------------------------------------------------------------
--------------------------------------------------------------
 >>> stage 3.1: recording build metadata
--------------------------------------------------------------
--------------------------------------------------------------
 >>> stage 4.1: building includes
--------------------------------------------------------------
--------------------------------------------------------------
 >>> stage 4.2: building libraries
--------------------------------------------------------------
--------------------------------------------------------------
 >>> stage 4.4: building everything
--------------------------------------------------------------
--------------------------------------------------------------
 >>> World build completed on Mon Nov 18 03:27:25 UTC 2024
 >>> World built in 449818 seconds, ncpu: 4, make -j4
--------------------------------------------------------------
--------------------------------------------------------------
 >>> Install check world started on Mon Nov 18 03:27:27 UTC 2024
--------------------------------------------------------------
--------------------------------------------------------------
 >>> Making hierarchy
--------------------------------------------------------------
--------------------------------------------------------------
 >>> Installing everything started on Mon Nov 18 03:27:33 UTC 2024
--------------------------------------------------------------
--------------------------------------------------------------
 >>> Installing everything completed on Mon Nov 18 03:44:40 UTC 2024
 >>> Install world completed in 1030 seconds, ncpu: 4, make -j4
--------------------------------------------------------------
[5D:05:21:58] Recording filesystem state for clean... done
[5D:05:21:59] Jail 150rv64 15.0-CURRENT 1500026 riscv.riscv64 is ready 
to be used
real 451319.86
user 381003.15
sys 1373578.38
enceladus#

   So the old operator was slowly working through the batch jobs list
and you get a result five days and some hours later. Be happy that it
worked at all.

   Now then let me take a look at the results and build ports-mgmt/pkg
to see how long that takes :

enceladus# poudriere jails -l
JAILNAME VERSION              ARCH          METHOD       TIMESTAMP 
     PATH
150rv64  15.0-CURRENT 1500026 riscv.riscv64 src=/usr/src 2024-11-12 
22:25:57 /poudriere/jails/150rv64

enceladus# date -u
Mon Nov 18 14:31:36 UTC 2024

enceladus# poudriere ports -l
PORTSTREE METHOD    TIMESTAMP           PATH
latest    git+https 2024-11-08 17:21:03 /poudriere/ports/latest

enceladus# poudriere ports -p latest -u
Updating files: 100% (4257/4257), done.with git+https...Updating files: 
13% (579/4257)
  done

enceladus# poudriere ports -l
PORTSTREE METHOD    TIMESTAMP           PATH
latest    git+https 2024-11-18 14:32:59 /poudriere/ports/latest
enceladus#

enceladus# cat /usr/local/etc/poudriere.conf
ZPOOL=rv64
FREEBSD_HOST=https://download.FreeBSD.org
RESOLV_CONF=/etc/resolv.conf
BASEFS=/poudriere
USE_PORTLINT=no
#
# Because the SiFive RISC-V UnMatched Rev B is limited
USE_TMPFS=no

DISTFILES_CACHE=/poudriere/distfiles
CCACHE_DIR=/var/cache/ccache
PARALLEL_JOBS=4
PREPARE_PARALLEL_JOBS=4
ALLOW_MAKE_JOBS=yes
TIMESTAMP_LOGS=no
USE_COLORS=no

# This defines the max time (in seconds) that a command may run for a build
# before it is killed for taking too long. Default: 86400
# 7 days
MAX_EXECUTION_TIME=604800

# This defines the time (in seconds) before a command is considered to
# be in a runaway state for having no output on stdout. Default: 7200
NOHANG_TIME=172800

# Define to get a predictable timestamp on the ports tree
# This is a necessary setup for reproducible builds.
PRESERVE_TIMESTAMP=yes
enceladus#

enceladus# /usr/bin/time -p idprio 0 poudriere bulk -c -r -j 150rv64 -p 
latest ports-mgmt/pkg
[00:00:01] Creating the reference jail... done
[00:00:01] Mounting system devices for 150rv64-latest
[00:00:02] Stashing existing package repository
[00:00:02] Mounting ccache from: /var/cache/ccache
[00:00:02] Mounting ports from: /poudriere/ports/latest
[00:00:02] Mounting packages from: /poudriere/data/packages/150rv64-latest
[00:00:02] Mounting distfiles from: /poudriere/distfiles
/etc/resolv.conf -> /poudriere/data/.m/150rv64-latest/ref/etc/resolv.conf
[00:00:02] Starting jail 150rv64-latest
Updating /var/run/os-release done.
[00:00:03] Will build as nobody:nobody (65534:65534)
[00:00:24] Logs: 
/poudriere/data/logs/bulk/150rv64-latest/2024-11-18_14h38m56s
[00:00:24] Loading MOVED for /poudriere/data/.m/150rv64-latest/ref/usr/ports
[00:00:30] Ports supports: FLAVORS SUBPACKAGES SELECTED_OPTIONS
[00:00:30] Inspecting ports tree for modifications to git checkout... no
[00:01:04] Ports top-level git hash: 8ae92805a7
[00:01:04] Gathering ports metadata
[00:01:04] Calculating ports order and dependencies
[00:01:04] newer version of jail, cleaning all packages... done
[00:01:05] -c specified, cleaning all packages... done
[00:01:05] Trimming IGNORED and blacklisted ports
[00:01:05] pkg bootstrap missing: unable to inspect existing packages, 
cleaning all packages... done
[00:01:05] Sanity checking the repository
[00:01:05] Deleting stale symlinks... done
[00:01:05] Deleting empty directories... done
[00:01:08] Unqueueing existing packages
[00:01:08] Unqueueing orphaned build dependencies
[00:01:09] Sanity checking build queue
[00:01:09] Processing PRIORITY_BOOST
[00:01:09] Balancing pool
[150rv64-latest] [2024-11-18_14h38m56s] [balancing_pool] Queued: 1 
Built: 0  Failed: 0  Skipped: 0  Ignored: 0  Fetched: 0  Tobuild: 1 
Time: 00:00:45
[00:01:09] Recording filesystem state for prepkg... done
[00:01:14] Building 1 packages using up to 1 builders
[00:01:14] Hit CTRL+t at any time to see build progress and stats
[00:01:14] [01] [00:00:00] Builder starting
[00:01:16] [01] [00:00:02] Builder started
[00:01:16] [01] [00:00:00] Building ports-mgmt/pkg | pkg-1.21.3
[00:22:54] [01] [00:21:38] Finished ports-mgmt/pkg | pkg-1.21.3: Success
[00:23:02] Stopping 1 builders
[00:23:03] Creating pkg repository
Creating repository in /tmp/packages: 100%
Packing files for repository: 100%
[00:23:10] Committing packages to repository: 
/poudriere/data/packages/150rv64-latest/.real_1731942126 via .latest symlink
[00:23:10] Removing old packages
[00:23:11] Built ports: ports-mgmt/pkg
[150rv64-latest] [2024-11-18_14h38m56s] [committing] Queued: 1  Built: 1 
  Failed: 0  Skipped: 0  Ignored: 0  Fetched: 0  Tobuild: 0   Time: 00:22:47
[00:23:11] Logs: 
/poudriere/data/logs/bulk/150rv64-latest/2024-11-18_14h38m56s
[00:23:12] Cleaning up
[00:23:12] Unmounting file systems
real 1397.45
user 2869.91
sys 807.36
enceladus#

That is not so bad. However lang/rust will grind for days.

I have reached out to SiFive to inquire about two units of the P550
board and who knows. Those may or may not work also.

--
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?cf610608-bd4d-4ccf-95c6-c70371cac5bb>