Porting Kanidm - Problems with Rust

Hi everyone,

I've recently been working to add Kanidm (it's pam/nss and cli tools) as a port. I have been following the handbook and it's chapters on rust, but I have encountered a problem when I update versions. I will say so far the process has been really good, FreeBSD seems to have one of the better approaches to rust packaging compared to other OSes, and the handbook has been a great resource :)

Currently while testing I'm using a GH_TAGNAME to target a specific commit as I work. What I notice is that when I change that commit and increase the version, that after I re-run cargo-crates + makesum, builds fail with missing dependencies.

The exact steps taken are:

Code:
ln -s platform/freebsd/client /usr/ports/security/kanidm-client
# edit /usr/ports/UIDs GIDs to add _kanidmd_unixd
cd /usr/ports/security/kanidm-client
rm Makefile.crates
# Update the GH_TAGNAME to a newer commit
make clean
make makesum
make extract
make cargo-crates > Makefile.crates
make makesum
make

At this point in the final make, the error "unable to find crate base32" is encountered.

I suspect I'm missing a step somewhere in here between the extract and cargo-crates, perhaps there is an update of the Cargo.lock that is changing a crate version, so then my Makefile.crates has the wrong versions.

All the current working ports sources are https://github.com/kanidm/kanidm/tree/master/platform/freebsd/client which I plan to commit to ports once they are working smoothly.
 
I can't replicate your issue. The only difference I have with your port is this change in Makefile.crates
Code:
-               cc-1.2.5 \
+               cc-1.2.6 \
 
I installed a new builder, reset everything and reproduced immediately.

It looks like something goes wrong with extract step so they are never actually put into the cargo-crates directory in the work environment.

Code:
root@builder:/usr/ports/security/kanidm-client # make
===>   kanidm-g20250206 depends on package: rust>=1.84.0 - found
===>   kanidm-g20250206 depends on package: pkgconf>=1.3.0_1 - found
===>  Configuring for kanidm-g20250206
===>   Additional optimization to port applied
===>   Cargo config:
[source.cargo]
directory = '/root/kanidm/platform/freebsd/client/work/kanidm-ad3cf8828f7167c83910941094fdd5acd519349d/cargo-crates'
[source.crates-io]
replace-with = 'cargo'
===>   Updating Cargo.lock
error: no matching package named `base32` found
location searched: directory source `/root/kanidm/platform/freebsd/client/work/kanidm-ad3cf8828f7167c83910941094fdd5acd519349d/cargo-crates` (which is replacing registry `crates-io`)
required by package `kanidm_proto v1.5.0-dev (/root/kanidm/platform/freebsd/client/work/kanidm-ad3cf8828f7167c83910941094fdd5acd519349d/proto)`
*** Error code 101

Stop.
make: stopped in /root/kanidm/platform/freebsd/client
root@builder:/usr/ports/security/kanidm-client # ls -al /root/kanidm/platform/freebsd/client/work/kanidm-ad3cf8828f7167c83910941094fdd5acd519349d/cargo-crates
total 9
drwxr-xr-x   2 root wheel  2 Feb  6 12:50 .
drwxr-xr-x  17 root wheel 38 Feb  6 12:50 ..


I think it may be because I run make extract first (else my makesum had weird issues at one point), so then because I didn't remove the workdir, that prevented the crates extracting.

So I think the correct steps are.

Code:
make makesum
make extract
make cargo-crates > Makefile.crates
rm -rf ./work
make makesum
make
 
Back
Top