Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
orchestra-v3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alessandro Di Federico
orchestra-v3
Commits
d95a13fc
Commit
d95a13fc
authored
4 years ago
by
Filippo Cremonese
Browse files
Options
Downloads
Patches
Plain Diff
Fixed component recursive hash computation
parent
46a31077
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
orchestra/model/configuration.py
+13
-6
13 additions, 6 deletions
orchestra/model/configuration.py
with
13 additions
and
6 deletions
orchestra/model/configuration.py
+
13
−
6
View file @
d95a13fc
...
...
@@ -243,19 +243,26 @@ def set_build_hash(build: "bld.Build"):
if
build
.
recursive_hash
is
not
None
:
return
# The recursive hash of a build depends on all its configure and install dependencies
all_builds
=
{
d
.
build
for
d
in
build
.
configure
.
external_dependencies
}
# TODO: are install dependencies required to be part of the information to hash?
# In theory they should not influence the artifacts
all_builds
.
update
({
d
.
build
for
d
in
build
.
install
.
external_dependencies
})
all_builds
=
{
b
for
b
in
all_builds
if
b
.
component
is
not
build
.
component
}
# TODO: should all other builds from the same component be filtered out or just the very same build?
# all_builds = {b for b in all_builds if b.component is not build.component}
# Filter out the same build
all_builds
=
[
b
for
b
in
all_builds
if
b
!=
build
]
# Ensure all dependencies
hashes are
computed
# Ensure
the recursive hash of
all dependencies
is
computed
for
b
in
all_builds
:
set_build_hash
(
b
)
sorted_dependencies
=
[(
b
.
qualified_name
,
b
)
for
b
in
all_builds
]
sorted_dependencies
.
sort
()
# sorted_dependencies = [(b.qualified_name, b) for b in all_builds]
# sorted_dependencies.sort()
all_builds
.
sort
(
key
=
lambda
b
:
b
.
qualified_name
)
to_hash
=
build
.
self_hash
for
_
,
b
in
sorted_dependencie
s
:
to_hash
+=
b
.
self
_hash
for
b
in
all_build
s
:
to_hash
+=
b
.
recursive
_hash
build
.
recursive_hash
=
hashlib
.
sha1
(
to_hash
.
encode
(
"
utf-8
"
)).
hexdigest
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment