-
Notifications
You must be signed in to change notification settings - Fork 202
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
refactor: project model using targets, features and environments #616
Merged
ruben-arts
merged 7 commits into
prefix-dev:main
from
baszalmstra:refactor/project_model
Jan 6, 2024
Merged
refactor: project model using targets, features and environments #616
ruben-arts
merged 7 commits into
prefix-dev:main
from
baszalmstra:refactor/project_model
Jan 6, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[target.win-64.hostdependencies] Is now accepted but before it would throw:
|
@ruben-arts Should be fixed now! |
ruben-arts
approved these changes
Jan 5, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazinggggggggggg
ruben-arts
approved these changes
Jan 6, 2024
ruben-arts
approved these changes
Jan 6, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First refactor to support multiple environments.
This PR refactors the internal project model and adapts the code to use it. The concept of a
Feature
and aTarget
is introduced. At the moment when parsing the project manifest a "default" feature is created which is used throughout the code.Note
to reviewers, this is a first PR of a few to come. I want to quickly and iteratively land PRs. This is not the final result.
Feature
In the multi-env story
Feature
s describe a set of dependencies/tasks/etc. This concept was also introduced in the project model. At the moment there is only one default feature (described by all the keys at the root of the toml) but the project model already supports multiple features which we can use in a follow-up PR.Target
A target encapsulates everything that you can find in for instance a
[target.win-64]
table. The same datastructure is reused for elements "at the root" e.g.[dependencies]
is internally rewritten to
where "default" has a special meaning.
Targets
is a datastructure that encapsulates a collection of targets and allows querying which targets apply in certain situations. E.g.Targets
will hold twoTarget
s, the default target ([dependencies]
) and thelinux-64
target. You can request all applicable targets for a certain platform and it will return these two targets in order of most specific first.Environment
Environment
is already part of the model (with a default one being created) but it is not yet used throughout the rest of the code. A followup PR will refactor the codebase to always useEnvironment
s to derive the tasks, dependencies and system-requirements currently available.Tests
The PR refactors a lot of snapshot tests. Since the project model is now very different from the toml layout the debug snapshots
often didnt make a whole lot of sense. I changed most of the tests to more closely verify the actual expected result of certain operations instead of "just" outputting a snapshot. Hopefully this makes them less prone to change with future iterations.