xous-core/imports
Aaron Bieber 6f98940189 Switch to using env to find the path to bash.
Systems like OpenBSD and NixOS have bash in different locations. This
allows the various scripts to be run on those systems.
2022-03-28 16:43:47 -06:00
..
com_rs-ref improve the link sync-up for the EC after a WF200 reset 2022-01-31 23:32:59 +08:00
riscv-0.5.6 Switch to using env to find the path to bash. 2022-03-28 16:43:47 -06:00
README.md Update README.md 2021-04-07 01:27:23 +08:00

Imports

Build Not Working: Why You're Most Likely Looking at This

If your build isn't working due to a failed import reference, it's probably because one of the xous-core developers accidentally checked in a reference to a local directory in one or more of the Cargo.toml files within this subdirectory.

Most likely, you can find the offending Cargo.toml file, and remove the local directory reference and replace it with the commented-out gitref. In the worst case, the developer failed to push up changes in the dependant crate, at which point you should open an issue to get that fixed.

#TIL: patch.crates-io

When we did this, we didn't know there was a thing such as [patch.crates-io] that allows for overrides in cargo paths. Probably this system should be refactored to use this, instead of the methodology outlined here.

Rationale

We depend upon some packages that aren't in crates.io yet, but are also not integrated into the xous-core repo. Reasons for this range from the preference of the package's originator, to local cross-project dependencies (such as the com-rs package, which is the API between the betrusted-ec firmware and xous-core) that don't make sense to publish as a crate.

These are instead hosted in a separate, standa-lone github repo. The methodology in this case is to refer to the git commit ref in the Cargo.toml for xous-core integration.

However, we have situations where multiple crates within xous-core need to refer to the same git commit ref, which leads to the opportunity for inconsistent versions between sub-crates within xous-core.

imports are simple packages that re-export the contents of a stand-alone package, allowing us a single location, common to all sub-crates within xous-core, to define a single git commit ref. For local development, the git commit ref is replaced with a local directory path.

The convention is to name the imported package based upon its root name and then add -ref to the end, and then to use import-ref as import to resolve the import into the correct name space.