Skip to content

Commit

Permalink
Build on Azure Linux 3.0 (#6567)
Browse files Browse the repository at this point in the history
  • Loading branch information
achamayou authored Oct 21, 2024
1 parent 65fe3d8 commit 94f65a2
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 23 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,23 +94,40 @@ jobs:
if-no-files-found: ignore
if: success() || failure()

build_libstdcxx:
build_azure_linux:
name: "Azure Linux CI"
needs: checks
runs-on: [self-hosted, 1ES.Pool=gha-virtual-ccf-sub]
container:
image: ghcr.io/microsoft/ccf/ci/default:build-08-10-2024
image: mcr.microsoft.com/azurelinux/base/core:3.0
options: --user root --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE -v /lib/modules:/lib/modules:ro

steps:
- name: "Install dependencies"
run: |
set -ex
gpg --import /etc/pki/rpm-gpg/MICROSOFT-RPM-GPG-KEY
tdnf -y update
# Source control
tdnf -y install ca-certificates git
# Build tools
tdnf -y install build-essential clang cmake ninja-build which
# Dependencies
tdnf -y install openssl-devel libuv-devel
# Test dependencies
tdnf -y install libarrow-devel parquet-libs-devel
shell: bash

- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: "Build Debug with libstdc++"
- name: "Build Debug"
run: |
set -ex
git config --global --add safe.directory /__w/CCF/CCF
mkdir build
cd build
cmake -GNinja -DCOMPILE_TARGET=virtual -DCMAKE_BUILD_TYPE=Debug -DLVI_MITIGATIONS=OFF -DUSE_LIBCXX=OFF ..
CC=`which clang` CXX=`which clang++` cmake -GNinja -DCOMPILE_TARGET=virtual -DCMAKE_BUILD_TYPE=Debug -DLVI_MITIGATIONS=OFF -DUSE_LIBCXX=OFF ..
ninja
shell: bash
1 change: 1 addition & 0 deletions include/ccf/crypto/base64.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the Apache 2.0 License.
#pragma once

#include <cstdint>
#include <string>
#include <vector>

Expand Down
2 changes: 1 addition & 1 deletion include/ccf/ds/contiguous_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ namespace ccf::ds

bool contains(const T& t) const
{
return find_internal(t) != end();
return find_internal(t) != end().it;
}

ConstIterator find(const T& t) const
Expand Down
1 change: 1 addition & 0 deletions include/ccf/ds/json.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "ccf/ds/json_schema.h"

#define FMT_HEADER_ONLY
#include <cstdint>
#include <fmt/format.h>
#include <fmt/ranges.h>
#include <sstream>
Expand Down
8 changes: 5 additions & 3 deletions include/ccf/pal/attestation.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,11 @@ namespace ccf::pal
const snp::EndorsementsServers& endorsements_servers = {})
{
endorsement_cb(
{
.format = QuoteFormat::insecure_virtual,
},
{.format = QuoteFormat::insecure_virtual,
.quote = {},
.endorsements = {},
.uvm_endorsements = {},
.endorsed_tcb = {}},
{});
}

Expand Down
4 changes: 2 additions & 2 deletions src/ds/test/json_schema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ TEST_CASE("basic macro parser generation")
j["c"] = 100;
const Bar bar_1 = j;
REQUIRE(bar_1.a == j["a"]);
REQUIRE(bar_1.b == j["b"]);
REQUIRE(bar_1.b == j["b"].get<std::string>());
REQUIRE(bar_1.c == j["c"]);
}

Expand Down Expand Up @@ -89,7 +89,7 @@ TEST_CASE("macro parser generation with base classes")
j["e"] = 101;
const Baz baz_1 = j;
REQUIRE(baz_1.a == j["a"]);
REQUIRE(baz_1.b == j["b"]);
REQUIRE(baz_1.b == j["b"].get<std::string>());
REQUIRE(baz_1.c == j["c"]);
REQUIRE(baz_1.d == j["d"]);
REQUIRE(baz_1.e == j["e"]);
Expand Down
18 changes: 10 additions & 8 deletions src/host/ledger.h
Original file line number Diff line number Diff line change
Expand Up @@ -1606,14 +1606,16 @@ namespace asynchost
job->from_idx = from_idx;
job->to_idx = to_idx;
job->max_size = max_entries_size;
job->result_cb =
[this, from_idx = from_idx, to_idx = to_idx, purpose = purpose](
auto&& read_result, int status) {
// NB: Even if status is cancelled (and entry is empty), we
// want to write this result back to the enclave
write_ledger_get_range_response(
from_idx, to_idx, std::move(read_result), purpose);
};
job->result_cb = [this,
from_idx_ = from_idx,
to_idx_ = to_idx,
purpose_ =
purpose](auto&& read_result, int status) {
// NB: Even if status is cancelled (and entry is empty), we
// want to write this result back to the enclave
write_ledger_get_range_response(
from_idx_, to_idx_, std::move(read_result), purpose_);
};

work_handle->data = job;
}
Expand Down
1 change: 1 addition & 0 deletions src/js/core/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "js/global_class_ids.h"

#include <chrono>
#include <cstdarg>
#include <quickjs/quickjs.h>

#if defined(INSIDE_ENCLAVE) && !defined(VIRTUAL_ENCLAVE)
Expand Down
11 changes: 10 additions & 1 deletion src/js/extensions/ccf/historical.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,17 @@ namespace ccf::js::extensions
namespace ccf::js
{
JSClassExoticMethods kv_historical_exotic_methods = {
.get_own_property = extensions::js_historical_kv_lookup};
.get_own_property = extensions::js_historical_kv_lookup,
.get_own_property_names = {},
.delete_property = {},
.define_own_property = {},
.has_property = {},
.get_property = {},
.set_property = {}};
JSClassDef kv_historical_class_def = {
.class_name = "Read-only Historical KV Tables",
.finalizer = {},
.gc_mark = {},
.call = {},
.exotic = &kv_historical_exotic_methods};
}
14 changes: 12 additions & 2 deletions src/js/extensions/ccf/kv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,17 @@ namespace ccf::js::extensions
namespace ccf::js
{
JSClassExoticMethods kv_exotic_methods = {
.get_own_property = extensions::js_kv_lookup};
.get_own_property = extensions::js_kv_lookup,
.get_own_property_names = {},
.delete_property = {},
.define_own_property = {},
.has_property = {},
.get_property = {},
.set_property = {}};
JSClassDef kv_class_def = {
.class_name = "KV Tables", .exotic = &kv_exotic_methods};
.class_name = "KV Tables",
.finalizer = {},
.gc_mark = {},
.call = {},
.exotic = &kv_exotic_methods};
}
4 changes: 2 additions & 2 deletions src/node/acme_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ namespace ACME
if (nonces.empty())
{
request_new_nonce(
[=]() { post_as_get(account_url, resource_url, ok_callback); });
[&, this]() { post_as_get(account_url, resource_url, ok_callback); });
}
else
{
Expand All @@ -326,7 +326,7 @@ namespace ACME
{
if (nonces.empty())
{
request_new_nonce([=]() {
request_new_nonce([&, this]() {
post_as_get_json(
account_url, resource_url, ok_callback, empty_payload);
});
Expand Down

0 comments on commit 94f65a2

Please sign in to comment.