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

Fix Makefile not removing debug julia lib on windows #30059

Merged
merged 1 commit into from
Dec 8, 2018

Conversation

musm
Copy link
Contributor

@musm musm commented Nov 16, 2018

fix #30023

@musm musm changed the title Remove debug lib on windows Fix Makefile not removing debug julia lib on windows Nov 16, 2018
@ararslan ararslan requested a review from staticfloat November 16, 2018 22:15
@ararslan ararslan added building Build system, or building Julia or its dependencies system:windows Affects only Windows labels Nov 16, 2018
@staticfloat
Copy link
Member

I don't think this is the correct fix; just because I run make install doesn't mean I want the debug version removed from the destination directory; that makes it difficult to keep the debug version around when I'm building/updating just the release version.

Rather, we should figure out why the debug library is getting built/installed when we don't want it. Most likely there's something wrong with #27814 and libraries are getting copied into the destdir when they shouldn't be.

@staticfloat staticfloat reopened this Nov 17, 2018
@staticfloat
Copy link
Member

I certainly did not mean to close this PR. Sorry about that. :)

@musm
Copy link
Contributor Author

musm commented Nov 17, 2018

@staticfloat thanks for the review and comments.

I'm confused by your review, this is only for binary-dist .

@staticfloat
Copy link
Member

I'm confused by your review, this is only for binary-dist .

It's not only for binary-dist; these changes are within the install: target, so they will apply whenever I run make install. Here's why I'm confused:

If I run make install without BUNDLE_DEBUG_LIBS, the debug libraries should not get installed. Which I believe is true.

If I run make binary-dist, the make system should clean out any previously-run make binary-dist objects (which is part of the distclean target), so the removal that you are doing in this PR should be having no effect anyway. So in what situation is make binary-dist copying in debug libraries?

@musm
Copy link
Contributor Author

musm commented Nov 18, 2018

this removes it from the bindir directory not the install directory. I've tested this locally and it fixes the bug in the linked issue by ensuring the debug julia lib is not included in the julia installer on windows.

@ViralBShah
Copy link
Member

ViralBShah commented Nov 18, 2018

I believe the offending line is

julia/Makefile

Line 342 in d32b30e

-$(INSTALL_M) $(build_bindir)/*.dll $(DESTDIR)$(bindir)/

We should remedy the real issue, rather than just deleting the libjulia-debug.dll. The rule above should just be made specific to copy only the necessary files. Should hopefully not be too difficult. The Mac lines just below suggest that it should be easy to do so.

@musm
Copy link
Contributor Author

musm commented Nov 19, 2018

Indeed @ViralBShah that is the exact crux of the problem.

I decided to rm the file in this PR as it seemed the simplest approach since there numerous library files that need to be copied over in the catchall *.dll .

What's then the best way to specify to copy over all library dlls except libjulia-debug.dll ? We certainly don't want to specify all 36 dll files manually.

@musm
Copy link
Contributor Author

musm commented Nov 20, 2018

It seems part of the issue with using JL_PRIVATE_LIBS is it doesn't include all the libraries needed by windows.

@musm
Copy link
Contributor Author

musm commented Nov 26, 2018

Any thoughts on the comments above? Is this not sufficient (it does indeed work) until a better solution is proposed?

@staticfloat
Copy link
Member

this removes it from the bindir directory not the install directory.

I'm not sure what you mean by this; $(DESTDIR)$(bindir) is the install directory, and we should not be deleting things from there. Imagine what happens when a user runs sudo make install prefix=/usr/local; we do not ever want to be deleting things from $(DESTDIR)$(bindir), assuming that we control what is within there, because we do not. We control $(build_bindir) but not $(DESTDIR)$(bindir).

@ViralBShah
Copy link
Member

ViralBShah commented Dec 4, 2018

Yes, we need to prevent libjulia-debug.dll from being copied over, since deletion is dangerous for the reason @staticfloat mentions.

@staticfloat, if we clearly remove the exact filename that we just copied over, is it ok? This only applies to Windows inside the ifdef, and will only be used by the buildbots (realistically). Perhaps the risk is contained enough to do the hack.

@staticfloat
Copy link
Member

and will only be used by the buildbots.

I'm not sure why this is true. What limits this to only running on buildbots? If I am a user and I run make debug && make install BUNDLE_DEBUG_LIBS=1 prefix=/path, then later run make release && make install prefix=/path, what stops this branch from rendering my previously-installed debug installation useless?

@staticfloat
Copy link
Member

I think if we just want to exclude libjulia-debug.dll we can do something like $(INSTALL_M) $(filter-out libjulia-debug.dll,$(wildcard $(build_bindir)/*.dll)) $(DESTDIR)$(bindir)/

@musm
Copy link
Contributor Author

musm commented Dec 6, 2018

thanks @staticfloat for the suggestion. Frustratingly it still ends up copying, is there something wrong with the filter-out and wildcard statement you posted? Looks correct, however.

@staticfloat
Copy link
Member

You can debug this by doing things like echo "DOES THIS LOOK RIGHT: $(filter-out libjulia-debug.dll,$(wildcard $(build_bindir)/*.dll))" in the Makefile or whatnot. If you want to see things in a Makefile that are not getting run as part of a target, you can use $(warning blah blah blah) within top-level Makefiles statements.

@musm
Copy link
Contributor Author

musm commented Dec 7, 2018

Ok fixed! Thanks @staticfloat !

@musm
Copy link
Contributor Author

musm commented Dec 7, 2018

This also needs a backport label at least for 1.1 if not 1.0.x also.

@ViralBShah
Copy link
Member

Looks good to merge.

@staticfloat staticfloat merged commit bcca250 into JuliaLang:master Dec 8, 2018
KristofferC pushed a commit that referenced this pull request Dec 9, 2018
@musm musm deleted the deb branch December 17, 2018 06:19
@StefanKarpinski StefanKarpinski added triage This should be discussed on a triage call backport 1.0 and removed triage This should be discussed on a triage call labels Jan 31, 2019
@JeffBezanson JeffBezanson removed triage This should be discussed on a triage call triage backport pending 1.0 labels Jan 31, 2019
@KristofferC KristofferC mentioned this pull request Aug 26, 2019
55 tasks
KristofferC pushed a commit that referenced this pull request Aug 26, 2019
KristofferC pushed a commit that referenced this pull request Aug 27, 2019
KristofferC pushed a commit that referenced this pull request Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
building Build system, or building Julia or its dependencies system:windows Affects only Windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

libjulia-debug.dll is included even though julia-debug is not
7 participants