-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Outputs in build directory #9012
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
Outputs in build directory #9012
Conversation
The rules for lib (static library with name $(LIBMICROPYTHON)) and the default rule to build a binary ($(PROG)) produced outputs in the current working directory. Change this to build these files in the build directory. Note: An empty BUILD variable can cause issues (references to the root directory); this is not addressed by this commit due to multiple other places having the same issue.
Binaries built using the Make build system now no longer appear in the working directory of the build, but rather in the build directory. Thus some paths had to be adjusted. Adjust build rule for mpy-cross dependency.
One additonal thing: This most likely breaks code downstream, which expects the micropython binary (or mpy-cross binary, or libmicropython.a) to show up in the working directory rather than the build directory. |
Added a commit which |
Yes this will break my (and probably other's) daily workflow, where I have grown accustomed to the unix (and mpy-cross) executables to be where there currently are. Although I do agree it's neater (and follows the bare-metal ports output) to put these excutables in the build/ directory... just need to think how big of a breaking change this is. |
It also breaks my workflow, but not in a way that I really feel very strongly about and can easy adapt (or symlink around). Overall I'm in favour of merging this. |
Hmm ... I could add a rule which moves the build output to where it was, an option to turn that rule off, and make the rule enabled by default? And one could (step by step) first deprecate the current behaviour, and then some time in the future (when everybody had time to adjust) remove it? edit, clarification:
|
I nearly suggested exactly this, but you'd still want to make the other changes to reference the mpy-cross and micropython binaries from the build directories, so I think having two copies of the binary is just a recipe for confusion. |
I think if we are going to merge this PR, then just do it without the backwards compatible copy/link. Would it make sense to remove the |
Yes, +1 to that. |
Merged in b2e8240 through c7aa6a2, and I also reverted some of the changes to the mpy-cross dependency. It should be that if you define Thank you @musteresel for this contribution, it does clean up things nicely! |
PR micropython#9012 (b2e8240) changed the output to $(BUILD)/$(PROG) but the tests are still looking for $(PROG). Also remove the now-unnecessary override of $(PROG) in the standard variant. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
PR micropython#9012 (b2e8240) changed the output to $(BUILD)/$(PROG) but the tests are still looking for $(PROG). Also remove the now-unnecessary override of $(PROG) in the standard variant. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
PR micropython#9012 (b2e8240) changed the output to $(BUILD)/$(PROG) but the tests are still looking for $(PROG). Also remove the now-unnecessary override of $(PROG) in the standard variant. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Commits to address #9009
First commit changes
py/mkrules.mk
to place build outputs ($(PROG)
and$(LIBMICROPYTHON)
) in the build directory$(BUILD)
.Second commit attempts to fix all paths that assumed the build outputs to be in the working directory of the corresponding build, changing these paths to use the binaries from the respective build directory. It also changes the build rule for the mpy-cross dependency! See below for information why.
Third commit was originally made to work around an issue regarding failing builds for teensy and samd; the mpy-cross was no longer automatically generated in those ci builds. It is now not strictly necessary ... but IMO would be clearer to force this build step (as is done in the ci rules for other ports).
Reason for the issues around the mpy-cross build was that I (orignally, not in these commits!) changed the
MICROPY_MPYCROSS_DEPENDENCY
to point to$(TOP)/mpy-cross/
.. however this directory (ofc) exists, and thus (sinceMICROPY_MPYCROSS_DEPENDENCY
only shows up as an order-only dependency) the rule to build the dependency (using a sub make call) was not run, and thus we had no mpy-cross.I then set
MICROPY_MPYCROSS_DEPENDENCY
to$(TOP)/mpy-cross/-non-exist-dummy-
.. which "worked" but caused the rule to be run everytime. This caused the windows and qemu builds to fail, because there the additional run of the build for mpy-cross tried to use the cross-compiler ... which complained about wrong file format / target architecture.So now I changed the build rule to be explicitly about building the mpy-cross from the repository, which seems like the most sane solution here to me.