fix(win): Embed manifest in OIIO .exes to enable long path handling#5066
Open
nrusch wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
Open
fix(win): Embed manifest in OIIO .exes to enable long path handling#5066nrusch wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
nrusch wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
Conversation
|
|
nrusch
commented
Mar 2, 2026
Comment on lines
+3
to
+4
| // The value is invariant, so should be safe to hardcode, but we could replace | ||
| // 24 with `RT_MANIFEST` by adding `#include "winres.h"` first. |
Contributor
Author
There was a problem hiding this comment.
This is something I don't have a strong instinct for. The manifest resource ID isn't going to change, and this value hardcoding seems to be fairly commonplace from what I've found. I opted to avoid an #include here to start just because I don't know if that would have any other implications.
Collaborator
|
Need a DCO sign-off on the commit. Can you add something to the testsuite that verifies that this allows the long filenames so we will know if there is any regression? |
Signed-off-by: Nathan Rusch <nrusch@users.noreply.github.com>
54b05d2 to
1e67550
Compare
Contributor
Author
|
DCO should be fixed. I'll look at adding a test for this as soon as I can. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds an embedded manifest to OIIO's generated executables on Windows, which enables "long path" awareness.
This is done via a "resource" file, with the manifest resource ID specified. From what I've read, this is more broadly compatible with e.g. non-MSVC build toolchains like MinGW.
The manifest file was created by building OIIO from
main, extracting the manifest from the resultingoiiotool(using themttool), and manually adding in the XML snippet from https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry#application-manifest-updates-to-declare-long-path-capability.Fixes #5064
Tests
No new tests added, but I have confirmed that built executables seem to "just work" with long paths after applying this patch, where they are unable to open the path prior to patching.
The one executable that I have not tested is
iv. The only reason I'm more curious about it than others is that it is a GUI executable, so I'm not sure if its defaultChecklist:
behavior.
testsuite.
PR, by pushing the changes to my fork and seeing that the automated CI
passed there. (Exceptions: If most tests pass and you can't figure out why
the remaining ones fail, it's ok to submit the PR and ask for help. Or if
any failures seem entirely unrelated to your change; sometimes things break
on the GitHub runners.)
fixed any problems reported by the clang-format CI test.
corresponding Python bindings. If altering ImageBufAlgo functions, I also
exposed the new functionality as oiiotool options.