Skip to content
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

libplacebo (update dependencies) #126408

Closed
wants to merge 1 commit into from
Closed

libplacebo (update dependencies) #126408

wants to merge 1 commit into from

Conversation

ahobsonsayers
Copy link
Contributor

@ahobsonsayers ahobsonsayers commented Mar 22, 2023

libplacebo does not depend on ffmpeg so it should be removed from the list of dependencies.
shaderc should be included as a dependency as recommended by the libplacebo compilation readme.

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

libplacebo does not depend on ffmpeg so it should be removed from
the list of dependencies.
shaderc should be included as a dependancy as recommended by the
libplacebo compilation readme.
@chenrui333
Copy link
Member

  ==> Installing libplacebo dependency: shaderc
  ==> Pouring shaderc--2023.3.arm64_monterey.bottle.tar.gz
  The formula built, but is not symlinked into /opt/homebrew
  Could not symlink bin/glslangValidator
  Target /opt/homebrew/bin/glslangValidator

@ahobsonsayers
Copy link
Contributor Author

Hmm @chenrui333, I am very unsure as to why this error is happening. Is this an issue with shaderc?

@ahobsonsayers
Copy link
Contributor Author

It seems that the root of this problem is that the shaderc formula downloads and installs glslang as a resource (from its git repo) instead of depending on the glslang formula. Therefore I see two solutions to this issue:

  1. Update the shaderc formula to depend on the glslang instead of installing it as a resource.

  2. Remove glslang as a dependency to libplacebo, and rely and the version that gets installed as a resource as part of shaderc

It's seems to me that 1 would probably be preferred, but would like to get some input on this.

@carlocab
Copy link
Member

shaderc and glslang both provide a bin/glslangValidator so they currently can't be installed at the same time.

@carlocab
Copy link
Member

It's seems to me that 1 would probably be preferred, but would like to get some input on this.

Yes, agree with this. You can try to fix shaderc in a separate PR.

@ahobsonsayers
Copy link
Contributor Author

@carlocab I looked into fixing shaderc, but looking at this issue there doesn't seem to be support for building shaderc against a prebuilt version of glslang (such as the one provided by Homebrew).

As such i think a better approach is to remove the dependency on glslang from this formula, and simply depend on shaderc instead

@carlocab
Copy link
Member

shaderc shouldn't be installing its own glslang, though, since we do:

"-DSKIP_GLSLANG_INSTALL=ON",

This seems like a bug in shaderc that we should fix.

@ahobsonsayers
Copy link
Contributor Author

ahobsonsayers commented Mar 30, 2023

@carlocab as far i can see it is not the build of shaderc that is installing glslang - -DSKIP_GLSLANG_INSTALL seems to be doing what is expected.

Im pretty sure the glslang binary is being installed by these lines in the formula, and this means you cannot the install glslang formula as it will attempt to install a conflicting binary.

resource "glslang" do
# https://github.com/google/shaderc/blob/known-good/known_good.json
url "https://github.com/KhronosGroup/glslang.git",
revision: "ef77cf3a92490f7c37f36f20263cd3cd8c94f009"
end

To be honest i think there needs to be another line like the below for glslang in the shaderc formula.

conflicts_with "spirv-tools", because: "both install `spirv-*` binaries"

I am not sure what the next steps are to get this working as this is not a shaderc issue, i think the shaderc formula needs updating, but I am not sure what the best approach to this is. What is especially problematic is that shaderc cannot be compiled using the brew version of glslang as it requires a CMakeLists.txt to be present.

@carlocab
Copy link
Member

Im pretty sure the glslang binary is being installed by these lines in the formula, and this means you cannot the install glslang formula as the there will be conflicting binaries.

resource "glslang" do
# https://github.com/google/shaderc/blob/known-good/known_good.json
url "https://github.com/KhronosGroup/glslang.git",
revision: "ef77cf3a92490f7c37f36f20263cd3cd8c94f009"
end

I'm not sure how the glslang binary is being installed by these lines. If you're not convinced: add these lines to your formula and see if you have glslang installed by it after.

@ahobsonsayers
Copy link
Contributor Author

You are of course correct, i must've been having bit of a brain fart, this is simply cloning the repo, there is no way this would install a binary... Sorry about that!

Looking into it further.

@ahobsonsayers
Copy link
Contributor Author

ahobsonsayers commented Mar 30, 2023

Ok I have actually managed to find the source of this issue. The culprit is this line in the glslang CMakeLists.txt

https://github.com/KhronosGroup/glslang/blob/45405e1d942e7af1a1f2fad94a8b9ddf2600af0d/CMakeLists.txt#L71

The solution therefore is to add the argument -DENABLE_GLSLANG_BINARIES=OFF to the build step of the shaderc formula. This change meant that no glslangValidator binary got installed when installing shaderc via the tweaked formula.

Now however im now getting a different issue when installing libplacebo:

==> Pouring glslang--12.1.0.x86_64_linux.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /home/linuxbrew/.linuxbrew
Could not symlink include/glslang/HLSL/hlslAttributes.h
Target /home/linuxbrew/.linuxbrew/include/glslang/HLSL/hlslAttributes.h
is a symlink belonging to shaderc. You can unlink it:
  brew unlink shaderc

To force the link and overwrite all conflicting files:
  brew link --overwrite glslang

To list all files that would be deleted:
  brew link --overwrite --dry-run glslang

Possible conflicting files are:
/home/linuxbrew/.linuxbrew/include/glslang/HLSL/hlslAttributes.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/HLSL/hlslAttributes.h
/home/linuxbrew/.linuxbrew/include/glslang/HLSL/hlslGrammar.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/HLSL/hlslGrammar.h
/home/linuxbrew/.linuxbrew/include/glslang/HLSL/hlslOpMap.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/HLSL/hlslOpMap.h
/home/linuxbrew/.linuxbrew/include/glslang/HLSL/hlslParseHelper.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/HLSL/hlslParseHelper.h
/home/linuxbrew/.linuxbrew/include/glslang/HLSL/hlslParseables.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/HLSL/hlslParseables.h
/home/linuxbrew/.linuxbrew/include/glslang/HLSL/hlslScanContext.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/HLSL/hlslScanContext.h
/home/linuxbrew/.linuxbrew/include/glslang/HLSL/hlslTokenStream.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/HLSL/hlslTokenStream.h
/home/linuxbrew/.linuxbrew/include/glslang/HLSL/hlslTokens.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/HLSL/hlslTokens.h
/home/linuxbrew/.linuxbrew/include/glslang/Include/BaseTypes.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/Include/BaseTypes.h
/home/linuxbrew/.linuxbrew/include/glslang/Include/Common.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/Include/Common.h
/home/linuxbrew/.linuxbrew/include/glslang/Include/ConstantUnion.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/Include/ConstantUnion.h
/home/linuxbrew/.linuxbrew/include/glslang/Include/InfoSink.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/Include/InfoSink.h
/home/linuxbrew/.linuxbrew/include/glslang/Include/InitializeGlobals.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/Include/InitializeGlobals.h
/home/linuxbrew/.linuxbrew/include/glslang/Include/PoolAlloc.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/Include/PoolAlloc.h
/home/linuxbrew/.linuxbrew/include/glslang/Include/ResourceLimits.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/Include/ResourceLimits.h
/home/linuxbrew/.linuxbrew/include/glslang/Include/ShHandle.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/Include/ShHandle.h
/home/linuxbrew/.linuxbrew/include/glslang/Include/SpirvIntrinsics.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/Include/SpirvIntrinsics.h
/home/linuxbrew/.linuxbrew/include/glslang/Include/Types.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/Include/Types.h
/home/linuxbrew/.linuxbrew/include/glslang/Include/arrays.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/Include/arrays.h
/home/linuxbrew/.linuxbrew/include/glslang/Include/glslang_c_interface.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/Include/glslang_c_interface.h
/home/linuxbrew/.linuxbrew/include/glslang/Include/glslang_c_shader_types.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/Include/glslang_c_shader_types.h
/home/linuxbrew/.linuxbrew/include/glslang/Include/intermediate.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/Include/intermediate.h
/home/linuxbrew/.linuxbrew/include/glslang/MachineIndependent/Initialize.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/MachineIndependent/Initialize.h
/home/linuxbrew/.linuxbrew/include/glslang/MachineIndependent/LiveTraverser.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/MachineIndependent/LiveTraverser.h
/home/linuxbrew/.linuxbrew/include/glslang/MachineIndependent/ParseHelper.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/MachineIndependent/ParseHelper.h
/home/linuxbrew/.linuxbrew/include/glslang/MachineIndependent/RemoveTree.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/MachineIndependent/RemoveTree.h
/home/linuxbrew/.linuxbrew/include/glslang/MachineIndependent/Scan.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/MachineIndependent/Scan.h
/home/linuxbrew/.linuxbrew/include/glslang/MachineIndependent/ScanContext.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/MachineIndependent/ScanContext.h
/home/linuxbrew/.linuxbrew/include/glslang/MachineIndependent/SymbolTable.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/MachineIndependent/SymbolTable.h
/home/linuxbrew/.linuxbrew/include/glslang/MachineIndependent/Versions.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/MachineIndependent/Versions.h
/home/linuxbrew/.linuxbrew/include/glslang/MachineIndependent/attribute.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/MachineIndependent/attribute.h
/home/linuxbrew/.linuxbrew/include/glslang/MachineIndependent/gl_types.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/MachineIndependent/gl_types.h
/home/linuxbrew/.linuxbrew/include/glslang/MachineIndependent/glslang_tab.cpp.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/MachineIndependent/glslang_tab.cpp.h
/home/linuxbrew/.linuxbrew/include/glslang/MachineIndependent/iomapper.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/MachineIndependent/iomapper.h
/home/linuxbrew/.linuxbrew/include/glslang/MachineIndependent/localintermediate.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/MachineIndependent/localintermediate.h
/home/linuxbrew/.linuxbrew/include/glslang/MachineIndependent/parseVersions.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/MachineIndependent/parseVersions.h
/home/linuxbrew/.linuxbrew/include/glslang/MachineIndependent/preprocessor/PpContext.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/MachineIndependent/preprocessor/PpContext.h
/home/linuxbrew/.linuxbrew/include/glslang/MachineIndependent/preprocessor/PpTokens.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/MachineIndependent/preprocessor/PpTokens.h
/home/linuxbrew/.linuxbrew/include/glslang/MachineIndependent/propagateNoContraction.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/MachineIndependent/propagateNoContraction.h
/home/linuxbrew/.linuxbrew/include/glslang/MachineIndependent/reflection.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/MachineIndependent/reflection.h
/home/linuxbrew/.linuxbrew/include/glslang/Public/ResourceLimits.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/Public/ResourceLimits.h
/home/linuxbrew/.linuxbrew/include/glslang/Public/ShaderLang.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/Public/ShaderLang.h
/home/linuxbrew/.linuxbrew/include/glslang/Public/resource_limits_c.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/Public/resource_limits_c.h
/home/linuxbrew/.linuxbrew/include/glslang/SPIRV/GLSL.ext.AMD.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/SPIRV/GLSL.ext.AMD.h
/home/linuxbrew/.linuxbrew/include/glslang/SPIRV/GLSL.ext.ARM.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/SPIRV/GLSL.ext.ARM.h
/home/linuxbrew/.linuxbrew/include/glslang/SPIRV/GLSL.ext.EXT.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/SPIRV/GLSL.ext.EXT.h
/home/linuxbrew/.linuxbrew/include/glslang/SPIRV/GLSL.ext.KHR.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/SPIRV/GLSL.ext.KHR.h
/home/linuxbrew/.linuxbrew/include/glslang/SPIRV/GLSL.ext.NV.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/SPIRV/GLSL.ext.NV.h
/home/linuxbrew/.linuxbrew/include/glslang/SPIRV/GLSL.std.450.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/SPIRV/GLSL.std.450.h
/home/linuxbrew/.linuxbrew/include/glslang/SPIRV/GlslangToSpv.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/SPIRV/GlslangToSpv.h
/home/linuxbrew/.linuxbrew/include/glslang/SPIRV/Logger.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/SPIRV/Logger.h
/home/linuxbrew/.linuxbrew/include/glslang/SPIRV/NonSemanticDebugPrintf.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/SPIRV/NonSemanticDebugPrintf.h
/home/linuxbrew/.linuxbrew/include/glslang/SPIRV/NonSemanticShaderDebugInfo100.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/SPIRV/NonSemanticShaderDebugInfo100.h
/home/linuxbrew/.linuxbrew/include/glslang/SPIRV/SPVRemapper.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/SPIRV/SPVRemapper.h
/home/linuxbrew/.linuxbrew/include/glslang/SPIRV/SpvBuilder.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/SPIRV/SpvBuilder.h
/home/linuxbrew/.linuxbrew/include/glslang/SPIRV/SpvTools.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/SPIRV/SpvTools.h
/home/linuxbrew/.linuxbrew/include/glslang/SPIRV/bitutils.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/SPIRV/bitutils.h
/home/linuxbrew/.linuxbrew/include/glslang/SPIRV/disassemble.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/SPIRV/disassemble.h
/home/linuxbrew/.linuxbrew/include/glslang/SPIRV/doc.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/SPIRV/doc.h
/home/linuxbrew/.linuxbrew/include/glslang/SPIRV/hex_float.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/SPIRV/hex_float.h
/home/linuxbrew/.linuxbrew/include/glslang/SPIRV/spirv.hpp -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/SPIRV/spirv.hpp
/home/linuxbrew/.linuxbrew/include/glslang/SPIRV/spvIR.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/SPIRV/spvIR.h
/home/linuxbrew/.linuxbrew/include/glslang/build_info.h -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/include/glslang/build_info.h
/home/linuxbrew/.linuxbrew/lib/cmake/HLSLTargets.cmake -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/lib/cmake/HLSLTargets.cmake
/home/linuxbrew/.linuxbrew/lib/cmake/OGLCompilerTargets.cmake -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/lib/cmake/OGLCompilerTargets.cmake
/home/linuxbrew/.linuxbrew/lib/cmake/OSDependentTargets.cmake -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/lib/cmake/OSDependentTargets.cmake
/home/linuxbrew/.linuxbrew/lib/cmake/SPIRVTargets.cmake -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/lib/cmake/SPIRVTargets.cmake
/home/linuxbrew/.linuxbrew/lib/cmake/SPVRemapperTargets.cmake -> /home/linuxbrew/.linuxbrew/Cellar/shaderc/2023.3/lib/cmake/SPVRemapperTargets.cmake
Error: Could not symlink lib/cmake/glslang/glslang-config-version.cmake
Target /home/linuxbrew/.linuxbrew/lib/cmake/glslang/glslang-config-version.cmake
is a symlink belonging to shaderc. You can unlink it:
  brew unlink shaderc

To force the link and overwrite all conflicting files:
  brew link --overwrite shaderc

To list all files that would be deleted:
  brew link --overwrite --dry-run shaderc

I am not sure how I can get around this...

@carlocab
Copy link
Member

Is there a way to get shaderc not to install the glslang headers?

At this stage it may be worth reporting a bug to the shaderc project. Either their flag doesn't do what it says it does, or we've misunderstood what it's meant to do. In either case, it seems worth checking upstream.

@github-actions
Copy link
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale No recent activity label Apr 20, 2023
@github-actions github-actions bot closed this Apr 28, 2023
@ahobsonsayers
Copy link
Contributor Author

With the recent updates to the shaderc formula I believe this PR should now be ok and all tests should pass. Can this be reopened @carlocab or would you like me to open a new PR?

@carlocab
Copy link
Member

Go ahead and open a new one, but rewrite your commit message so it follows the style of other commits:

libplacebo: update dependencies

Or, preferably, something slightly more specific (but ideally of the same length).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale No recent activity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants