Navigation Menu

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

ppm: raise an error if fopen failed #143

Merged
merged 1 commit into from Feb 4, 2016
Merged

Conversation

deltheil
Copy link
Collaborator

@deltheil deltheil commented Feb 4, 2016

Apart from this minor PR, note that I faced this problem while re-installing and running tests (that failed / seg. faulted because of missing assets). LuaRocks install logs indicated that:

-- Installing: /path/to/torch/install/lib/luarocks/rocks/image/1.1.alpha-0/lua/image/assets/lena.jpg
[...]
Warning: /path/to/torch/install/share/lua/5.1/image/assets/lena.jpg is not tracked by this installation of LuaRocks. Moving it to /path/to/torch/install/share/lua/5.1/image/assets/lena.jpg~~~

First time ever I encountered this. Plus: it sounds like there is a race or something because it is not reproducible.

So the question is: is it the right way to do to install asset files on behalf of LuaRocks like here? (apparently not)

I thought about using copy_directories:

build = {
   type = "command",
   -- ...
   copy_directories = { "assets" }
}

But then the assets are in a non standard location - see this discussion on this topic: luarocks/luarocks#168

What do you guys think would be the right solution?

soumith added a commit that referenced this pull request Feb 4, 2016
ppm: raise an error if fopen failed
@soumith soumith merged commit 134f859 into torch:master Feb 4, 2016
@soumith
Copy link
Member

soumith commented Feb 4, 2016

we install assets via cmake INSTALL, into the lua directory itself. any issues with that?

@soumith
Copy link
Member

soumith commented Feb 4, 2016

for example, we install the .md files already this way (for in-line help)

@deltheil
Copy link
Collaborator Author

deltheil commented Feb 4, 2016

This is what is done for torch/image too:

INSTALL(DIRECTORY "assets" DESTINATION "${Torch_INSTALL_LUA_PATH_SUBDIR}/image")

The thing is from time to time LuaRocks complains about files not tracked by this installation of LuaRocks (see above install logs) - and move them with a ~~ suffix.

It's definitely a problem as tests might fail then.

@deltheil deltheil deleted the ppm-fopen branch February 4, 2016 14:14
@soumith
Copy link
Member

soumith commented Feb 4, 2016

:O luarocks, what are you doing....

@deltheil
Copy link
Collaborator Author

deltheil commented Feb 4, 2016

This is why I planned to fix this by using copy_directories - but then things get more complicated with paths even though using something like https://github.com/hishamhm/datafile might help.

@soumith
Copy link
Member

soumith commented Feb 4, 2016

i wonder if we can trick luarocks to tracking the file.
datafile seems a bit over the top for the problem at hand, where paths.thisfile works 100% of the time.

@deltheil
Copy link
Collaborator Author

deltheil commented Feb 4, 2016

@soumith OK so this is a side-effect. At first I had our custom fork installed (see #133 (comment)) which is named image 1.1.buffer-0. When I (re)install stock torch/image then this problem occurs: assets/lena.png is not tracked by this installation of LuaRocks ...

So in normal conditions it should never appear. Sorry for the noise around that - but I thought it was worth sharing!

@soumith
Copy link
Member

soumith commented Feb 4, 2016

oh i see. either ways, good to know.

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

Successfully merging this pull request may close these issues.

None yet

2 participants