-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Cygwin directories not being cleaned #1880
Comments
I don't think this bug has been introduced recently. I have not build the ez80 (under arch/z80) in many months. I will do this as part of the review for the 10.0.0 release. |
I hate the close button being associated with the comment window!!!!!!!!!! |
The stranded directories are NOT the directory copies, but Cygwin symbolic links:
When I do
I get the expected copied directories (because I am using the Arm Embedded toolchain and CONFIG_CYGWIN_WINTOOL=y):
Bit I also get Cygwin Symbolic links:
That should not be happening and exonerates the DIRUNLINK calls implicated in the Issue description. These symbolic links are being created erroneously sometime in the context target. Doing 'make clean_context' does not remove any of those. That is an error. 'make clean_context' should undo everything that was done my 'make context'. Apparently, somewhere along the way that critical part of the clean_context target got moved to distclean, breaking the symmetry of the make targets. When I do 'make distclean' the unexpected Cygwin symbolic links remain:
|
Aha... these bad directories are being created by configure.sh.
@v01d @btashton This is a consequence of several changes to the Makefiles recently:
A possible fix would be to restore the 'make clean_context' and all reconfigurations to eliminate this garbage from running the Makefile with an incomplete configuration. The old, fully working logic in Makefile.unix was:
Where clean_context removed the bad settings left by the 'make olddefconfig' setup. Restoring this code would not fully work, however. You would also have to restore the correct behavior or clean_context since the key clean up was more to the distclean target. These are the commits that broke the Cygwin build: b5dc837 and c709ed2 Parts of those changes need to be reverted. I will never understand why people intentionally break full working, well tested code with no real justification. @xiaoxiang781216 Can you discuss this with @liuguo09 and @anchao? It is their commits together that break the Cygwin build. I am hesitant to restore this necessary logic sense I cannot know their intent with these changes. |
@btashton @hartmannathan Should this be marked a blocker? I had it tagged that way, but decided not. |
I don't think it needs to be a blocker, but maybe Good First Issue?
…On Wed, Sep 23, 2020 at 2:56 PM patacongo ***@***.***> wrote:
@btashton <https://github.com/btashton> @hartmannathan
<https://github.com/hartmannathan> Should this be marked a blocker? I had
it tagged that way, but decided not.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1880 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOD4O54Q2XGH7DSXDQEAP7TSHJAGXANCNFSM4RXCOPEQ>
.
|
My inclination is for it to be a blocker because I cannot enable windows CI without it and I would like to see that pass prior to the releases. |
Okay in that case, make it a blocker. With the Windows CI working, we will find out about breakage much more quickly. That will be a good thing. |
Way to complex and risky for a first issue. I don't even know how to solve it without coordination with Xiaomi guys. @xiaoxiang781216 I think we need to wait and at least get a recommendation (and preferably a draft PR). If you create the draft PR, I will check it out. |
There could also be other issues in the created context. Some configurations do much more than just setup links. They may, for example, auto-generate files based on the current configuration. When a defconfig is included by the Makefile as the .config, it is an incomplete and invalid configuration. This could potentially cause other more serious problems than just some extra bogus soft links. It is just not a good behavior. That is why clean_context was invoked before. To eliminate any potentially bad context created during 'make olddefconfig' or 'make memconfig'. |
One solution that I would NOT recommend is modify the distclean target to clean more symbolic links. That is a bandaid and not a really solution to the generic problem that a defconfig is not a valid .config file and can cause problems when used as one in the Makefile. |
@patacongo we are looking this problem. |
There are multiple causes of the Cygwin CI build breakage. This commit is also a factor: bd65688 Although the other cited commits leave the system with a bad context setup, that would not have been noticed prior to this commit which changes the WINTOOL variable to the CONFIG_CYGWIN_WINTOOL Kconfig setting. Previously WINTOOL would have been defined; bue CONFIG_CYGWIN_WINTOOL will not be defined (since it is the default and will not be in the defconfig). That is three commits that break the Cygwin CI build. But b5dc837 is the real culprit because it allows bad context setups into the user build. That could introduce wide-reaching, difficult to analyze problems. |
Actually I think I am mistaken about this: that commit does not do the full context. It only does dirlinks as far as I can tell. If that is the case, then things are not so bad. Perhaps we just need to separate out a clean_links target to get rid of those links, just as clean_context was called previously. |
@patacongo @btashton @xiaoxiang781216 It seems cygwin build using copydir.sh as DIRLINK in tools/Config.mk. In cygwin case, there are two copies: include/arch/chip and arch/arm/include/chip. And it finally only clean include/arch/chip. So could we switch to use link.sh as DIRLINK for cygwin build to keep one copy firstly? I have tested using link.sh locally and distclean verify ok. As to copydir.sh case, it may need separate out a clean_links target as @patacongo suggests. |
The Cygwin build does NOT use copydir.sh unless CONFIG_CYGWIN_WINTOOL is selected. That is the problem.
|
This is a consequence of:
|
The MYS2 build is similar in that it must copy directories since MSYS2 does not support any kind of symbolic linking. However, it does not depend on CONFIG_CYGWIN_WINTOOL so should not suffer from this issue. After you decide on the correct change and before releasing 10.0.0, I will verify the MSYS2 build as well. |
Thanks for your explanation, I'm working on it and make PR ASAP once fixed. |
@patacongo @btashton I have made a draft PR #1901 Could you help to review and verify it? |
Under Cygwin, the following directories are not being removed by the distclean target:
This was noted in apache/nuttx-testing#39
I have several old board and and chip directories left over from unsuccessful distclean operations on different architectures. These two lines in arch/arm/src/Makefile (and other arch Makefiles) are not apparently not working under Cygwin:
Cygwin supports is own style of symbolic links and these are used EXCEPT for the case where a Windows native toolchain is used such as the popular (https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm).
Those are Window native tools and cannot follow non-standard Cygwin symbolic links so in this case, the tools/dirlinks.sh script does a full directory copy and the corresponding unlink script does a directory removal.
Without knowing more, it looks like the DIRUNLINK is failing to remove the Cygwin symbolic link or the copied directory.
The text was updated successfully, but these errors were encountered: