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

rebar3 new lib hangs when run in a non-empty directory #4

Closed
catamorphism opened this issue Nov 14, 2014 · 7 comments · Fixed by #19
Closed

rebar3 new lib hangs when run in a non-empty directory #4

catamorphism opened this issue Nov 14, 2014 · 7 comments · Fixed by #19

Comments

@catamorphism
Copy link

If I run:

DEBUG=1 rebar3 new lib squirrels

in any non-empty directory, I get this output:

===> Consult config file "rebar.config"
===> Consult config file "rebar.lock"

and then it hangs forever. If I make a new directory and cd into it first, it succeeds.

@ferd
Copy link
Collaborator

ferd commented Nov 15, 2014

Do these files exist and could you provide a sample of rebar.lock that seems to trigger this?

@catamorphism
Copy link
Author

They don't exist in the current working directory, no. I'm not sure where else it would be looking.

@ferd
Copy link
Collaborator

ferd commented Nov 15, 2014

Ah, ok, I assumed it would be one of the files in the non-empty directory.

Here's a sample run for me on a ubuntu box:

λ /tmp → ls -al
total 96
drwxrwxrwt 17 root root 4096 Nov 15 00:54 .
drwxr-xr-x 23 root root 4096 May  6  2013 ..
-rw-rw-r--  1 ferd ferd    5 Jul 15 22:38 a
-rw-rw-r--  1 ferd ferd 3074 Jul 17 02:06 aaaa
drwxrwxr-x  3 ferd ferd 4096 Nov 14 17:38 app
-rw-rw-r--  1 ferd ferd    0 Jul 15 22:39 b
drwxrwxr-x  2 ferd ferd 4096 Nov 15 00:54 check
-rwxrwxr-x  1 ferd ferd 1984 Jun  1 19:13 client_bouncer.erl
drwxrwxr-x  5 ferd ferd 4096 Sep 21 11:27 dirmon
-rw-rw-r--  1 ferd ferd  117 Nov 10 18:50 .gitignore
-rw-rw-r--  1 ferd ferd 1470 Nov 10 18:50 LICENSE
...
drwx------  2 ferd ferd 4096 Apr 13  2014 tmux-1001
drwx------  2 ferd ferd 4096 Oct 30 11:58 vKwsHeL
λ /tmp → DEBUG=1 rebar3 new lib squirrels
===> Consult config file "rebar.config"
===> Consult config file "rebar.lock"
===> Available templates: [{"ct_suite",file,
                                   "/home/ferd/.rebar3/templates/ct_suite.template"},
                                  {"release",escript,
                                   "priv/templates/release.template"},
                                  {"plugin",escript,
                                   "priv/templates/plugin.template"},
                                  {"lib",escript,
                                   "priv/templates/lib.template"},
                                  {"app",escript,
                                   "priv/templates/app.template"}]

===> Looking for "lib"

===> Executing template file "mod.erl.dtl"

===> Writing squirrels/src/squirrels.erl
===> Executing template file "otp_lib.app.src.dtl"

===> Writing squirrels/src/squirrels.app.src
===> Executing template file "rebar.config.dtl"

===> Writing squirrels/rebar.config
===> Executing template file "gitignore.dtl"

===> Writing squirrels/.gitignore
===> Executing template file "LICENSE.dtl"

===> Writing squirrels/LICENSE
===> Executing template file "README.md.dtl"

===> Writing squirrels/README.md
===> Template lib applied

Let's try the same on a mbp (running an older OSX, 10.7.5):

λ /tmp → ls -al
total 0
drwxrwxrwt  35 root        wheel  1190 14 Nov 19:57 .
drwxr-xr-x@  6 root        wheel   204 11 Jul  2011 ..
-r--r--r--   1 root        wheel     0 14 Nov 17:32 .keystone_install_lock
drwxr-xr-x   3 root        wheel   102 29 Oct 22:19 20141029221922
drwxr-xr-x   3 root        wheel   102 31 Oct 20:46 20141031204646
....
drwx------   3 _spotlight  wheel   102 14 Nov 19:57 launchd-14384.EHGVNZ
drwx------   3 ferd        wheel   102 10 Oct 17:19 launchd-218.536Yz6
λ /tmp → DEBUG=1 ~/code/self/rebar3/rebar3 new lib squirrels
===> Consult config file "rebar.config"
===> Consult config file "rebar.lock"
===> Available templates: [{"release",escript,
                                   "priv/templates/release.template"},
                                  {"plugin",escript,
                                   "priv/templates/plugin.template"},
                                  {"lib",escript,
                                   "priv/templates/lib.template"},
                                  {"app",escript,
                                   "priv/templates/app.template"}]

===> Looking for "lib"

===> Executing template file "mod.erl.dtl"

===> Writing squirrels/src/squirrels.erl
===> Executing template file "otp_lib.app.src.dtl"

===> Writing squirrels/src/squirrels.app.src
===> Executing template file "rebar.config.dtl"

===> Writing squirrels/rebar.config
===> Executing template file "gitignore.dtl"

===> Writing squirrels/.gitignore
===> Executing template file "LICENSE.dtl"

===> Writing squirrels/LICENSE
===> Executing template file "README.md.dtl"

===> Writing squirrels/README.md
===> Template lib applied

I can also reapply things otherwise. There's a possibility the program gets blocked up somewhere when it scans its own escript data rather than when it consults the lock file, but without reproducing the bug it's gonna be hard to figure it out :/

@tsloughter
Copy link
Collaborator

I'm sure it is getting beyond reading for the lock file.

But yea, unless @catamorphism can give us more information on reproducing I'm not sure we should even leave this ticket open...

Do you have another computer to compare results with and see what is different between the setups?

@catamorphism
Copy link
Author

Sorry, this got lost in my inbox. I'll try to reproduce it.

@tsloughter
Copy link
Collaborator

Should I just close this? :)

@tsloughter
Copy link
Collaborator

Well I'll be... I just reproduced this! So leaving it open obviously and now digging into it.

keynslug pushed a commit to keynslug/rebar3 that referenced this issue Dec 6, 2022
upgrade to relx v4.3.0-emqx-3
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 a pull request may close this issue.

3 participants