BtbN / FFmpeg-Builds

MIT License
7.43k stars 1.02k forks source link

Build failed in step '(top-level)' -> crosstool-ng #280

Closed forlayo closed 1 year ago

forlayo commented 1 year ago

I am trying to create an image with the command:

 ./makeimage.sh win64 lgpl-shared 6.0

And after a while I got this error:

#6 82.12   CCLD     nconf
#6 82.20 gmake[3]: Leaving directory '/ct-ng/kconfig'
#6 82.20 gmake[2]: Leaving directory '/ct-ng/kconfig'
#6 82.21 gmake[2]: Entering directory '/ct-ng'
#6 82.21   GEN      ct-ng
#6 82.21   GEN      bash-completion/ct-ng
#6 82.21   GEN      docs/ct-ng.1
#6 82.26 gmake[2]: Leaving directory '/ct-ng'
#6 82.26 gmake[1]: Leaving directory '/ct-ng'
#6 82.28 ./.config: line 37: $'\r': command not found
#6 82.28 [ERROR]
#6 82.29 [ERROR]  >>
#6 82.29 [ERROR]  >>  Build failed in step '(top-level)'
#6 82.29 [ERROR]  >>
#6 82.29 [ERROR]  >>  Error happened in: source[./.config@37]
#6 82.29 [ERROR]  >>        called from: CT_LoadConfig[scripts/functions@16]
#6 82.29 [ERROR]  >>        called from: main[scripts/crosstool-NG.sh@22]
#6 82.29 [ERROR]  >>
#6 82.30 [ERROR]  >>  There is a list of known issues, some with workarounds, in:
#6 82.30 [ERROR]  >>      https://crosstool-ng.github.io/docs/known-issues/
#6 82.30 [ERROR]  >>
#6 82.30 [ERROR]  >> NOTE: You configuration uses non-default patch sets. Please
#6 82.30 [ERROR]  >> select 'bundled' as the set of patches applied and attempt
#6 82.30 [ERROR]  >> to reproduce this issue. Issues reported with other patch
#6 82.30 [ERROR]  >> set selections (none, local, bundled+local,
#6 82.30 [ERROR]  >> bundled+bundled_exp bundled+bundled_exp+local) are going to
#6 82.30 [ERROR]  >> be closed without explanation.
#6 82.31 [ERROR]  >>
#6 82.31 [ERROR]  >>  If you feel this is a bug in crosstool-NG, report it at:
#6 82.31 [ERROR]  >>      https://github.com/crosstool-ng/crosstool-ng/issues/
#6 82.31 [ERROR]  >>
#6 82.31 [ERROR]  >>  Make sure your report includes all the information pertinent to this issue.
#6 82.31 [ERROR]  >>  Read the bug reporting guidelines here:
#6 82.31 [ERROR]  >>      http://crosstool-ng.github.io/support/
#6 82.31 [ERROR]
#6 82.32 [ERROR]  (elapsed: 28127469:05.18)
#6 82.32 gmake: *** [ct-ng:261: build] Error 127
#6 ERROR: process "/bin/sh -c git clone --filter=blob:none https://github.com/crosstool-ng/crosstool-ng.git /ct-ng && cd /ct-ng &&     ./bootstrap &&     ./configure --enable-local &&     make -j$(nproc) &&     cp /.config .config &&     ./ct-ng build &&     cd / &&     rm -rf ct-ng" did not complete successfully: exit code: 2
------
 > [stage-0 2/6] RUN --mount=src=ct-ng-config,dst=/.config     git clone --filter=blob:none https://github.com/crosstool-ng/crosstool-ng.git /ct-ng && cd /ct-ng &&     ./bootstrap &&     ./configure --enable-local &&     make -j$(nproc) &&     cp /.config .config &&     ./ct-ng build &&     cd / &&     rm -rf ct-ng:
#6 82.31 [ERROR]  >>
#6 82.31 [ERROR]  >>  If you feel this is a bug in crosstool-NG, report it at:
#6 82.31 [ERROR]  >>      https://github.com/crosstool-ng/crosstool-ng/issues/
#6 82.31 [ERROR]  >>
#6 82.31 [ERROR]  >>  Make sure your report includes all the information pertinent to this issue.
#6 82.31 [ERROR]  >>  Read the bug reporting guidelines here:
#6 82.31 [ERROR]  >>      http://crosstool-ng.github.io/support/
#6 82.31 [ERROR]
#6 82.32 [ERROR]  (elapsed: 28127469:05.18)
#6 82.32 gmake: *** [ct-ng:261: build] Error 127
------
WARNING: local cache import at .cache/ghcr.io/btbn/ffmpeg-builds/base-win64_latest not found due to err: could not read .cache/ghcr.io/btbn/ffmpeg-builds/base-win64_latest/index.json: open .cache/ghcr.io/btbn/ffmpeg-builds/base-win64_latest/index.json: The system cannot find the file specified.
Dockerfile:4
--------------------
   3 |
   4 | >>> RUN --mount=src=ct-ng-config,dst=/.config \
   5 | >>>     git clone --filter=blob:none https://github.com/crosstool-ng/crosstool-ng.git /ct-ng && cd /ct-ng && \
   6 | >>>     ./bootstrap && \
   7 | >>>     ./configure --enable-local && \
   8 | >>>     make -j$(nproc) && \
   9 | >>>     cp /.config .config && \
  10 | >>>     ./ct-ng build && \
  11 | >>>     cd / && \
  12 | >>>     rm -rf ct-ng
  13 |
--------------------
ERROR: failed to solve: process "/bin/sh -c git clone --filter=blob:none https://github.com/crosstool-ng/crosstool-ng.git /ct-ng && cd /ct-ng &&     ./bootstrap &&     ./configure --enable-local &&     make -j$(nproc) &&     cp /.config .config &&     ./ct-ng build &&     cd / &&     rm -rf ct-ng" did not complete successfully: exit code: 2
+ rm -f /tmp/tmp.TYrAd5IhBH.toml
BtbN commented 1 year ago

Looks like you are trying to build this from a Windows host, and it somehow mangled the files by replacing the newlines with windows-style ones. While it's in theory possible to build from Windows, issues like this are why I'd highly recommend to just build on Linux. WSL works fine.

forlayo commented 1 year ago

Thanks a lot, I’ll try this night from WSL2. How did you noticed this? I wasn’t aware of the issue per the trace (just curious and to learn as well)

BtbN commented 1 year ago
#6 82.28 ./.config: line 37: $'\r': command not found

That's it complaining about a CR character, which is part of the \r\n windows-style newlines. Anything after that are just a follow-up errors due to it failing to parse its config file.

forlayo commented 1 year ago

On WSL2 it works like a charm. Thanks again :)