You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before start, here are some references about tasks in REP-002 that are related :
001: delay requirements expansion after resolve
003: Add --env option to package build tools, related to REP-002.006
006: Add requirements harden directive (new requirements expansion syntax)
010: Add recipes_path config setting
011: Implement rez-install tool and API
Allan reached out and have a quick talk about REP-002 on implementing REP-002.001 and REP-002.006 (delay requirements expansion). Which are highly related to this project. In matter of fact, this project is the implementation of REP-002.011, but in a different way.
What rez-deliver have done
- For the record, at this time being, this project is named rez-deliver. (may renamed afterward) -
Currently in rez-deliver when building a package, say package foo, rez-deliver loads all developer packages (via DeveloperPackage.from_path) into a memory repository,
and join them as normal packages with other already installed packages when resolving build-time context for foo. And recursively resolve more build-time contexts for each package from dependent package's context.resolved_packages.
Then, a full dependency list of foo has been generated with ordered, rez-deliver will start to install packages that are not yet been installed.
Now back to REP-002
From the description of REP-002, tasks 001 and 006 are parts of the prerequisites of 011, since one may have package requirement like "bar-1.*" in the developer package definition file that need to be expanded in build-time. But for the rez-install (REP-002.011), it may need to expand the requirement statement to the package that is not yet been installed. Hence REP-002.001 and REP-002.006, the expansion needs to be delayed till context resolver resolved.
However in this project, all developer packages are loaded into a memory package repository before build, so the requirement expansion can be done without a problem.
So maybe we don't have to delay it after all ? 🤔
But if we do implement the delaying, the Requirement object will have to store a few more data to let solver know that it need to be expanded after resolve and it cannot be solved with other regular requirements, owning to the VersionRange object cannot parse a range like "bar-1.*+" stated.
fromrez.vendor.version.versionimportVersionRangeprint(VersionRange("1.*+"))
# rez.vendor.version.util.VersionError: Syntax error in version range '1.*+': Syntax error in version range '1.*+'
This is an obstacle. Maybe we could convert that legacy expansion syntax "bar-1.*+" into what 006 introduced
"bar-1\\harden(2)"
before resolve, and harden(expand) it after resolve.
So say we addressed that, I guess those un-hardened requirements will be expanded with the --env bar-1.5 (REP-002.003), or iterate over recipes repository and expand it from there ?
Not sure, this need a bit more discuss.
The text was updated successfully, but these errors were encountered:
We do need this in some cases, but just for building package.
As long as all required developer packages are in place and loaded as build-time status, it doesn't matter how requirement shall change in one package.
Before start, here are some references about tasks in REP-002 that are related :
--env
option to package build tools, related to REP-002.006recipes_path
config settingrez-install
tool and APIAllan reached out and have a quick talk about REP-002 on implementing REP-002.001 and REP-002.006 (delay requirements expansion). Which are highly related to this project. In matter of fact, this project is the implementation of REP-002.011, but in a different way.
What rez-deliver have done
- For the record, at this time being, this project is named
rez-deliver
. (may renamed afterward) -Currently in
rez-deliver
when building a package, say packagefoo
,rez-deliver
loads all developer packages (viaDeveloperPackage.from_path
) into a memory repository,rez-deliver/src/deliver/pkgs.py
Line 118 in cd1ea2a
and join them as normal packages with other already installed packages when resolving build-time context for
foo
. And recursively resolve more build-time contexts for each package from dependent package'scontext.resolved_packages
.rez-deliver/src/deliver/pkgs.py
Lines 289 to 292 in cd1ea2a
Then, a full dependency list of
foo
has been generated with ordered,rez-deliver
will start to install packages that are not yet been installed.Now back to REP-002
From the description of REP-002, tasks 001 and 006 are parts of the prerequisites of 011, since one may have package requirement like
"bar-1.*"
in the developer package definition file that need to be expanded in build-time. But for therez-install
(REP-002.011), it may need to expand the requirement statement to the package that is not yet been installed. Hence REP-002.001 and REP-002.006, the expansion needs to be delayed till context resolver resolved.However in this project, all developer packages are loaded into a memory package repository before build, so the requirement expansion can be done without a problem.
So maybe we don't have to delay it after all ? 🤔
But if we do implement the delaying, the
Requirement
object will have to store a few more data to let solver know that it need to be expanded after resolve and it cannot be solved with other regular requirements, owning to theVersionRange
object cannot parse a range like"bar-1.*+"
stated.This is an obstacle. Maybe we could convert that legacy expansion syntax
"bar-1.*+"
into what 006 introducedbefore resolve, and harden(expand) it after resolve.
So say we addressed that, I guess those un-hardened requirements will be expanded with the
--env bar-1.5
(REP-002.003), or iterate over recipes repository and expand it from there ?Not sure, this need a bit more discuss.
The text was updated successfully, but these errors were encountered: