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

Compile in debug mode when in git submodule #3639

Merged
merged 1 commit into from Apr 24, 2016
Merged

Compile in debug mode when in git submodule #3639

merged 1 commit into from Apr 24, 2016

Conversation

dylanmckay
Copy link
Contributor

We currently compile in debug mode if there is a .git directory in the project
root.

This compiles Rubinius in debug mode even if .git is a file, so that
we compile in debug mode when rubinius is in a git submodule.

We currently compile in debug mode if there is a `.git` directory in the project
root.

This compiles Rubinius in debug mode even if `.git` is a file, so that
we compile in debug mode when rubinius is in a git submodule.
@@ -3,6 +3,11 @@ def git_directory
File.directory?(git_dir) && git_dir
end

def in_git?
git_dir = File.expand_path "../../.git", __FILE__
File.exist?(git_dir) && git_dir
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is there the extra && git_dir here? As far as I'm aware File.expand_path never returns nil.

Copy link
Member

Choose a reason for hiding this comment

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

@yorickpeterse I'm assuming it's just copied from above. The code in git_directory does that to pass the path back. A multi-clause conditional would have made that more clear. Since #in_git? looks like it's only intended to be a predicate, passing the path back doesn't appear needed, but it doesn't hurt either. Since this code will all be rewritten in bash soon-ish, it doesn't matter.

I'll merge and if you want to clean it up, feel free.

@brixen brixen merged commit 6b205fa into rubinius:master Apr 24, 2016
@brixen
Copy link
Member

brixen commented Apr 24, 2016

@dylanmckay just to check my understanding on a couple points:

  1. in a git submodule, the .git entity is a file instead of a directory?; and
  2. the Rubinius build doesn't compile in debug mode unless you pass --debug-build, but if not in git, it assumes all the files are locally available instead of looking on the network. This is basically the gem files right now. Is this what you meant or did you mean something else?

@dylanmckay
Copy link
Contributor Author

@brixen

  1. Yes, it is a file
  2. Yes, you're right, I misunderstood that but it makes sense now.

@brixen
Copy link
Member

brixen commented Apr 25, 2016

@dylanmckay ok, cool, thanks!

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

3 participants