Repository navigation
COMP: Build and test on Windows #93
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
Draft
hjmjohnson
wants to merge
12
commits into
ci/missing-declarations
Choose a base branch
from
ci/windows
base: ci/missing-declarations
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.
Draft
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
4527f73
COMP: Give install_linking the source directory instead of guessing it
gdevenyi e451d1a
COMP: Show test output when the starter workflow fails
gdevenyi 5afe141
COMP: Build the optional code paths in the per-PR workflow
gdevenyi 5929218
COMP: Widen CI coverage across platforms, linkage, and configurations
hjmjohnson f9a2550
COMP: Submit dashboard results over https, at the documented start time
hjmjohnson edfde3c
COMP: Finish the migration from Travis to GitHub Actions
hjmjohnson d53e82b
ENH: Declare the three functions that have a published counterpart
hjmjohnson 5a47a23
COMP: Give the fsliolib internal functions static linkage
hjmjohnson 7b8d829
COMP: Declare nifti_fileexists where it is defined
hjmjohnson 6a93eda
STYLE: Derive the aux_file bound from sizeof
hjmjohnson 06026f2
COMP: Build and test on Windows
hjmjohnson 8514828
COMP: Export the afni_xml half of the cifti library
hjmjohnson 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
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,60 @@ | ||
| #!/bin/sh | ||
| # Collect the dynamic symbols exported by the built shared libraries. | ||
| # | ||
| # collect_exported_symbols.sh <build-dir> <output-file> | ||
| # | ||
| # The output is sorted "<library> <symbol>" lines, so a diff against the | ||
| # committed baseline names both the library and the symbol that moved. | ||
| # | ||
| # The library name is reported with any version suffix stripped, so a | ||
| # SOVERSION bump does not rewrite every line of the baseline: | ||
| # libniftiio.so.3.0.0 is reported as libniftiio.so. | ||
| # | ||
| # Regenerate the baseline after an intended ABI change: | ||
| # cmake -B build -DBUILD_SHARED_LIBS=ON -DUSE_CIFTI_CODE=ON -DUSE_FSL_CODE=ON | ||
| # cmake --build build | ||
| # sh cmake/collect_exported_symbols.sh build cmake/exported_symbols_linux.txt | ||
|
|
||
| set -eu | ||
|
|
||
| if [ $# -ne 2 ]; then | ||
| echo "usage: $0 <build-dir> <output-file>" >&2 | ||
| exit 2 | ||
| fi | ||
|
|
||
| build_dir=$1 | ||
| output=$2 | ||
|
|
||
| if [ ! -d "$build_dir" ]; then | ||
| echo "$0: no such build directory: $build_dir" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Match versioned sonames too (libfoo.so.3.0.0), and resolve symlinks so | ||
| # libfoo.so -> libfoo.so.3.0.0 is not counted twice. | ||
| libs=$(find "$build_dir" -name 'lib*.so*' -exec readlink -f {} \; \ | ||
| | LC_ALL=C sort -u) | ||
|
|
||
| if [ -z "$libs" ]; then | ||
| echo "$0: no shared libraries under $build_dir;" \ | ||
| "configure with -DBUILD_SHARED_LIBS=ON" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| : > "$output.tmp" | ||
|
|
||
| for lib in $libs; do | ||
| # libniftiio.so.3.0.0 -> libniftiio.so | ||
| name=$(basename "$lib" | sed -E 's/\.so(\.[0-9]+)*$/.so/') | ||
| # -D dynamic symbols, --defined-only drops imports; field 3 is the name. | ||
| nm -D --defined-only "$lib" \ | ||
| | awk 'NF >= 3 { print $3 }' \ | ||
| | grep -v '^$' \ | ||
| | sed "s|^|$name |" >> "$output.tmp" | ||
| done | ||
|
|
||
| LC_ALL=C sort -u "$output.tmp" > "$output" | ||
| rm -f "$output.tmp" | ||
|
|
||
| echo "$0: wrote $(wc -l < "$output") symbols from" \ | ||
| "$(awk '{print $1}' "$output" | LC_ALL=C sort -u | wc -l) libraries to $output" |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Google Carbon] Two suggestions on the Windows CMake configuration:
-DCMAKE_RUNTIME_OUTPUT_DIRECTORYonly in CI YAML, set aWIN32default in rootCMakeLists.txt(beforeadd_subdirectory, if not already defined by the caller) so local WindowsBUILD_SHARED_LIBS=ONbuilds also place.dlland.exeartifacts together forctest.WIN32or_MSC_VERguards, yet all#ifdef _MSC_VER(_popen/_pclose) blocks innifti1_io.c&nifti2_io.crequire-DFSLSTYLE=ON(PIGZ), andfsliolib'sFSL_APIDLL exports require-DUSE_FSL_CODE=ON. Please add-DUSE_FSL_CODE=ON(and-DFSLSTYLE=ONon at least one leg) so those Windows guards are actually compiled! (Enabling GitHub Actions binary caching forvcpkg installon line 254 will also save ~2–4 minutes per run.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Point 2 is in 06026f2: both legs now build fsliolib with
-DUSE_FSL_CODE=ON, and the shared leg sets-DFSLSTYLE=ON; this is unverified until the workflow runs, since this PR's base is not master. Point 1 changes the default build layout for every Windows consumer of the rootCMakeLists.txt, so I have left it for a maintainer decision rather than folding it in here.