Skip to content

Convert Unix.access to support Windows Unicode#1446

Merged
alainfrisch merged 1 commit intoocaml:trunkfrom
dra27:win-unicode-unix.access
Oct 25, 2017
Merged

Convert Unix.access to support Windows Unicode#1446
alainfrisch merged 1 commit intoocaml:trunkfrom
dra27:win-unicode-unix.access

Conversation

@dra27
Copy link
Copy Markdown
Member

@dra27 dra27 commented Oct 25, 2017

Missed in GPR#1200.

For 4.06 and trunk; see #1444

@gasche
Copy link
Copy Markdown
Member

gasche commented Oct 25, 2017

I believe that this patch is correct (cc @nojb ?).

I have a minor question. I thought that the caml/misc.h thing was used for C functions occurring in the OCaml runtime (byterun/foo.c), here it is used for a function in otherlibs/unix (while those have their own system-distinction layer of sort in having both unix and win32unix). Is it common for misc.h to have definitions only used in otherlibs, or a new trend? (I've seen another patch, from @nojb I think, also doing that just today).

@nojb
Copy link
Copy Markdown
Contributor

nojb commented Oct 25, 2017

Looks OK to me as well.

@gasche Indeed, misc.h contains a list of defines protected by #if _WIN32 used to choose the right function to handle Unicode for shared Unix/Windows code. It was just a matter of convenience that we also list there some functions that are only used in otherlibs. We could move these functions to some file in otherlibs if we want to (but as far as I can see there is no header file shared between unix and win32unix currently, so a new file would have to be created).

@gasche
Copy link
Copy Markdown
Member

gasche commented Oct 25, 2017

I'll cc @xavierleroy in case he knows about whether a byterun/ vs. otherlibs/*unix distinction would matter, but I don't see this as a blocker.

Has one of you to checked whether other Unix functions have been forgotten?

@shindere
Copy link
Copy Markdown
Contributor

shindere commented Oct 25, 2017 via email

@nojb
Copy link
Copy Markdown
Contributor

nojb commented Oct 25, 2017

I just went over the list. There are two functions that MSDN tells me they exist in Unicode flavor that I had not considered: getaddrinfo and getnameinfo. Unicode host names anyone?

I will submit a PR adapting these two functions but I think we can safely leave it for 4.07. I mean, has anyone ever seen a non-ASCII host name?? 😃

@alainfrisch
Copy link
Copy Markdown
Contributor

Is this an approval for 4.06 as well?

@gasche
Copy link
Copy Markdown
Member

gasche commented Oct 25, 2017

@alainfrisch yes. I am operating under the assumption that this code would have been included with the general PR if it hadn't been omitted -- it's not a new risk. Are you positively or negatively surprised?

@xavierleroy
Copy link
Copy Markdown
Contributor

@gasche: yes, there is probably too many things defined in byterun/caml/misc.hand not enough reasons why they are defined there. A similar phenomenon occurs with utils/misc.ml. (Mental note: never name a module "Misc".) But that's not too serious and maybe one day we will clean things up.

@xavierleroy
Copy link
Copy Markdown
Contributor

@nojb: concerning Unicode in host names, see https://en.wikipedia.org/wiki/Internationalized_domain_name . Standards exist but don't seem widely used, in part by fear of spoofing of ASCII domain names by similarly-looking-but-different Unicode names.

@xavierleroy xavierleroy added this to the 4.06.0 milestone Oct 25, 2017
@alainfrisch alainfrisch merged commit 13a4b41 into ocaml:trunk Oct 25, 2017
alainfrisch pushed a commit that referenced this pull request Oct 25, 2017
@alainfrisch
Copy link
Copy Markdown
Contributor

Are you positively or negatively surprised?

I'm not surprised, but it's good to get an explicit agreement to push to 4.06.

Merged and cherry-picked to 4.06 (d9db5be). I've also fixed the GPR reference in Changes in a later commit (also cherry-picked).

@dra27
Copy link
Copy Markdown
Member Author

dra27 commented Oct 25, 2017

Just for the record, I did do a check by looking for files which validated paths (which we've been unsurprisingly thorough on) and which didn't appear to be using caml_stat_strdup_to_os

@nojb
Copy link
Copy Markdown
Contributor

nojb commented Oct 27, 2017

See #1454 for getaddrinfo and getnameinfo.

@dra27 dra27 deleted the win-unicode-unix.access branch July 6, 2021 14:05
EmileTrotignon pushed a commit to EmileTrotignon/ocaml that referenced this pull request Jan 12, 2024
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.

6 participants