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

replace path placeholder even if it's stored in a wide string #4298

Closed
wojdyr opened this issue Jan 14, 2017 · 12 comments · Fixed by #9946
Closed

replace path placeholder even if it's stored in a wide string #4298

wojdyr opened this issue Jan 14, 2017 · 12 comments · Fixed by #9946
Labels
locked [bot] locked due to inactivity source::community catch-all for issues filed by community members stale::recovered [bot] recovered after being marked as stale type::feature request for a new feature or capability

Comments

@wojdyr
Copy link
Contributor

wojdyr commented Jan 14, 2017

Prefix placeholder can be stored in binary files as a wide string (wchar_t).
In such a case it's not replaced by conda.
I came across this problem when building wxWidgets that is using internally wide strings: UCS-2 on Windows and UCS-4 on Unix:

007c4f10  2f 00 00 00 6f 00 00 00  70 00 00 00 74 00 00 00  |/...o...p...t...|
007c4f20  2f 00 00 00 63 00 00 00  6f 00 00 00 6e 00 00 00  |/...c...o...n...|
007c4f30  64 00 00 00 61 00 00 00  2f 00 00 00 63 00 00 00  |d...a.../...c...|
007c4f40  6f 00 00 00 6e 00 00 00  64 00 00 00 61 00 00 00  |o...n...d...a...|
007c4f50  2d 00 00 00 62 00 00 00  6c 00 00 00 64 00 00 00  |-...b...l...d...|
007c4f60  2f 00 00 00 77 00 00 00  78 00 00 00 77 00 00 00  |/...w...x...w...|
007c4f70  69 00 00 00 64 00 00 00  67 00 00 00 65 00 00 00  |i...d...g...e...|

Perhaps conda could try to replace the placeholder in any of the popular encodings (UTF8, UTF16, UTF32)?

@kalefranz
Copy link
Contributor

If you'd like to submit a pull request, the place to focus would be conda/core/portability.py.

@kalefranz kalefranz added source::community catch-all for issues filed by community members type::feature request for a new feature or capability labels May 9, 2017
@hmaarrfk
Copy link
Contributor

Did you ever find a solution to this?

I'm currently building wxWidgets as well, and got into the same troubles.

@hmaarrfk
Copy link
Contributor

Would a PR adding a loop to:
https://github.com/conda/conda/blob/master/conda/core/portability.py#L64

Be acceptable?

@hmaarrfk
Copy link
Contributor

Unfortunately, it isn't as easy as that, one needs to ensure that the string doesn't accidentally become null terminated at the end.

See for example:

image

@hmaarrfk
Copy link
Contributor

Yeah, the binary replacement path is a little trickier because you need to fixup the regex and string expansion.

@wojdyr
Copy link
Contributor Author

wojdyr commented May 19, 2020

@hmaarrfk did you see PR #4307 linked above? I didn't follow up on that. But in short, replacing string is trivial, the question is how to minimize the overhead.

@jezdez
Copy link
Member

jezdez commented Jun 1, 2021

@hmaarrfk Hey Mark, blast from the past, I'm not sure about this, do you happen to know if you're still affected by this?

@hmaarrfk
Copy link
Contributor

hmaarrfk commented Jun 2, 2021

has there been an explicit effort to search for wide strings? if not, then I presume I'm still affected. conda forge accepted my patch. maybe mamba will break installations though. I guess I should devote some time to actually fixing the problem and submitting a patch to mingwandroids specifications

@jezdez
Copy link
Member

jezdez commented Jun 2, 2021

has there been an explicit effort to search for wide strings? if not, then I presume I'm still affected. conda forge accepted my patch. maybe mamba will break installations though. I guess I should devote some time to actually fixing the problem and submitting a patch to mingwandroids specifications

Hey there, I was asking since I'm new to the project and have started to triage some of the existing but older tickets that didn't receive the attention in the past. To be clear, it's a legitimate reply that you don't know if this is fixed :) Just means that we can take a closer look again.

@github-actions
Copy link

github-actions bot commented Jun 3, 2022

Hi there, thank you for your contribution!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this issue to remain open please:

  1. Verify that you can still reproduce the issue at hand
  2. Comment that the issue is still reproducible and include:
    - What OS and version you reproduced the issue on
    - What steps you followed to reproduce the issue

NOTE: If this issue was closed prematurely, please leave a comment.

Thanks!

@github-actions github-actions bot added the stale [bot] marked as stale due to inactivity label Jun 3, 2022
@hmaarrfk
Copy link
Contributor

hmaarrfk commented Jun 3, 2022

Not stale

@github-actions github-actions bot added stale::recovered [bot] recovered after being marked as stale and removed stale [bot] marked as stale due to inactivity labels Jun 4, 2022
@hmaarrfk
Copy link
Contributor

Exciting!

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Oct 19, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity source::community catch-all for issues filed by community members stale::recovered [bot] recovered after being marked as stale type::feature request for a new feature or capability
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants