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

Migrate to config 1.0 #1533

Open
mistydemeo opened this issue Nov 7, 2024 · 1 comment
Open

Migrate to config 1.0 #1533

mistydemeo opened this issue Nov 7, 2024 · 1 comment
Milestone

Comments

@mistydemeo
Copy link
Contributor

Internally, we've migrated to the planned 1.0 config format - we parse the original format, then do a conversion to the new structure. The new structure is set up with serialization and deserialization routes that makes it theoretically possible to read the new files - but nothing is set up to actually do so. Our final steps to complete this migration will be:

  • Introduce parallel deserialization of both config formats. We need to keep being able to read the old format to report to users that they need to upgrade, and so that we can:
  • Use dist init to read the old config format and migrate to the new one, and then use that new format as the basis for edits we make to the user's config files on their behalf. This should allow us to painlessly migrate everyone to the new format.

My plan is that when we introduce this, any commands except init will refuse to run if they're loaded from the old config files, but can use that as information to notify users that they need to upgrade via dist init.

@ashleygwilliams ashleygwilliams added this to the 0.27.0 milestone Nov 7, 2024
@mistydemeo
Copy link
Contributor Author

I did a quick look at the TomlLayer to confirm, and we are definitely set for serializing and deserializing it from TOML files. Here's a sample of taking dist's own existing v0 config, passing it through the TomlLayer upconversion carousel, and then serializing it to disk.

dist-version = "0.24.1"
targets = [
    "aarch64-apple-darwin",
    "aarch64-unknown-linux-gnu",
    "aarch64-unknown-linux-musl",
    "x86_64-apple-darwin",
    "x86_64-unknown-linux-gnu",
    "x86_64-unknown-linux-musl",
    "x86_64-pc-windows-msvc",
]

[[artifacts.extra]]
build = [
    "cargo",
    "run",
    "--release",
    "--",
    "dist",
    "manifest-schema",
    "--output=dist-manifest-schema.json",
]
artifacts = ["dist-manifest-schema.json"]

[ci]
pr-run-mode = "plan"
publish-jobs = ["./publish-crates"]

[ci.github.runners]
aarch64-unknown-linux-gnu = "buildjet-8vcpu-ubuntu-2204-arm"
aarch64-unknown-linux-musl = "buildjet-8vcpu-ubuntu-2204-arm"

[hosts]
axodotdev = true

[hosts.github]
attestations = true

[installers]
install-path = "CARGO_HOME"
powershell = true
shell = true
updater = false

[installers.bin-aliases]
dist = ["cargo-dist"]

[installers.homebrew]
tap = "axodotdev/homebrew-tap"

[installers.npm]
scope = "@axodotdev"

[publishers]
homebrew = true
npm = true

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

No branches or pull requests

2 participants