Skip to content
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

Introduce MSVC CI support #80

Merged
merged 17 commits into from
Dec 10, 2024
Merged

Introduce MSVC CI support #80

merged 17 commits into from
Dec 10, 2024

Conversation

wusatosi
Copy link
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 .

This was referenced Nov 19, 2024
Copy link
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 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
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
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

CMAKE_GENERATOR: "Ninja Multi-Config"
- name: Build Release
run: |
cmake --build build --config Release --verbose
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
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
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
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
Member Author

Choose a reason for hiding this comment

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

Copy link
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
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 on lines 111 to 112
${{ matrix.platform.cpp }} --version
${{ matrix.platform.c }} --version
Copy link
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
Member Author

Choose a reason for hiding this comment

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

done.

CMAKE_GENERATOR: "Ninja Multi-Config"
- name: Build Release
run: |
cmake --build build --config Release --verbose
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
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
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
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
Member Author

Choose a reason for hiding this comment

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

Adopted.

compiler:
- cpp: g++
platform:
- description: "ubuntu gcc"
Copy link
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
Member Author

Choose a reason for hiding this comment

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

Adopted.

.github/workflows/ci_tests.yml Show resolved Hide resolved
@wusatosi wusatosi requested a review from neatudarius December 5, 2024 22:11
Copy link
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
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?

- name: Test Release
run: ctest --test-dir build --build-config Release
- name: Build Debug
run: |
# 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
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
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
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
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
35 checks passed
@wusatosi
Copy link
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