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

feat: add sovereign.toml manifest file #792

Merged
merged 7 commits into from
Sep 7, 2023
Merged

Conversation

vlopes11
Copy link
Contributor

@vlopes11 vlopes11 commented Sep 4, 2023

Description

This commit introduces a manifest file that can be parsed by derive macros and have its contents read at compile-time.

It will read recursively the directory of the call site of the macro until it either finds a sovereign.toml file, or the path is depleted.

The implementation for the source file location of proc macros depends on procmacro2_semver_exempt, and it will fallback to the manifest path of the sov-modules-macros library. The fallback may contain multiple edge cases as cargo will cache the downloaded crate into a $HOME/.cargo dir, making a recursion tree impossible to reach the workspace under normal circumstances.

The aforementioned problem will be handled on the issue #786

Linked Issues

Testing

A unit test will read a dummy sovereign.toml file and parse it.

Docs

N/A

This commit introduces a manifest file that can be parsed by derive
macros and have its contents read at compile-time.

It will read recursively the directory of the call site of the
macro until it either finds a `sovereign.toml` file, or the path is
depleted.

The implementation for the source file location of proc macros depends
on `procmacro2_semver_exempt`, and it will fallback to the manifest path
of the `sov-modules-macros` library. The fallback may contain multiple
edge cases as cargo will cache the downloaded crate into a
`$HOME/.cargo` dir, making a recursion tree impossible to reach the
workspace under normal circumstances.

The aforementioned problem will be handled on the issue #786
@codecov
Copy link

codecov bot commented Sep 4, 2023

Codecov Report

Merging #792 (a3fb2b9) into nightly (1adbfc9) will decrease coverage by 0.1%.
The diff coverage is 61.8%.

Files Changed Coverage Δ
module-system/sov-modules-macros/src/lib.rs 100.0% <ø> (ø)
module-system/sov-modules-macros/src/manifest.rs 61.8% <61.8%> (ø)

... and 1 file with indirect coverage changes

@vlopes11 vlopes11 mentioned this pull request Sep 4, 2023
@vlopes11 vlopes11 added this pull request to the merge queue Sep 7, 2023
Merged via the queue into nightly with commit 2242b67 Sep 7, 2023
12 checks passed
@vlopes11 vlopes11 deleted the vlopes11/feature/manifest branch September 7, 2023 11:11
preston-evans98 pushed a commit that referenced this pull request Sep 14, 2023
* feat: add sovereign.toml manifest file

This commit introduces a manifest file that can be parsed by derive
macros and have its contents read at compile-time.

It will read recursively the directory of the call site of the
macro until it either finds a `sovereign.toml` file, or the path is
depleted.

The implementation for the source file location of proc macros depends
on `procmacro2_semver_exempt`, and it will fallback to the manifest path
of the `sov-modules-macros` library. The fallback may contain multiple
edge cases as cargo will cache the downloaded crate into a
`$HOME/.cargo` dir, making a recursion tree impossible to reach the
workspace under normal circumstances.

The aforementioned problem will be handled on the issue #786

* update manifest fn to return computed path

* fix unit tests for manifest path

* adjust link check for manifest test
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.

2 participants