OSS build fails with 0.16.20

Issue Description

When trying to compile for Arch Linux, the OSS build fails due to SCIM errors.

Reproduction Steps

Running the below causes issues:

# remove refs to enterprise code
python resources/scripts/ossify.py crates/
# prefetch dependencies
cargo fetch --locked --target host-tuple # fails here
# compile binary
cargo build --release --frozen -p stalwart --no-default-features --features"sqlite postgres mysql rocks s3 redis azure nats"

Relevant Log Output

Processing Rust files in: crates/

Found 957 Rust files


Summary:
- 52 files were completely removed
- 117 proprietary snippets were removed from 50 files

error: failed to load manifest for workspace member `/build/stalwart/src/stalwart/crates/main`
referenced by workspace at `/build/stalwart/src/stalwart/Cargo.toml`

Caused by:
  failed to load manifest for dependency `http`

Caused by:
  failed to load manifest for dependency `scim`

Caused by:
  failed to parse manifest at `/build/stalwart/src/stalwart/crates/scim/Cargo.toml`

Caused by:
  no targets specified in the manifest
  either src/lib.rs, src/main.rs, a [lib] section, or [[bin]] section must be present

Stalwart Version

v0.16.x

Installation Method

Built from source

Database Backend

RocksDB

Blob Storage

RocksDB

Search Engine

Internal

Directory Backend

Internal

I have reviewed the documentation and FAQ and confirm that my issue is NOT addressed there.

on

I have searched this support forum (open and closed topics) and confirm this is not a duplicate.

on

I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.

on

I confirmed the root cause in the source. The scim crate’s lib.rs in crates/scim/src/lib.rs has SPDX-License-Identifier: LicenseRef-SEL in its very first comment block:

/*
 * SPDX-FileCopyrightText: 2020 Stalwart Labs LLC <[email protected]>
 *
 * SPDX-License-Identifier: LicenseRef-SEL
 */

#[cfg(feature = "enterprise")]
pub mod auth;
...

resources/scripts/ossify.py deletes any .rs file whose first comment block contains that SPDX identifier (should_remove_file), rather than only stripping the individual #[cfg(feature = "enterprise")]-gated snippets. Because the whole file is tagged that way (even though its contents are just feature-gated module declarations), the entire lib.rs gets removed, leaving crates/scim with a Cargo.toml but no src/lib.rs/[lib] section, which is exactly the “no targets specified in the manifest” error you’re hitting.

This looks like a genuine issue with the ossify script/crate layout rather than something you can work around via configuration. I’ve gathered the details above; a human maintainer will need to follow up on fixing the script or the crate’s licensing header so the OSS build doesn’t strip the whole scim lib file.

This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.

This has been fixed on the main branch.