Skip to content

Commit

Permalink
Support non optimized builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Filippo Cremonese committed Aug 30, 2021
1 parent 54f1c1e commit b1b332e
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 20 deletions.
21 changes: 13 additions & 8 deletions .orchestra/ci/ci-hook/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def get_env_or_fail(var_name):
mapping = config["github_to_gitlab_mapping"]
default_user = config["default_user"]
ci_user = config["ci_user"]
revng_components_build_names = ["optimized", "debug", "release"]

ORCHESTRA_CONFIG_REPO_HTTP_URL = config["orchestra_config_repo_http_url"]
ORCHESTRA_CONFIG_REPO_SSH_URL = config["orchestra_config_repo_ssh_url"]
Expand Down Expand Up @@ -122,14 +123,18 @@ def trigger_ci(username, repo_url, ref, before, after):
variables["SSH_PRIVATE_KEY"] = revng_push_ci_private_key
variables["PUSH_CHANGES"] = "1"

parameters = {
"ref": BRANCH,
"variables": [{"key": key, "value": value}
for key, value
in variables.items()]
}
print(json.dumps(parameters, indent=2))
pipeline = project.pipelines.create(parameters)
# Create a job for each build name
for default_build_name in revng_components_build_names:
variables["REVNG_COMPONENTS_DEFAULT_BUILD"] = default_build_name

parameters = {
"ref": BRANCH,
"variables": [{"key": key, "value": value}
for key, value
in variables.items()]
}
print(json.dumps(parameters, indent=2))
pipeline = project.pipelines.create(parameters)


@app.route('/ci-hook/gitlab', methods=["POST"])
Expand Down
10 changes: 8 additions & 2 deletions .orchestra/ci/ci-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
# PROMOTE_BRANCHES: if == 1, promote next-* branches
# PUSH_CHANGES:
# if == 1, push binary archives and promote next-* branches
# REVNG_COMPONENTS_DEFAULT_BUILD: the default build for revng core components
# PUSH_BINARY_ARCHIVE_EMAIL: used as author's email in binary archive commit
# PUSH_BINARY_ARCHIVE_NAME: used as author's name in binary archive commit
# SSH_PRIVATE_KEY: private key used to push binary archives
Expand Down Expand Up @@ -139,7 +140,7 @@ if test -n "$TARGET_COMPONENTS_URL"; then
| grep '^Component' \
| cut -d' ' -f2)"
if test -z "$NEW_COMPONENT"; then
log "Warning: ignoring URL $TARGET_COMPONENT_URL since it doesn't match any component"
log_err "Warning: ignoring URL $TARGET_COMPONENT_URL since it doesn't match any component"
else
TARGET_COMPONENTS="$NEW_COMPONENT $TARGET_COMPONENTS"
fi
Expand Down Expand Up @@ -175,7 +176,12 @@ cat >> "$USER_OPTIONS" <<EOF
- master
EOF

# Print debug information
# Set default builds
if [[ -n "$REVNG_COMPONENTS_DEFAULT_BUILD" ]]; then
echo "#@overlay/replace" >> "$USER_OPTIONS"
echo "revng_components_default_build: $REVNG_COMPONENTS_DEFAULT_BUILD" >> "$USER_OPTIONS"
fi

log "User options:"
cat "$USER_OPTIONS"

Expand Down
3 changes: 2 additions & 1 deletion .orchestra/config/components/caliban.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#@ load("@ytt:data", "data")
#@ load("@ytt:overlay", "overlay")

#@ load("/lib/cmake.lib.yml", "cmake_boost_configuration", "typical_cmake_builds")
Expand Down Expand Up @@ -29,5 +30,5 @@ components:
repository: caliban
license: LICENSE.md
binary_archives: private
default_build: optimized
default_build: #@ data.values.revng_components_default_build
builds: #@ typical_cmake_builds(**build_args())
2 changes: 1 addition & 1 deletion .orchestra/config/components/llvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#@ def llvm_component(use_asan=False):
repository: llvm-project
license: llvm/LICENSE.TXT
default_build: optimized
default_build: #@ data.values.revng_components_default_build
builds:
#@ for flavor, f_options in typical_project_flavors(use_asan=use_asan).items():
#@ build_type = f_options["cmake_build_type"]
Expand Down
2 changes: 1 addition & 1 deletion .orchestra/config/components/qemu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#@ def qemu_component(use_asan=False):
repository: qemu
license: LICENSE
default_build: optimized
default_build: #@ data.values.revng_components_default_build
builds:
#@ for flavor, f_options in typical_project_flavors(use_asan=use_asan).items():
#@ build_type = f_options["cmake_build_type"]
Expand Down
3 changes: 2 additions & 1 deletion .orchestra/config/components/revng.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#@ load("@ytt:data", "data")
#@ load("@ytt:overlay", "overlay")
#@ load("/lib/cmake.lib.yml", "cmake_boost_configuration", "typical_cmake_builds")

Expand Down Expand Up @@ -26,5 +27,5 @@ components:
revng:
repository: revng
license: LICENSE.md
default_build: optimized
default_build: #@ data.values.revng_components_default_build
builds: #@ typical_cmake_builds(**build_args())
3 changes: 2 additions & 1 deletion .orchestra/config/components/revng_c.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#@ load("@ytt:data", "data")
#@ load("@ytt:overlay", "overlay")
#@ load("/lib/cmake.lib.yml", "cmake_boost_configuration", "typical_cmake_builds")

Expand All @@ -24,6 +25,6 @@ components:
revng-c:
repository: revng-c
license: LICENSE.md
default_build: optimized
default_build: #@ data.values.revng_components_default_build
binary_archives: private
builds: #@ typical_cmake_builds(**build_args())
3 changes: 2 additions & 1 deletion .orchestra/config/components/ui/adaptagrams.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#@ load("@ytt:data", "data")
#@ load("@ytt:overlay", "overlay")
#@ load("/lib/cmake.lib.yml", "typical_cmake_builds")

Expand All @@ -19,5 +20,5 @@ components:
ui/adaptagrams:
repository: ui-adaptagrams
license: README.md
default_build: optimized
default_build: #@ data.values.revng_components_default_build
builds: #@ typical_cmake_builds(**build_args())
3 changes: 2 additions & 1 deletion .orchestra/config/components/ui/cold_revng.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#@ load("@ytt:data", "data")
#@ load("@ytt:overlay", "overlay")
#@ load("@ytt:template", "template")

Expand Down Expand Up @@ -39,5 +40,5 @@ components:
repository: ui-cold-revng
license: LICENSE.md
binary_archives: private
default_build: optimized
default_build: #@ data.values.revng_components_default_build
builds: #@ typical_cmake_builds(**build_args())
2 changes: 1 addition & 1 deletion .orchestra/config/components/ui/qt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
---
#@ def qt_component():
license: LICENSE.GPLv3
default_build: optimized
default_build: #@ data.values.revng_components_default_build
builds:
#@ for flavor, opts in qt_optimization_flavors.items():
#@ extra_qmake_options = opts["extra_qmake_options"]
Expand Down
3 changes: 2 additions & 1 deletion .orchestra/config/components/ui/qt_creator.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#@ load("@ytt:data", "data")
#@ load("@ytt:overlay", "overlay")
#@ load("/lib/make.lib.yml", "make")
#@ load("/lib/shell.lib.yml", "expand_args")
Expand Down Expand Up @@ -41,7 +42,7 @@
#@ def qt_creator_component():
repository: ui-qt-creator
license: LICENSE.GPL3-EXCEPT
default_build: optimized
default_build: #@ data.values.revng_components_default_build
builds:
#@ for flavor, opts in qmake_optimization_flavors.items():
#@ extra_qmake_args = opts["extra_qmake_args"]
Expand Down
3 changes: 2 additions & 1 deletion .orchestra/config/components/ui/quickqanava.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#@ load("@ytt:data", "data")
#@ load("@ytt:overlay", "overlay")
#@ load("/lib/cmake.lib.yml", "cmake_boost_configuration", "typical_cmake_builds")

Expand All @@ -22,5 +23,5 @@ components:
ui/quickqanava:
repository: ui-quickqanava
license: licence.txt
default_build: optimized
default_build: #@ data.values.revng_components_default_build
builds: #@ typical_cmake_builds(**build_args())
2 changes: 2 additions & 0 deletions .orchestra/config/global_options.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ branches:
- develop
- master
nonredistributable_base_url: "https://dummydomain.com/nonredistributable/"

revng_components_default_build: optimized

0 comments on commit b1b332e

Please sign in to comment.