BtbN / FFmpeg-Builds

MIT License
7.76k stars 1.07k forks source link

Debug build #340

Closed miltontaylor-panotek closed 7 months ago

miltontaylor-panotek commented 9 months ago

Am trying to get a debug build of this through a github action, using a fork of this repo...

I made a copy of the build.yml file and reduced it down to just do a win64 build of nonfree-shared and it does that fine. However for the life of me I cannot get it to build the debug variant.

This is what I tried most recently, but the release it produced seemed to be the same as the normal one - there were no pdb files in the zip. Also could not quite work out how to specify both debug and 6.1 together... seems the bit that does the image management is not expecting a combo of three variant codes like this: [nonfree-shared 6.1 debug]

  build_ffmpeg:
    name: Build ffmpeg
    if: ${{ ( github.event.inputs.buildOnly == 'true' && !cancelled() ) || success() }}
    needs: build_targets
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        target: [win64]
        variant: [nonfree-shared debug]
pzhlkj6612 commented 9 months ago
-         variant: [nonfree-shared debug]
+         variant: [nonfree-shared, debug]

It's a YAML array in Flow Sequences form [1] in GitHub Actions' config [2].

[1] 7.4.1. Flow Sequences § YAML Ain’t Markup Language (YAML™) revision 1.2.2 [2] jobs.<job_id>.strategy.matrix § Workflow syntax for GitHub Actions - GitHub Docs

miltontaylor-panotek commented 9 months ago

Nope I don't think that's actually right, as what we want is variant nonfree-shared with addins both debug AND 6.1. If you put comma in that creates more array combinations of the individual elements.

With it looking like this, which I believe is correct:

     matrix:
        target: [win64]
        variant: [nonfree-shared debug 6.1]

The build fails during Build target base image with this error:

ERROR: invalid tag "ghcr.io/panotek/ffmpeg-btbn/win64-nonfree-shared-debug 6.1:latest": invalid reference format

The embedded space appears to be the issue. I'm not sure this workflow script has been designed for the case of speccing more than "addin" even though the repo readme.md talks about being able to do this.

BtbN commented 9 months ago

Looks to me like you only set the variant on the actual build of ffmpeg, without ever generating a matching image. Hence the error of it failing to find the image. There's two places that need matching target/variant settings.

But please keep in mind that building and publishing any kind of nonfree builds is violating the GPL. The literal only thing that's different in those builds is fdk being present, so it's not worth the hassle.

miltontaylor-panotek commented 9 months ago

No I don't think that's right ... I edited the workflow file in both places where the list of variants occur. I think there is a subtle scripting fault of some type that only shows up when you try to build as above, speccing more than one addin to be used together. (See the logged Error line above - the tag for the image is almost correct but is putting an embedded space in instead of a hyphen.

Even if this was working correctly, when I tried it on the simpler case of only having one addin (debug) and not speccing the branch, the published released still did not contain any pdb files, so am wondering if the step that packages the release actually even does this?

Re your comments about nonfree - noted. Same would occur with lgpl-shared though?

BtbN commented 9 months ago

Oh yeah, the variable substitution that replaces the spaces should use // instead of just /.

miltontaylor-panotek commented 9 months ago

Ah!

Can you also confirm if the resulting zip from a debug build (upload to github releases) would in fact contain the pdb files?

BtbN commented 9 months ago

This is not MSVC. There are no pdb files. It'll be gdb compatible embedded debug info. Also, a debug build is huge, I'm not sure if even a single one fits githubs asset size limit.

miltontaylor-panotek commented 9 months ago

I'm by no means an expert in linux cross compiles, but there is an option in lld to generate pdb files from a linux build. (There is also a util that converts from gdb to pdb format but I don't believe the result would be quite as good)

-g -gcodeview --for-linker --pdb=some_filename.pdb