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

Fix Bugzilla issue 24111 - [ImportC] fatal error C1034: stdio.h: no include path set #16248

Merged
merged 2 commits into from
Mar 3, 2024

Conversation

shoo
Copy link
Contributor

@shoo shoo commented Feb 25, 2024

I have attempted a fix for this problem: https://issues.dlang.org/show_bug.cgi?id=24111
#15780 is the predecessor's approach to this problem.
My implementation is based on how it is used in LDC ( https://github.com/ldc-developers/ldc/blob/8399e47ceb4dfbbcf1ca0b7cf934c04a864387b7/driver/tool.cpp#L297-L312 )
Also, I refer to a part of std.process to pass environment variables to CreateProcess. ( https://github.com/dlang/phobos/blob/dcbfbd43ac321e81af60afd795bd0f3c3f47cfa0/std/process.d#L412-L440 , https://github.com/dlang/phobos/blob/dcbfbd43ac321e81af60afd795bd0f3c3f47cfa0/std/process.d#L1450-L1482 )

I have very little experience with dmd code, so my coding style may be incorrect or inefficiently implemented. Please point out any problems.

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @shoo! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Auto-close Bugzilla Severity Description
24111 enhancement [ImportC] fatal error C1034: stdio.h: no include path set

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#16248"

@rikkimax
Copy link
Contributor

This seems quite a bit more complex than is required.

I suggest setting the environment variable into the process state instead and then resetting it to the old value afterward.
This is what LDC appears to be doing.

@shoo
Copy link
Contributor Author

shoo commented Feb 25, 2024

This seems quite a bit more complex than is required.

I suggest setting the environment variable into the process state instead and then resetting it to the old value afterward. This is what LDC appears to be doing.

Fix it.
The process of checking for duplication with existing paths was also removed as it was not very useful.

@rikkimax
Copy link
Contributor

Okay, that looks a lot cleaner.

The failures for OSX are currently known and are unrelated to you.
@ibuclaw has a plan for it.

@thewilsonator
Copy link
Contributor

are you able to add a test case for this issue?

@shoo
Copy link
Contributor Author

shoo commented Feb 26, 2024

are you able to add a test case for this issue?

I would like to be able to add a test case similar to or minimized from the dub test case and run it on Windows with the INCLUDE environment variable forced to be empty.

@REM In the Windows *.bat file:
cd .\test\use-c-sources\
set INCLUDE=
dub build

However, I could not understand how to properly add the test case.
Can you tell me a good way to do this?

@thewilsonator
Copy link
Contributor

run dub build -v and extract the compiler command and use that in place of dub build, as for how to do windows batch file tests, not sure. We definitely have.sh shell tests for posix systems.

@shoo
Copy link
Contributor Author

shoo commented Feb 28, 2024

@thewilsonator How about this?

@shoo
Copy link
Contributor Author

shoo commented Mar 3, 2024

Can anyone review this PR?

@thewilsonator thewilsonator merged commit 0186032 into dlang:master Mar 3, 2024
46 of 48 checks passed
kinke added a commit to kinke/dmd that referenced this pull request Mar 3, 2024
kinke added a commit to kinke/dmd that referenced this pull request Mar 3, 2024
@shoo shoo deleted the fix_issue24111 branch March 3, 2024 13:53
thewilsonator pushed a commit that referenced this pull request Mar 4, 2024
@kinke kinke mentioned this pull request May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants