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

Throw SysError if the buildHook file does not exist #958

Conversation

matthiasbeyer
Copy link
Contributor

A follow-up to #957 .


Please note: This is the very first piece of C++ code I write outside of university. I hope the place is appropriate and everything.

I did not yet test this, I first wanted to get feedback whether this change is appropriate at all...

@bjornfor
Copy link
Contributor

bjornfor commented Jul 4, 2016

If this goes in (I have no say in the matter), can you make the error message say which path it tried?

@matthiasbeyer
Copy link
Contributor Author

@bjornfor I tried to do that in the latest commit, thanks for suggesting it!

@domenkozar domenkozar added the UX The way in which users interact with Nix. Higher level than UI. label Jul 21, 2016
@domenkozar
Copy link
Member

cc @edolstra

@@ -596,6 +596,9 @@ HookInstance::HookInstance()
if (string(buildHook, 0, 1) != "/") buildHook = settings.nixLibexecDir + "/nix/" + buildHook;
buildHook = canonPath(buildHook);

if (!pathExists(buildHook))
throw SysError(format("NIX_BUILD_HOOK '%1%' does not exist" % buildHook));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't compile. The % buildHook needs to be after the first ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UX The way in which users interact with Nix. Higher level than UI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants