Skip to content

Conversation

gwr
Copy link
Contributor

@gwr gwr commented Jul 9, 2025

When cross-compiling for illumos, which has no "d_type" field in struct dirent:

  /runtime/src/coreclr/tools/superpmi/mcs/verbmerge.cpp: In static member function 'static bool verbMerge::DirectoryFilterDirectories(FilterArgType*)':
  /runtime/src/coreclr/tools/superpmi/mcs/verbmerge.cpp:188:19: error: 'verbMerge::FilterArgType' {aka 'struct dirent'} has no member named 'd_type'
    188 |     if (findData->d_type == DT_DIR)
        |                   ^~~~~~

and similar a few other places in this file

For the fix, do similarly as: src/native/corehost/hostmisc/pal.unix.cpp

Let FilterArgType use struct FindData to simplify filters.
Handle the possibility of finding d_type == DT_UNKOWN

This part is from @am11 (Thanks!)
Add HAVE_DIRENT_D_TYPE introspection

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jul 9, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jul 9, 2025
@gwr
Copy link
Contributor Author

gwr commented Jul 9, 2025

@dotnet/jit-contrib Could you please review?

@gwr gwr marked this pull request as ready for review July 9, 2025 16:40
@am11
Copy link
Member

am11 commented Jul 10, 2025

@gwr, we are not expected to keep syncing our PRs with main branch in this busy, ever-changing, repo. The maintainer can decide to merge main into the PR branch (just once) depending on the context / staleness of last CI run etc.

Secondly, Pri0 tests are still failing. You can do a minimal change like done here #34263, that didn't break existing platforms and made things just work on illumos. If you want to stick with your version, then as I suggested earlier, do yourself a favor and move your code under #ifdef TARGET_SUNOS without touching an existing platform.

Finally, superpmi instrumentation stuff is not important . You will very likely never actually need to run the instrumented JIT on illumos (as it is never been ran on freebsd since 2015..) so all this back and forth comments is basically just to quiet a compilation error of an unused component.. Is it really worth the hassle?

@gwr
Copy link
Contributor Author

gwr commented Jul 10, 2025

I think the Pri0 tests look OK now.

I don't see a simpler or more narrow way to fix this. The only easy place to add the stat call is in the readdir loop, which needs the (minor) change to how filter is called.
(Now, like on Windows, the type is in the struct passed to the filter function.)
With the loop/continue logic fixed, it seems to work fine.

@jkotas jkotas added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Jul 13, 2025
@gwr
Copy link
Contributor Author

gwr commented Jul 13, 2025

Minor cleanup, then rebase and squash so it's easier to deal with locally.

Copy link
Member

@am11 am11 left a comment

Choose a reason for hiding this comment

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

LGTM!

@am11 am11 requested review from jakobbotsch, janvorli and jkotas July 14, 2025 18:48
Copy link
Member

@janvorli janvorli left a comment

Choose a reason for hiding this comment

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

lGTM, thank you!

@jakobbotsch
Copy link
Member

/azp run runtime-coreclr superpmi-collect-test

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@gwr
Copy link
Contributor Author

gwr commented Jul 25, 2025

Anything else I should do with this? Thanks. (bump)

@jakobbotsch
Copy link
Member

Sorry, this fell off my radar. I will rerun the CI pipeline.

@jakobbotsch
Copy link
Member

/azp run runtime-coreclr superpmi-collect-test

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jakobbotsch
Copy link
Member

Looks like outerloop is broken but is being worked on (#118241 (comment)), so will have to wait for that first to run the pipeline.

@jakobbotsch
Copy link
Member

/azp run runtime-coreclr superpmi-collect-test

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@gwr
Copy link
Contributor Author

gwr commented Aug 13, 2025

Two of the tests continue to show as "running" a week later. Is that expected?
(See the "2 in progress checks" runtime-coreclr superpmi-collect-test )

@jakobbotsch
Copy link
Member

Two of the tests continue to show as "running" a week later. Is that expected? (See the "2 in progress checks" runtime-coreclr superpmi-collect-test )

Hmm no, looks like another infra oddity...

@jakobbotsch
Copy link
Member

/azp run runtime-coreclr superpmi-collect-test

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@gwr
Copy link
Contributor Author

gwr commented Sep 2, 2025

Looks like a few tests are again not completing. (bump)

  /runtime/src/coreclr/tools/superpmi/mcs/verbmerge.cpp: In static member function 'static bool verbMerge::DirectoryFilterDirectories(FilterArgType*)':
  /runtime/src/coreclr/tools/superpmi/mcs/verbmerge.cpp:188:19: error: 'verbMerge::FilterArgType' {aka 'struct dirent'} has no member named 'd_type'
    188 |     if (findData->d_type == DT_DIR)
        |                   ^~~~~~

For the fix, do similarly as: src/native/corehost/hostmisc/pal.unix.cpp

Let FilterArgType use struct FindData to simplify filters.
Handle the possibility of finding d_type == DT_UNKOWN

Add HAVE_DIRENT_D_TYPE introspection

Co-authored-by: Adeel Mujahid <[email protected]>
@gwr
Copy link
Contributor Author

gwr commented Sep 9, 2025

Rebased onto main as of Aug 30. No other changes.

@jakobbotsch
Copy link
Member

Thanks! I think the timeouts we saw in superpmi-collect-test were unrelated. Let's see if we run into any issues.

@jakobbotsch jakobbotsch merged commit fde7c8f into dotnet:main Sep 10, 2025
96 checks passed
@gwr gwr deleted the illumos4h branch September 11, 2025 12:40
@github-actions github-actions bot locked and limited conversation to collaborators Oct 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants