Skip to content

[teemo] Fix string replace error.#22244

Merged
BillyONeal merged 26 commits intomicrosoft:masterfrom
winsoft666:master
Dec 30, 2021
Merged

[teemo] Fix string replace error.#22244
BillyONeal merged 26 commits intomicrosoft:masterfrom
winsoft666:master

Conversation

@winsoft666
Copy link
Copy Markdown
Contributor

Describe the pull request

  • What does your PR fix?

    Fixes string replace error.

  • Which triplets are supported/not supported? Have you updated the CI baseline?

    <linux, windows / macos>,

  • Does your PR follow the maintainer guide?

    Yes

  • If you have added/updated a port: Have you run ./vcpkg x-add-version --all and committed the result?

If you are still working on the PR, open it as a Draft: https://github.blog/2019-02-14-introducing-draft-pull-requests/

@JackBoosY JackBoosY self-assigned this Dec 29, 2021
@JackBoosY
Copy link
Copy Markdown
Contributor

I think we don't need this, do we?

@winsoft666
Copy link
Copy Markdown
Contributor Author

I think we don't need this, do we?

The old code can not replace string correctly.
If VCPKG_LIBRARY_LINKAGE is dynamic, it mistakenly replaced #ifdef TEEMO_STATIC with #if $<STREQUAL:dynamic, static>.
What I want is to replace #ifdef TEEMO_STATIC with #if 0.

@winsoft666
Copy link
Copy Markdown
Contributor Author

I think we don't need this, do we?

The old code can not replace string correctly. If VCPKG_LIBRARY_LINKAGE is dynamic, it mistakenly replaced #ifdef TEEMO_STATIC with #if $<STREQUAL:dynamic, static>. What I want is to replace #ifdef TEEMO_STATIC with #if 0.

I'm not familiar with cmake grammar.

@JackBoosY
Copy link
Copy Markdown
Contributor

Ah you are the owner, I have some questions:

  1. When building dynamic, should we undefine TEEMO_STATIC?
  2. When building static, should we define TEEMO_STATIC?

@winsoft666
Copy link
Copy Markdown
Contributor Author

winsoft666 commented Dec 29, 2021

When building dynamic, we should undefined TEEMO_STATIC in projects that use teemo library;
When building static, we should defined TEEMO_STATIC in projects that use teemo library;

Obviously, define/undefined TEEMO_STATIC in projects that use teemo library is a good method.
However I have not found a way to automatically define/undefined TEEMO_STATIC via VCPKG.

By string substitution, it is only a stopgap measure

@JackBoosY
Copy link
Copy Markdown
Contributor

Does there have any other places to use this macro?

@winsoft666
Copy link
Copy Markdown
Contributor Author

Does there have any other places to use this macro?

No

@JackBoosY
Copy link
Copy Markdown
Contributor

JackBoosY commented Dec 29, 2021

Does there have any other places to use this macro?

No

Therefore, I think we can keep this code since there is no other place to use that:

  1. Replace #ifdef TEEMO_STATIC to #if 1 when building static.
  2. Replace #ifdef TEEMO_STATIC to #if 0 when building dynamic.

Do you agree that?

@winsoft666
Copy link
Copy Markdown
Contributor Author

Does there have any other places to use this macro?

No

Therefore, I think we can keep this code since there is no other place to use that:

  1. Replace #ifdef TEEMO_STATIC to #if 1 when building static.
  2. Replace #ifdef TEEMO_STATIC to #if 0 when building dynamic.

Do you agree that?

I don't understand what's your meaning, and keep what code?

All of my updated code is designed to do just that:

  1. Replace #ifdef TEEMO_STATIC to #if 1 when building static.
  2. Replace #ifdef TEEMO_STATIC to #if 0 when building dynamic.

The old code has some bug, can not replace correctly.

@JackBoosY
Copy link
Copy Markdown
Contributor

Does there have any other places to use this macro?

No

Therefore, I think we can keep this code since there is no other place to use that:

  1. Replace #ifdef TEEMO_STATIC to #if 1 when building static.
  2. Replace #ifdef TEEMO_STATIC to #if 0 when building dynamic.

Do you agree that?

I don't understand what's your meaning, and keep what code?

All of my updated code is designed to do just that:

  1. Replace #ifdef TEEMO_STATIC to #if 1 when building static.
  2. Replace #ifdef TEEMO_STATIC to #if 0 when building dynamic.

The old code has some bug, can not replace correctly.

The current code already does this. if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") means build static, otherwise build dynamic.
Can you describe the bug you encountered?

@dg0yt
Copy link
Copy Markdown
Contributor

dg0yt commented Dec 29, 2021

The current code already does this. if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") means build static, otherwise build dynamic.
Can you describe the bug you encountered?

@JackBoosY The current substitution contains a cmake generator expression, but this expression never goes through a generation step, so it doesn't achieve the desired out come.

Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

After committing all other changes, the version database must be updated
git add -u && git commit
git checkout 05c411da6619971fd033c8a9d20c8cce07d5e42a -- versions
./vcpkg x-add-version --all
Diff
diff --git a/versions/baseline.json b/versions/baseline.json
index 88a9ff8..e89b245 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -6710,7 +6710,7 @@
     },
     "teemo": {
       "baseline": "2.5",
-      "port-version": 0
+      "port-version": 1
     },
     "telnetpp": {
       "baseline": "2.1.2",
diff --git a/versions/t-/teemo.json b/versions/t-/teemo.json
index 7be73f0..5227395 100644
--- a/versions/t-/teemo.json
+++ b/versions/t-/teemo.json
@@ -1,5 +1,10 @@
 {
   "versions": [
+    {
+      "git-tree": "5d9a099bba6f647165ff3b64e69dcc300bacfca9",
+      "version": "2.5",
+      "port-version": 1
+    },
     {
       "git-tree": "272a7ccdbd7429e98513b1d4c9c394406fa70d42",
       "version": "2.5",

@JackBoosY
Copy link
Copy Markdown
Contributor

JackBoosY commented Dec 30, 2021

Oh sorry, I mixed up the deleted part and the newly added part.

@JackBoosY JackBoosY added the category:port-bug The issue is with a library, which is something the port should already support label Dec 30, 2021
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

All manifest files must be formatted

./vcpkg format-manifest ports/*/vcpkg.json

Diff
diff --git a/ports/teemo/vcpkg.json b/ports/teemo/vcpkg.json
index 02890be..755fcbf 100644
--- a/ports/teemo/vcpkg.json
+++ b/ports/teemo/vcpkg.json
@@ -2,9 +2,9 @@
   "name": "teemo",
   "version": "2.5",
   "port-version": 1,
+  "maintainers": "winsoft666 <winsoft666@outlook.com>",
   "description": "C++ File Download Library, support Multithreading, Breakpoint Transmission, Speed Limit, Real-time Speed.",
   "homepage": "https://github.com/winsoft666/teemo",
-  "maintainers": "winsoft666 <winsoft666@outlook.com>",
   "supports": "!osx & !uwp & !arm",
   "dependencies": [
     {
After committing all other changes, the version database must be updated
git add -u && git commit
git checkout 05c411da6619971fd033c8a9d20c8cce07d5e42a -- versions
./vcpkg x-add-version --all
Diff
diff --git a/versions/t-/teemo.json b/versions/t-/teemo.json
index 5227395..0b5a2ca 100644
--- a/versions/t-/teemo.json
+++ b/versions/t-/teemo.json
@@ -1,7 +1,7 @@
 {
   "versions": [
     {
-      "git-tree": "5d9a099bba6f647165ff3b64e69dcc300bacfca9",
+      "git-tree": "d92f8edfaa4c8a208cfa6253c6d2ebd8beeaf303",
       "version": "2.5",
       "port-version": 1
     },

@JackBoosY
Copy link
Copy Markdown
Contributor

LGTM.

Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

All manifest files must be formatted

./vcpkg format-manifest ports/*/vcpkg.json

Diff
diff --git a/ports/teemo/vcpkg.json b/ports/teemo/vcpkg.json
index 02890be..755fcbf 100644
--- a/ports/teemo/vcpkg.json
+++ b/ports/teemo/vcpkg.json
@@ -2,9 +2,9 @@
   "name": "teemo",
   "version": "2.5",
   "port-version": 1,
+  "maintainers": "winsoft666 <winsoft666@outlook.com>",
   "description": "C++ File Download Library, support Multithreading, Breakpoint Transmission, Speed Limit, Real-time Speed.",
   "homepage": "https://github.com/winsoft666/teemo",
-  "maintainers": "winsoft666 <winsoft666@outlook.com>",
   "supports": "!osx & !uwp & !arm",
   "dependencies": [
     {
After committing all other changes, the version database must be updated
git add -u && git commit
git checkout 05c411da6619971fd033c8a9d20c8cce07d5e42a -- versions
./vcpkg x-add-version --all
Diff
diff --git a/versions/t-/teemo.json b/versions/t-/teemo.json
index 6a5f416..0b5a2ca 100644
--- a/versions/t-/teemo.json
+++ b/versions/t-/teemo.json
@@ -1,7 +1,7 @@
 {
   "versions": [
     {
-      "git-tree": "4d7bc3440769e15a00e84e168257bda517a9f0b2",
+      "git-tree": "d92f8edfaa4c8a208cfa6253c6d2ebd8beeaf303",
       "version": "2.5",
       "port-version": 1
     },

Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

All manifest files must be formatted

./vcpkg format-manifest ports/*/vcpkg.json

Diff
diff --git a/ports/teemo/vcpkg.json b/ports/teemo/vcpkg.json
index 02890be..755fcbf 100644
--- a/ports/teemo/vcpkg.json
+++ b/ports/teemo/vcpkg.json
@@ -2,9 +2,9 @@
   "name": "teemo",
   "version": "2.5",
   "port-version": 1,
+  "maintainers": "winsoft666 <winsoft666@outlook.com>",
   "description": "C++ File Download Library, support Multithreading, Breakpoint Transmission, Speed Limit, Real-time Speed.",
   "homepage": "https://github.com/winsoft666/teemo",
-  "maintainers": "winsoft666 <winsoft666@outlook.com>",
   "supports": "!osx & !uwp & !arm",
   "dependencies": [
     {

@JackBoosY JackBoosY added the info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. label Dec 30, 2021
@BillyONeal BillyONeal merged commit 4446d54 into microsoft:master Dec 30, 2021
@BillyONeal
Copy link
Copy Markdown
Member

Thanks for the fix!

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

Labels

category:port-bug The issue is with a library, which is something the port should already support info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants