Skip to content

Fix NuttX build under Cygwin#16040

Merged
davids5 merged 1 commit into
masterfrom
fix-cygwin-nuttx-build
Oct 23, 2020
Merged

Fix NuttX build under Cygwin#16040
davids5 merged 1 commit into
masterfrom
fix-cygwin-nuttx-build

Conversation

@MaEtUgR
Copy link
Copy Markdown
Member

@MaEtUgR MaEtUgR commented Oct 23, 2020

Describe problem solved by this pull request
NuttX build using the Cygwin Toolchain is broken since the NuttX 9.1.0+ upgrade #15139 . The pr was merged nevertheless to unblock core developers using the new NuttX version and with the intent to fix the build shortly after. PX4 stable v1.11 was the officially recommended version to build in case you ran into any problems.

Fixes #15760

Describe your solution
It took me quite some time to figure out:

  • NuttX has a new way of configuring the build environment now using multiple flags
  • Those flags have to be set before including Config.mk
  • The new way of assembling ARCHINCLUDES even before the makefile made a new way of converting the include paths that are already inside compile flags necessary
  • Backslashes in the compile flags for some reason get parsed and have to be escaped. I did not invest time in findign exactly where that happens but it's most likely within the NuttX build system and when escaping them it all works fine.

Test data / coverage
So far I build px4_fmu-v4 locally but didn't do any hardware tests yet.

Additional context
image

after NuttX 9.1.0+ upgrade #15139
@MaEtUgR MaEtUgR requested review from dagar and davids5 October 23, 2020 13:05
@MaEtUgR MaEtUgR self-assigned this Oct 23, 2020
else
ARCHSCRIPT = -T$(BOARD_DIR)$(DELIM)scripts$(DELIM)flash.ld
ifeq ($(CONFIG_BOARD_USE_PROBES),y)
ARCHINCLUDES += -I $(TOPDIR)/arch/$(CONFIG_ARCH)/src/$(CONFIG_ARCH_CHIP) -I $(TOPDIR)/arch/$(CONFIG_ARCH)/src/common
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@davids5 I shifted these additions up because they need to get converted as well and added spaces between -I and the path for simpler makefile parsing.

Copy link
Copy Markdown
Member

@davids5 davids5 left a comment

Choose a reason for hiding this comment

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

@MaEtUgR - Thank you for fixing this!

@davids5 davids5 merged commit 4378254 into master Oct 23, 2020
@davids5 davids5 deleted the fix-cygwin-nuttx-build branch October 23, 2020 13:56
@davids5
Copy link
Copy Markdown
Member

davids5 commented Oct 23, 2020

@MaEtUgR - can we re-enable the windows CI build now?

@MaEtUgR
Copy link
Copy Markdown
Member Author

MaEtUgR commented Oct 23, 2020

@davids5 Yes, @dagar was so nice and turned it on again for prs 👍

@lukegluke
Copy link
Copy Markdown
Contributor

@MaEtUgR thanks for work, windows builds ok again.
I notice that now (after moving to latest PX4 with upgraded NuttX) it takes more time to build, even if there is nothing to build. Previously there was such output: "nothing to build", now it always prints [1/4] Generating apps/libapps.a, apps/platform/.built at least.

@MaEtUgR
Copy link
Copy Markdown
Member Author

MaEtUgR commented Nov 11, 2020

@lukegluke Thanks for the feedback. I'm currently assuming that's a general build system issue and not specific to the Windows toolchain. We should check that. Could you make a separate issue for that problem and tag me?

@lukegluke
Copy link
Copy Markdown
Contributor

Done!

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.

Windows build issue

3 participants