Repository navigation
Add ubuntu insights to the build system #5541
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
Open
theartful
wants to merge
31
commits into
main
Choose a base branch
from
essam/ubuntu-insights-port
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+701
−62
Open
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
c85f05a
[vcpkg] Add ubuntu-insights
theartful 563df73
[insights] Add wrapper & smoke tests for insights
theartful 2952967
[snap] Support building multipass with insights
theartful 3664434
[ci] Set up Go for Ubuntu Insights
theartful 401520f
[ci] Disable plugs that require approval
theartful 0cd8744
[ci] Expose go toolchain to vcpkg builds
theartful a09f50c
[insights] Various fixes
theartful fcd54b5
[vcpkg] Drop CGO_CC
theartful ec22474
[cmake] Pass Go location to vcpkg
theartful 6bff7d6
[vcpkg] Drop wayland from dependencies
theartful 2110786
[vcpkg] Use VCPKG_KEEP_ENV_VARS to pass go dir
theartful 932d731
[vcpkg] Copy libinsights dll to debug/bin as well
theartful f031291
[ci] No need to disable caching for go
theartful c3e5e4a
[vcpkg] Both Ubuntu-insights and msys2 support arm
theartful 7145daa
[snap] Fix ubuntu insights snap environment
theartful 09a2047
[cmake] Fix typo in ENABLE_INSIGHTS description
theartful 962d3bc
[cmake] Ship ubuntu insights shared library
theartful 714adef
[snap] Drop new plug requirements for insights
theartful 4998896
[cmake] Make insights support a feature flag
theartful 803e489
[vcpkg] Use insights/v1.0.1 tag
theartful 7bf672a
[tests] Drop Qt from LibInsights smoke tests
theartful 909d1ff
[ubuntu-insights] Support only x64 on Windows
theartful b4ce314
[vcpkg] Use $VERSION in ubuntu insights port
theartful 6255646
[vcpkg] Add supports clause in insights vcpkg.json
theartful cb65d36
[vcpkg] Fix ubuntu insights go environment
theartful 837d347
[vcpkg] Put ubuntu insights tools behind a feature
theartful 3297e82
[docs] Add go compiler section in BUILD
theartful 2ed65f6
[vcpkg] Add comment about syncing insights.def
theartful 904aefb
[vcpkg] Add mingw lockfile when computing abi hash
theartful 81eaf63
[vcpkg] Share MSYS2 root between qemu and insights
theartful 6dc6b74
[vcpkg] Auto-generate insights import library def
theartful File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| include("${CMAKE_CURRENT_LIST_DIR}/get-mingw-packages.cmake") | ||
|
|
||
| # Acquire a shared MSYS2 root for all ports to avoid repeatedly setting up the | ||
| # same environment. | ||
| function(multipass_acquire_mingw_msys OUT_ROOT) | ||
| multipass_get_mingw_packages(MINGW_DIRECT_PACKAGES MINGW_URLS MINGW_SHA512S) | ||
| vcpkg_acquire_msys(MSYS_ROOT | ||
| PACKAGES findutils perl | ||
| DIRECT_PACKAGES ${MINGW_DIRECT_PACKAGES} | ||
| ) | ||
|
|
||
| # vcpkg_acquire_msys() extracts the full MinGW packages but then deletes | ||
| # every mingw64/lib/pkgconfig on *every* call (the removal sits outside its | ||
| # "assemble the root once" guard). qemu-img's meson build needs the glib/zstd | ||
| # .pc files, so we keep a private backup of them (harvested once, gated on the | ||
| # backup dir) and copy it back into the canonical mingw64/lib/pkgconfig on | ||
| # every run. The canonical location matters: pkgconf's --define-prefix (on by | ||
| # default) only rewrites each .pc's absolute `prefix=/mingw64` into the real | ||
| # Windows path when the file is found under a `.../lib/pkgconfig` layout, and | ||
| # native mingw gcc can't resolve the bare `/mingw64` POSIX paths otherwise. | ||
| set(PKGCONFIG_BACKUP "${MSYS_ROOT}/.multipass-qemu-pkgconfig") | ||
| if(NOT EXISTS "${PKGCONFIG_BACKUP}") | ||
| # Re-extract the pinned packages into a scratch dir and copy out their | ||
| # .pc files (the headers/libs acquire already installed are untouched). | ||
| set(_harvest "${CURRENT_BUILDTREES_DIR}/pkgconfig-harvest") | ||
| file(REMOVE_RECURSE "${_harvest}") | ||
| list(LENGTH MINGW_URLS _mingw_count) | ||
| math(EXPR _mingw_last "${_mingw_count} - 1") | ||
| foreach(_i RANGE ${_mingw_last}) | ||
| list(GET MINGW_URLS ${_i} _url) | ||
| list(GET MINGW_SHA512S ${_i} _sha) | ||
| get_filename_component(_fn "${_url}" NAME) | ||
| vcpkg_download_distfile(_archive URLS "${_url}" FILENAME "${_fn}" SHA512 "${_sha}" QUIET) | ||
| file(ARCHIVE_EXTRACT INPUT "${_archive}" DESTINATION "${_harvest}") | ||
| endforeach() | ||
| file(GLOB _pc_files "${_harvest}/mingw64/lib/pkgconfig/*.pc") | ||
| file(COPY ${_pc_files} DESTINATION "${PKGCONFIG_BACKUP}") | ||
| file(REMOVE_RECURSE "${_harvest}") | ||
| endif() | ||
| file(GLOB _pc_backup "${PKGCONFIG_BACKUP}/*.pc") | ||
| file(COPY ${_pc_backup} DESTINATION "${MSYS_ROOT}/mingw64/lib/pkgconfig") | ||
|
|
||
| set(${OUT_ROOT} "${MSYS_ROOT}" PARENT_SCOPE) | ||
| endfunction() |
File renamed without changes.
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # Reads the pinned MinGW closure into the requested output variables. | ||
| function(multipass_get_mingw_packages OUT_DIRECT_PACKAGES OUT_URLS OUT_SHA512S) | ||
| if(NOT ARGC EQUAL 3) | ||
| message(FATAL_ERROR "multipass_get_mingw_packages requires direct-packages, URLs, and SHA512 output variables") | ||
| endif() | ||
|
|
||
| set(_direct_packages "") | ||
| set(_urls "") | ||
| set(_sha512s "") | ||
| file(STRINGS "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/mingw64-toolchain.lock" _lock_lines) | ||
| foreach(_line IN LISTS _lock_lines) | ||
| if(_line MATCHES "^#" OR _line STREQUAL "") | ||
| continue() | ||
| endif() | ||
| if(NOT _line MATCHES "^([^ \t]+)[ \t]+([0-9a-fA-F]+)$") | ||
| message(FATAL_ERROR "Malformed mingw64-toolchain.lock entry: ${_line}") | ||
| endif() | ||
| list(APPEND _direct_packages "${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") | ||
| list(APPEND _urls "${CMAKE_MATCH_1}") | ||
| list(APPEND _sha512s "${CMAKE_MATCH_2}") | ||
| endforeach() | ||
|
|
||
| set(${OUT_DIRECT_PACKAGES} "${_direct_packages}" PARENT_SCOPE) | ||
| set(${OUT_URLS} "${_urls}" PARENT_SCOPE) | ||
| set(${OUT_SHA512S} "${_sha512s}" PARENT_SCOPE) | ||
| endfunction() |
File renamed without changes.
This file contains hidden or 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
18 changes: 18 additions & 0 deletions
18
3rd-party/vcpkg-ports/ubuntu-insights/0001-c-api-free.patch
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| diff --git a/insights/C/libinsights.go b/insights/C/libinsights.go | ||
| --- a/insights/C/libinsights.go | ||
| +++ b/insights/C/libinsights.go | ||
| @@ -16,6 +16,14 @@ import ( | ||
| "github.com/ubuntu/ubuntu-insights/insights" | ||
| ) | ||
|
|
||
| +// insights_free releases strings returned by the C API using the library's | ||
| +// allocator, including when the caller uses a different Windows C runtime. | ||
| +// | ||
| +//export insights_free | ||
| +func insights_free(ptr unsafe.Pointer) { | ||
|
xmkg marked this conversation as resolved.
Resolved
|
||
| + C.free(ptr) | ||
| +} | ||
| + | ||
| /** | ||
| * insights_collect creates a report for the specified source. | ||
| * If config is NULL, defaults are used. | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.