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

before install not called when installing from nim-lang/packages #280

Closed
silversquirl opened this issue Nov 25, 2016 · 11 comments
Closed

before install not called when installing from nim-lang/packages #280

silversquirl opened this issue Nov 25, 2016 · 11 comments

Comments

@silversquirl
Copy link

When running nimble install within my package directory, before install blocks are executed as normal. When installing from nim-lang/packages with nimble install mypackage, they are not.

I'm not sure how to gather more information about this, as I can't choose an alternate source to install from, as far as I can tell.

@silversquirl
Copy link
Author

silversquirl commented Nov 25, 2016

Installing directly from Git using nimble install https://foo/bar.git works as expected.

@silversquirl
Copy link
Author

Ah, that's wrong. I was running the command from within my project directory, which made it succeed.

@silversquirl
Copy link
Author

I think I've tracked down the issue.

When Nimble starts, it first parses command line arguments, then runs the doAction proc on the resulting Options object. One of the first things doAction does is to run execHook, which then looks for a .nimble file in the current directory. If it can't find one, it exits without doing anything. This is why it works as expected when run in my project directory, but not when running elsewhere.

The problem is that fixing this appears like it would require a rather major refactor of Nimble, so I think it's better for me to work around this issue by creating a separate task which I can run every so often to update my wrapper, rather than doing it directly before install.

@dom96 dom96 reopened this Nov 25, 2016
@dom96
Copy link
Collaborator

dom96 commented Nov 25, 2016

This is still an issue though. Doesn't matter how difficult it is to fix.

@dom96 dom96 modified the milestone: v0.7.12 Dec 29, 2016
khogeland pushed a commit to khogeland/nimbox that referenced this issue Sep 18, 2017
@genotrance
Copy link
Contributor

Unfortunately this is affecting nimssl and nimbass as well since they actually generate the wrappers using nimgen before installing to the ~/.nimble directory.

I've updated my README as well like khogeland's commit above but a fix would be much cooler.

@dom96
Copy link
Collaborator

dom96 commented Nov 8, 2017

@genotrance cool library, I'll make this a high priority.

dom96 added a commit that referenced this issue Jan 8, 2018
@dom96
Copy link
Collaborator

dom96 commented Feb 23, 2018

This was fixed it seems :)

@dom96
Copy link
Collaborator

dom96 commented Mar 11, 2018

Reopening as this wasn't fixed properly.

@dom96
Copy link
Collaborator

dom96 commented Mar 18, 2018

So just to clarify, this was fixed, but the hook is run too quickly (before dependencies are installed), so you get issues like this when installing packages that depend on 'nimgen' (as an example):

screen shot 2018-03-18 at 01 14 24

@genotrance
Copy link
Contributor

Yes exactly - the latest commits fixes this exact problem.

@dom96
Copy link
Collaborator

dom96 commented Aug 27, 2018

This should now be fixed. I've added a test for it in db222bb as well.

The above commit also implements before develop.

@dom96 dom96 closed this as completed Aug 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants