HandBrake / HandBrake/HandBrake

Guard against CMAKE_GENERATOR in the environment

Open
#5,804 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement
Dominant language
C
Stars
24.4k
Forks
1.7k
Avg merge
5d 1h
Merged PRs (30d)
8

Description

Problem Description

When building the SVT-AV1 contrib, I ran into an error because I had set CMAKE_GENERATOR=ninja in my environment (so that CMake generates ninja build files), but the Handbrake build script continued calling make, which obviously fails if no Makefile exists.

I've had this issue with SVT-AV1, but I assume the same issue exists for other CMake-based contribs.

I'm no Handbrake.git expert, but generally there are a couple ways to prevent this issue:

  • set CMAKE_GENERATOR="" or unset CMAKE_GENERATOR when configuring CMake projects, to guard against the environment
  • use cmake --build instead of make for CMake-based projects, so that the generator doesn't matter
  • pass -G "Unix Makefiles" to CMake, to always generate Makefiles
Activity Log, Crash Log or any other details
user@host:/HandBrake/build$ make
make -C ./contrib/svt-av1/SVT-AV1-v1.7.0/build clean
make[1]: Entering directory '/HandBrake/build/contrib/svt-av1/SVT-AV1-v1.7.0/build'
make[1]: *** No rule to make target 'clean'.  Stop.
make[1]: Leaving directory '/HandBrake/build/contrib/svt-av1/SVT-AV1-v1.7.0/build'
make: [../contrib/svt-av1/module.rules:2: contrib/svt-av1/.stamp.svt-av1.build] Error 2 (ignored)
/usr/bin/rm -f ./contrib/svt-av1/.stamp.svt-av1.build
make -C ./contrib/svt-av1/SVT-AV1-v1.7.0/build
make[1]: Entering directory '/HandBrake/build/contrib/svt-av1/SVT-AV1-v1.7.0/build'
make[1]: *** No targets specified and no makefile found.  Stop.
make[1]: Leaving directory '/HandBrake/build/contrib/svt-av1/SVT-AV1-v1.7.0/build'
make: *** [../contrib/svt-av1/module.rules:3: contrib/svt-av1/.stamp.svt-av1.build] Error 2
What Operating System are you running?

Ubuntu 23.10

What version of HandBrake are you running?

1.7.3

Where did you download HandBrake from?

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review contrib/svt-av1/module.rules and the CMake-based contrib build rules, then reproduce the failure with CMAKE_GENERATOR=ninja in the environment. Done means the affected contrib builds successfully without requiring a Makefile when that environment variable is set.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.