Skip to content

Makefile: fix for overlong command line #12646

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

Merged
merged 1 commit into from
Mar 20, 2020
Merged

Makefile: fix for overlong command line #12646

merged 1 commit into from
Mar 20, 2020

Conversation

dhebbeker
Copy link
Contributor

Description

The list of object files was so long, that it got truncated by the bash (git-bash).

Error was

/usr/bin/sh: -c: line 0: unexpected EOF while looking for matching `"'
/usr/bin/sh: -c: line 1: syntax error: unexpected end of file
mingw32-make[1]: *** [Makefile:679: mbed-os-example-blinky-baremetal.elf] Error 1
mingw32-make: *** [Makefile:26: all] Error 2

This may fix #10943

I fixed this problem using this answer.

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

Release Notes

The list of object files was so long, that it got truncated by the bash (git-bash).

Error was

    /usr/bin/sh: -c: line 0: unexpected EOF while looking for matching `"'
    /usr/bin/sh: -c: line 1: syntax error: unexpected end of file
    mingw32-make[1]: *** [Makefile:679: mbed-os-example-blinky-baremetal.elf] Error 1
    mingw32-make: *** [Makefile:26: all] Error 2

Such a problem has aleady been reported in: #10943 (comment)
I fixed this problem using this answer: https://stackoverflow.com/a/37506805/5534993
@ciarmcom ciarmcom requested review from a team March 18, 2020 16:00
@ciarmcom
Copy link
Member

@dhebbeker, thank you for your changes.
@ARMmbed/mbed-os-tools @ARMmbed/mbed-os-maintainers please review.

@0xc0170 0xc0170 changed the title Fixed problem with overlong command line. Makefile: fix for overlong command line Mar 19, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented Mar 19, 2020

CI started

@mergify mergify bot added needs: CI and removed needs: review labels Mar 19, 2020
@mbed-ci
Copy link

mbed-ci commented Mar 19, 2020

Test run: FAILED

Summary: 1 of 7 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_dynamic-memory-usage

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 19, 2020

Known issue, will be fixed and test restarted

@adbridge
Copy link
Contributor

@dhebbeker you're using a really old version of our PR template. Could you please update to the latest version ? E.g. like this one #12662 . Thanks

@adbridge
Copy link
Contributor

In the meantime I will restart CI

@mbed-ci
Copy link

mbed-ci commented Mar 20, 2020

Test run: SUCCESS

Summary: 7 of 7 test jobs passed
Build number : 2
Build artifacts

@adbridge adbridge merged commit 59540ed into ARMmbed:master Mar 20, 2020
@dhebbeker dhebbeker deleted the fix/fix-makefile-for-windows branch March 20, 2020 16:58
@dhebbeker
Copy link
Contributor Author

@dhebbeker you're using a really old version of our PR template.

Yes, somehow I mistakenly forked from an old fork of the original repository. I deleted my old fork.

Thank you @adbridge for merging this PR!

@vmedcy
Copy link
Contributor

vmedcy commented Mar 21, 2020

Hello @dhebbeker - can you please explain how $(file > .link_options.txt,$(filter %.o, $^) is a valid make syntax? Number of opening and closing brackets does not match.

I tested this on macOS (GNU make 3.81) and see an error:

link: mbed-os-example-wifi.elf
arm-none-eabi-gcc: error: .link_options.txt: No such file or directory
make[1]: *** [mbed-os-example-wifi.elf] Error 1

The error persists when I add an extra brace at the end of $(file ) command.

Basically this broke all exporters that depend on Makefile.

The issue #10943 has a reference to 6918e6a which I introduced a year ago. The commit message provides an explanation:

$(file > $@.in, $(filter %.o, $^)) is not supported in GNU Make 3.81.

@dhebbeker
Copy link
Contributor Author

dhebbeker commented Mar 21, 2020

@vmedcy, you are right, the change is not valid!

  • a closing bracket is missing
  • I did test it with mingw32-make only, but not directly the template...

Also I did not read your commit 6918e6a which documents the issue in detail.

This is bad, my apologies.

I am going to create a PR to revert the changes right away. @adbridge, can you please re-open #10943 again, as it is not fixed by this issue?

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 23, 2020

Thanks @vmedcy for the report and explanation, will revert the change

0xc0170 added a commit that referenced this pull request Mar 23, 2020
Makefile: render compatible with some GNU make versions (revert #12646)
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.

Problem with Makefile.tmpl
6 participants