Skip to content

Conversation

@Kasama
Copy link

@Kasama Kasama commented Oct 15, 2025

Description of Changes

API and ABI breaking changes

Expected complexity level and risk

Testing

@bfops bfops self-requested a review October 15, 2025 17:26
@bfops
Copy link
Collaborator

bfops commented Oct 15, 2025

The tests are failing. I think several of them just need a Cargo.lock update, but at least one seems to be failing for an unknown subcommand.

@bfops bfops added release-any To be landed in any release window no runtime change This change does not affect the final binaries labels Oct 20, 2025
run: |
apt-get update
apt-get install -y acl curl ca-certificates
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this part is already done below?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did we mean to replace parts of the below with cargo ci?


match cli.cmd {
Some(CiCmd::Test) => {
run!("sudo mkdir -p /stdb && sudo chmod 777 /stdb")?;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be part of the CI still? I'm pretty sure we don't want to do this if running it on local machines.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked locally and it looks like this directory isn't even used by the test. I think we can probably remove it

Some(CiCmd::Smoketests { args }) => {
// Note: clear_database and replication only work in private
run!(&format!(
"python -m smoketests {} -x clear_database replication",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kind of think that the tests to skip should be a parameter, since we may not always want to skip the same things

default_value = "true",
long_help = "Whether to enable github token authentication feature when building the update binary. By default this is enabled."
)]
github_token_auth: bool,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I kind of think this should default to false so that people running this outside of CI don't get errors about the env var not being defined.

run!("for p in \"$GITHUB_WORKSPACE\" \"${RUNNER_TEMP:-/__t}\" \"${RUNNER_TOOL_CACHE:-/__t}\"; do [ -d \"$p\" ] && setfacl -R -m u:ue4:rwX -m d:u:ue4:rwX \"$p\" || true; done")?;

run!("export CARGO_HOME=\"${RUNNER_TOOL_CACHE:-/__t}/cargo\"")?;
run!("export RUSTUP_HOME=\"${RUNNER_TOOL_CACHE:-/__t}/rustup\"")?;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI I think a lot of this doesn't apply to users running these tests locally


Some(CiCmd::CliDocs) => {
run!("pnpm install --recursive")?;
run!("cargo run --features markdown-docs -p spacetimedb-cli > docs/docs/cli-reference.md")?;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that this assumes we're running from the root directory

run: |
apt-get update
apt-get install -y acl curl ca-certificates
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did we mean to replace parts of the below with cargo ci?

run: cargo ci self-docs --check

cli_docs:
name: Check CLI docs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume we want to replace this one with a cargo ci invocation as well?

@@ -0,0 +1,4 @@
#[allow(clippy::disallowed_macros)]
fn main() {
println!("cargo:rustc-env=TARGET={}", std::env::var("TARGET").unwrap_or_default());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's this part for?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this allows for the default parameter for target on the update-flow. Mostly for running it locally without needing to specify that flag manually.

let target = target.unwrap_or_else(|| env!("TARGET").to_string());

Copy link
Collaborator

@bfops bfops Oct 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah gotcha. in that case, nit: we could either use the variables that are provided already:

const ARCH: &str = env!("CARGO_CFG_TARGET_ARCH");
const OS: &str = env!("CARGO_CFG_TARGET_OS");
const ENV: &str = env!("CARGO_CFG_TARGET_ENV");

or we could only pass --target {target} to cargo build if it's provided by the user.

I kind of prefer that last option. It seems intuitive still.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(honestly I'm not 100% sure that we even need the target param.. I think the default on each platform might be the one we want anyway.. but we should keep it for now just for parity with the original CI).

let mut env = env::vars().collect::<HashMap<_, _>>();
env.extend(additional_env.iter().map(|(k, v)| (k.to_string(), v.to_string())));
log::debug!("$ {cmdline}");
let status = cmd!("bash", "-lc", cmdline).full_env(env).run()?;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI I'm not 100% sure how this will work on windows


use crate::Cli;

pub fn generate_cli_docs() -> String {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: any chance we could use clap_markdown like we do for the SpacetimeDB CLI docs?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed. I didn't notice that we had that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no runtime change This change does not affect the final binaries release-any To be landed in any release window

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants