Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(config-migration) Add do_migrate_from_v0() implementation #1725

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

duckinator
Copy link
Contributor

@duckinator duckinator commented Jan 23, 2025

starting Cargo.toml
[package]
name = "axolotlsay"
description = "💬 a CLI for learning to distribute CLIs in rust"
version = "0.2.275"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/mistydemeo/cargodisttest.git"
homepage = "https://github.com/mistydemeo/cargodisttest"

[dependencies]
clap = { version = "4.1.4", features = ["derive"] }
unicode-width = "0.1.10"

[dev-dependencies]
assert_cmd = "2.0.8"

# Config for 'dist'
[workspace.metadata.dist]
# The preferred dist version to use in CI (Cargo.toml SemVer syntax)
cargo-dist-version = "0.25.1"
# CI backends to support
ci = "github"
# The installers to generate for each app
installers = ["shell", "powershell"]
# Target platforms to build apps for (Rust target-triple syntax)
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc"]
# Which actions to run on pull requests
pr-run-mode = "plan"
# Where to host releases
hosting = "github"
# Whether to install an updater program
install-updater = true
# Whether to enable GitHub Attestations
#github-attestations = true
# Path that installers should place binaries in
install-path = "CARGO_HOME"
# Whether to sign macOS executables
macos-sign = false
# Whether to embed dependency information using cargo-auditable
cargo-auditable = true

[workspace.metadata.dist.aliases]
axolotlsay = ["cargodisttest"]

[workspace.metadata.dist.dependencies.homebrew]
cmake = '*'
libcue = "2.2.1"

[workspace.metadata.dist.dependencies.apt]
cmake = '*'
libcue-dev = '*'

[workspace.metadata.dist.dependencies.chocolatey]
lftp = '*'
cmake = '3.27.6'

[workspace.metadata.dist.github-custom-runners]
x86_64-unknown-linux-gnu = "ubuntu-latest"
dist migrate (without DIST_V1=true)
~/dev/axodotdev/cargodisttest main+ dist migrate
migrating dist config from Cargo.toml to dist-workspace.toml...
~/dev/axodotdev/cargodisttest main+ git --no-pager diff
diff --git a/Cargo.toml b/Cargo.toml
index be3df3e..839cb04 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,46 +13,3 @@ unicode-width = "0.1.10"
 
 [dev-dependencies]
 assert_cmd = "2.0.8"
-
-# Config for 'dist'
-[workspace.metadata.dist]
-# The preferred dist version to use in CI (Cargo.toml SemVer syntax)
-cargo-dist-version = "0.25.1"
-# CI backends to support
-ci = "github"
-# The installers to generate for each app
-installers = ["shell", "powershell"]
-# Target platforms to build apps for (Rust target-triple syntax)
-targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc"]
-# Which actions to run on pull requests
-pr-run-mode = "plan"
-# Where to host releases
-hosting = "github"
-# Whether to install an updater program
-install-updater = true
-# Whether to enable GitHub Attestations
-#github-attestations = true
-# Path that installers should place binaries in
-install-path = "CARGO_HOME"
-# Whether to sign macOS executables
-macos-sign = false
-# Whether to embed dependency information using cargo-auditable
-cargo-auditable = true
-
-[workspace.metadata.dist.aliases]
-axolotlsay = ["cargodisttest"]
-
-[workspace.metadata.dist.dependencies.homebrew]
-cmake = '*'
-libcue = "2.2.1"
-
-[workspace.metadata.dist.dependencies.apt]
-cmake = '*'
-libcue-dev = '*'
-
-[workspace.metadata.dist.dependencies.chocolatey]
-lftp = '*'
-cmake = '3.27.6'
-
-[workspace.metadata.dist.github-custom-runners]
-x86_64-unknown-linux-gnu = "ubuntu-latest"
~/dev/axodotdev/cargodisttest main+ cat dist-workspace.toml 
[workspace]
members = ["cargo:."]

# Config for 'dist'
[dist]
# The preferred dist version to use in CI (Cargo.toml SemVer syntax)
cargo-dist-version = "0.25.1"
# CI backends to support
ci = "github"
# The installers to generate for each app
installers = ["shell", "powershell"]
# Target platforms to build apps for (Rust target-triple syntax)
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc"]
# Which actions to run on pull requests
pr-run-mode = "plan"
# Where to host releases
hosting = "github"
# Whether to install an updater program
install-updater = true
# Whether to enable GitHub Attestations
#github-attestations = true
# Path that installers should place binaries in
install-path = "CARGO_HOME"
# Whether to sign macOS executables
macos-sign = false
# Whether to embed dependency information using cargo-auditable
cargo-auditable = true

[dist.aliases]
axolotlsay = ["cargodisttest"]

[dist.dependencies.homebrew]
cmake = '*'
libcue = "2.2.1"

[dist.dependencies.apt]
cmake = '*'
libcue-dev = '*'

[dist.dependencies.chocolatey]
lftp = '*'
cmake = '3.27.6'

[dist.github-custom-runners]
x86_64-unknown-linux-gnu = "ubuntu-latest"
~/dev/axodotdev/cargodisttest main+
DIST_V1=true dist migrate

@duckinator duckinator force-pushed the migrate-from-v0 branch 2 times, most recently from 2a8fc06 to 30c9a66 Compare January 25, 2025 03:16
@duckinator
Copy link
Contributor Author

DIST_V1=true results in this very useful error:

~/dev/axodotdev/cargodisttest main+ DIST_V1=true dist migrate
migrating dist config from Cargo.toml to dist-workspace.toml...

  × unsupported unit type

... so clearly more work is needed on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant