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

@matthiasbeyer matthiasbeyer commented Jul 4, 2016

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 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

@matthiasbeyer matthiasbeyer commented Jul 4, 2016

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

@domenkozar domenkozar added the UX label Jul 21, 2016
@domenkozar
Copy link
Member

@domenkozar domenkozar commented Aug 16, 2016

@@ -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));

This comment has been minimized.

@edolstra

edolstra Aug 16, 2016
Member

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

@matthiasbeyer matthiasbeyer force-pushed the matthiasbeyer:bail-if-buildhook-does-not-exist branch from 0573533 to 13a6e75 Aug 21, 2016
@shlevy shlevy added the backlog label Apr 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.