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

oslc un-escapes the path to stdosl.h #866

Closed
LazyDodo opened this issue Feb 20, 2018 · 8 comments
Closed

oslc un-escapes the path to stdosl.h #866

LazyDodo opened this issue Feb 20, 2018 · 8 comments

Comments

@LazyDodo
Copy link

Problem

When installing oslc in a path that has \n in it ( such as c:\osl_test\new\ ) oslc will
fail trying to compile any shader. due to the path being un-escaped somewhere.

Steps to Reproduce

c:\osl_test>new\osl\bin\oslc.exe test.osl
c:\osl_test\test.osl:1: error: error: could not find include file: c:\osl_test
ew\osl/shaders/stdosl.h

FAILED test.osl

c:\osl_test>rename new old

c:\osl_test>old\osl\bin\oslc.exe test.osl
Compiled test.osl -> mytest.oso

c:\osl_test>

I validated with procmon that the path is indeed unescaped

Versions

  • OSL branch/version: tested 1.7.5 and 1.9.3
  • OS: Windows
  • C++ compiler: msvc 2015
@lgritz
Copy link
Collaborator

lgritz commented Jan 22, 2020

Hi, sorry for this to slip through the cracks. Can somebody verify whether or not this is still a problem in the current master and/or release branch?

@lgritz
Copy link
Collaborator

lgritz commented Jan 23, 2020

#1073 seems to be on a related topic, but I'm not sure if it addresses this particular bug.

@LazyDodo
Copy link
Author

LazyDodo commented Jan 23, 2020

Not a problem! Between the time of reporting and now I'm only aware of a single blender user bumping into this one.

I can still reproduce the issue

c:\osl>old\bin\oslc.exe test.osl
Compiled test.osl -> test.oso

c:\osl>rename old new

c:\osl>new\bin\oslc.exe test.osl
c:\osl\test.osl:1: error: error: could not find include file: c:\osl
ew/shaders/stdosl.h
FAILED test.osl

c:\osl>new\bin\oslc.exe --help
oslc -- Open Shading Language compiler 1.10.8
(c) Copyright 2009-2019 Sony Pictures Imageworks, et al. All rights reserved.

Update: applying #1073 did not seem to help

@lgritz
Copy link
Collaborator

lgritz commented Jan 23, 2020

So the problem is specifically when the path to oslc contains a directory starting with n?

Or is it also a problem when the osl file is in a directory starting with n?

um, I mean,

> c:\path\to\new\oslc test.osl

> oslc c:\path\to\new\test.osl

Both problems, just first, or just second?

@LazyDodo
Copy link
Author

Only the first,

@lgritz
Copy link
Collaborator

lgritz commented Jan 24, 2020

Proposed fix in #1101.

Would you by any chance be able to test this on Windows?
If it works, I can backport to release branch as well.

@LazyDodo
Copy link
Author

That worked, with a minor caveat, i build against an rather old version oiio (1.8.13) which seems to be missing OIIO::Strutil::sprintf replaced it with OIIO::Strutil::format and that did the trick.

@lgritz
Copy link
Collaborator

lgritz commented Jan 27, 2020

Closing, should be fixed by #1101. It's in master now, and I will backport to 1.10, pending tests.

@lgritz lgritz closed this as completed Jan 27, 2020
fsiddi pushed a commit to blender/blender that referenced this issue Feb 8, 2020
OSL 1.10.9 fixes osl-bug 866 [1] which is long standing issue
on windows where paths get un-escaped and osl breaks when you
install it to for instance c:\blender-tests\new-boolean

This patch bumps osl to 1.10.9, and since osl is llvm's
only consumer, llvm/clang were bumped 9.0.1

Removed some of the patches that were no longer needed

Builds and passes all tests on windows and linux

[1] AcademySoftwareFoundation/OpenShadingLanguage#866

Differential Revision: https://developer.blender.org/D6744

Reviewers: brecht
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants