Skip to content

Introduce MSVC CI support#80

Merged
wusatosi merged 17 commits intobemanproject:mainfrom
wusatosi:windows-ci
Dec 10, 2024
Merged

Introduce MSVC CI support#80
wusatosi merged 17 commits intobemanproject:mainfrom
wusatosi:windows-ci

Conversation

@wusatosi
Copy link
Copy Markdown
Member

@wusatosi wusatosi commented Nov 19, 2024

This PR adds MSVC CI support.

Could be improved after #76 is merged.

Conflict with unknown state PR #66 .

Closes #24 .

Comment thread .github/workflows/ci_tests.yml Outdated
This was referenced Nov 19, 2024
Copy link
Copy Markdown
Member

@camio camio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple nits on platform-independent syntax, but otherwise looks good.

Comment thread .github/workflows/ci_tests.yml Outdated
Comment on lines +70 to +71
# MSVC has limited support for sanitizers, so we use include here for MSVC as an exception.
# This should be simplified after beman-project/exemplar#76 is merged.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# MSVC has limited support for sanitizers, so we use include here for MSVC as an exception.
# This should be simplified after beman-project/exemplar#76 is merged.

It isn't clear what is meant by "use include here". Also, it is unclear if #76 in its current form will be merged.

Copy link
Copy Markdown
Member Author

@wusatosi wusatosi Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah sorry I should check my comment

Comment thread .github/workflows/ci_tests.yml Outdated
cmake --build build --config Release --target all_verify_interface_header_sets
cmake --install build --config Release --prefix /opt/beman.exemplar
find /opt/beman.exemplar -type f
tree /opt/beman.exemplar
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe something like this?

Suggested change
tree /opt/beman.exemplar
cd /opt/beman.exemplar
tree
cd -

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a great idea!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this works?
image

This comment was marked as outdated.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

switch out to ls -R, and it is working. It's just very ugly...

image
image

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use the same trick I suggested in this comment to use the /F flag on windows only

Comment thread .github/workflows/ci_tests.yml Outdated
Comment on lines +111 to +112
${{ matrix.platform.cpp }} --version
${{ matrix.platform.c }} --version
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that --version isn't a cl.exe flag. Maybe something like this? See this reference page.

Suggested change
${{ matrix.platform.cpp }} --version
${{ matrix.platform.c }} --version
${{ matrix.platform.cpp }} ${{ matrix.platform.cpp == 'cl' && '' || '--version' }}
${{ matrix.platform.c }} ${{ matrix.platform.cpp == 'cl' && '' || '--version' }}

This comment was marked as outdated.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

cmake --build build --config Release --target all_verify_interface_header_sets
cmake --install build --config Release --prefix /opt/beman.exemplar
find /opt/beman.exemplar -type f
ls -R /opt/beman.exemplar
Copy link
Copy Markdown
Member

@neatudarius neatudarius Dec 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why find is not good?

do we just prefer a recursive display? If so, why not using tree?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we need to execute this on windows runner for MSVC, where tree doesn't work with the /opt/.... Directory.

Should I include a comment here documenting this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, got it, right. I would add a command like name: Build Release # Portable commands only. thanks!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adopted.

Comment thread .github/workflows/ci_tests.yml Outdated
compiler:
- cpp: g++
platform:
- description: "ubuntu gcc"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- description: "ubuntu gcc"
- description: "Ubuntu GCC"

if it's in description?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adopted.

Comment thread .github/workflows/ci_tests.yml
@wusatosi wusatosi requested a review from neatudarius December 5, 2024 22:11
Copy link
Copy Markdown
Member

@camio camio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The # Portable commands only comments clutter up the code in my opinion, but I don't want to hold up merging for that :-D

@wusatosi
Copy link
Copy Markdown
Member Author

wusatosi commented Dec 6, 2024

The # Portable commands only comments clutter up the code in my opinion, but I don't want to hold up merging for that :-D

Yeah I do agree it clutters up the code...

Edit: I will wait for @neatudarius to confirm review before merging. Maybe there's a better way to comment this?

# Portable commands only
cmake --build build --config Debug --verbose
cmake --build build --config Debug --target all_verify_interface_header_sets
cmake --install build --config Debug --prefix /opt/beman.exemplar
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This install isn't going to do anything because it's installing to the same location as the Release install. Unless that's the intent?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intention here is to test the install command.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It ends up skipping installation because it's already installed, which is a sort of test. Not critical for header only, but if there's any generated config or binaries, they shouldn't clobber each other.

@steve-downey
Copy link
Copy Markdown
Member

Perhaps an explanatory general comment, once, reminding us to use the portable subset of commands.
On the other hand, if it breaks in CI, a PR that doesn't use the portable subset will fail?

@wusatosi wusatosi merged commit 589d0f8 into bemanproject:main Dec 10, 2024
@wusatosi
Copy link
Copy Markdown
Member Author

Perhaps an explanatory general comment, once, reminding us to use the portable subset of commands. On the other hand, if it breaks in CI, a PR that doesn't use the portable subset will fail?

Ops I didn't see this before merging. I don't think this is fine. We can move this out in a later PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MSVC CI Support

4 participants