Skip to content

Conversation

@bjoernQ
Copy link
Contributor

@bjoernQ bjoernQ commented Dec 12, 2025

This explores the idea of #4532

It's using a local registry (in the file system) instead of using a full-fledged registry. This makes things much more lightweight.

Instead of trying to "bend" things to use our registry for our crates only, this is using source replacement.
This makes things much easier and even more important: more realistic.

In theory this is violating one of the assumption Cargo has about it.

Cargo has a core assumption about source replacement that the source code is exactly the same from both sources. Note that this also means that a replacement source is not allowed to have crates which are not present in the original source.

This makes totally sense for regular use but I'd say in our case it's okay (and it a very temporary thing).

Since cargo is aware of the replacement it won't mix up the registries in it's cache - the worst to happen might be ending up with some orphaned directories in the Cargo cache.

This is not integrated into any of the release related tasks (yet) - it's just available as a set of xtask commands. But it already allows to estimate the consequences of updates. (the README.md in compile-tests hopefully explains things well enough)

We might want / need to add some more test projects under the compile-tests folder to get a better coverage of different targets and feature sets. (But for the now this would just add noise - so I kept things simple)

It would be good if this could get tested in different environments - on my side I tested it in Windows and WSL2.

Pretty sure there are still some rough edges we should flesh out before integrating this more.

(The code is POC-quality currently - I'm more interesting in someone else to try and play with it before polishing and nit-picking )

@bjoernQ bjoernQ added the skip-changelog No changelog modification needed label Dec 12, 2025
@MabezDev
Copy link
Member

This is really cool! Thanks for experimenting with this. Using local registries is a good idea, I forgot that I've already played with them this year with those semver experiments :D.

I need to play around with this a bit before I start reviewing but I have some initial thoughts.

Can we reuse our current test suite and examples? We have great coverage already, it would be great to reuse these in the "release test" instead of separate compile tests. Note that I'm happy for this to land with separate tests with a view to reusing the tests later.

@bjoernQ
Copy link
Contributor Author

bjoernQ commented Dec 12, 2025

Can we reuse our current test suite and examples? We have great coverage already, it would be great to reuse these in the "release test" instead of separate compile tests.

Probably yes - after some pre-processing we should be able to check with the "upcoming" release - maybe in addition to the (hopefully) zero-maintenance compile-tests.

I already just identified one thing where the compile-tests idea is lacking: e.g. renaming extern "C" fn malloc in esp-alloc won't break the test since the compiler is smart enough to not include the code which is actually using it in the linker step.

Copy link
Member

@SergioGasquez SergioGasquez left a comment

Choose a reason for hiding this comment

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

I was able to run the tests on my machine, the README was very useful and made things very easy! Thanks! Left a few comments/nitpicks!

let _ = std::fs::create_dir("compile-tests/.cargo");

std::fs::write(
"compile-tests/.cargo/config.toml",
Copy link
Member

Choose a reason for hiding this comment

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

Should we add this to .gitignore?

Copy link
Contributor Author

@bjoernQ bjoernQ Jan 2, 2026

Choose a reason for hiding this comment

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

I'm undecided what would cause more harm: unintentional commits or forgetting to commit something which should get committed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh sorry - that file is not changed but created just for the processing .... will add it to the ignore list

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

Labels

skip-changelog No changelog modification needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants