-
Notifications
You must be signed in to change notification settings - Fork 130
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
fix build with samples on linux #3724
Conversation
This pull request is protected by Check Enforcer. What is Check Enforcer?Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass. Why am I getting this message?You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged. What should I do now?If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows: What if I am onboarding a new service?Often, new services do not have validation pipelines associated with them, in order to bootstrap pipelines for a new service, you can issue the following command as a pull request comment: |
/azp run cpp - core |
/azp run cpp - identity |
Azure Pipelines successfully started running 1 pipeline(s). |
1 similar comment
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run cpp - core |
/azp run cpp - identity |
Azure Pipelines successfully started running 1 pipeline(s). |
1 similar comment
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run cpp - core |
/azp run cpp - identity |
Azure Pipelines successfully started running 1 pipeline(s). |
1 similar comment
Azure Pipelines successfully started running 1 pipeline(s). |
This looks to stop the sample from ever building. What am I missing. Also I see its still failing the core builds. |
target_include_directories(client_secret_credential_sample PRIVATE .) | ||
target_include_directories( | ||
client_secret_credential_sample PRIVATE | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../../../samples/helpers/service/inc> |
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.
Instead of navigating ../../../..
etc, why not put this in a variable once and then use the variable everywhere?
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.
We decided not to do that for CMake files long time ago, as per Charlie's advice (since we were doing the C SDK)
I remember because I used to set all re-usable strings from a CMake file in the top and then I would just use the variables everywhere.
So, yeah, I am not against it, but I have been following that advise of keeping the duplication.
The only real benefit of the variables was to make it easier to update in the future, but using any editor from this days can select and replace all occurrences at the same time (and I couldn't argue with that )
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.
@barcharcraz can you please share some guidance and rationale for when and why we should avoid creating reusable string variables within CMake files?
It was never a sample. It is a helper library for samples. But it is just a header without any .cpp files, so the library was created as an INTERFACE, which somehow works on Windows, but makes no sense for linux. All we need is to make this header available for building samples |
false positive. I have triggered re-run failed. |
@@ -101,7 +101,6 @@ include(AzureVersion) | |||
|
|||
if(BUILD_SAMPLES) | |||
add_subdirectory(samples/helpers/get-env) | |||
add_subdirectory(samples/helpers/service) |
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.
Let's try to find the other way... Basically, what we have is header-only library, let's fix cmake so that it works on linux too. I would really like to avoid the ..\..\..
, and make it look like any other azure-sdk library. Even at a cost of it having a .cpp file.
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.
Given that service
is supposed to be a placeholder for azure-anyservice
, I thikn it is better to add a .cpp file. We can make it an OBJECT
library similar to get-env
, consuming it is semantically the same as regular library, unlike INTERFACE
library (http://www.mariobadr.com/creating-a-header-only-library-with-cmake.html#:~:text=Creating%20a%20Header-Only%20CMake%20Target%20Creating%20an%20interface,is%20not%20meant%20to%20generate%20any%20build%20output.).
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.
closing on the benefit of #3728 |
fixes: #3723