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

cmake: make symlink in build first in order to support DESTDIR #515

Closed
wants to merge 2 commits into from

Conversation

gauteh
Copy link
Member

@gauteh gauteh commented Jul 4, 2018

CMakeLists.txt Outdated
@@ -509,10 +509,20 @@ install (DIRECTORY ui/icons
)
include (InstallSymbolicLink)
install_symlink (../../../../astroid/ui/icons/icon_color.png
${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/512x512/apps/astroid.png
astroid.png
Copy link
Member

Choose a reason for hiding this comment

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

This installs the symlink in the current directory (likely your build tree). Same goes for line 515.

@gauteh
Copy link
Member Author

gauteh commented Jul 4, 2018 via email

@gauteh
Copy link
Member Author

gauteh commented Jul 5, 2018 via email

@c-alpha
Copy link
Member

c-alpha commented Jul 5, 2018 via email

@gauteh
Copy link
Member Author

gauteh commented Jul 5, 2018 via email

@c-alpha
Copy link
Member

c-alpha commented Jul 5, 2018 via email

@gauteh
Copy link
Member Author

gauteh commented Jul 5, 2018 via email

@c-alpha
Copy link
Member

c-alpha commented Jul 5, 2018 via email

@gauteh
Copy link
Member Author

gauteh commented Jul 5, 2018 via email

@c-alpha
Copy link
Member

c-alpha commented Jul 5, 2018 via email

@gauteh
Copy link
Member Author

gauteh commented Jul 5, 2018 via email

@c-alpha
Copy link
Member

c-alpha commented Jul 5, 2018 via email

@Hello71
Copy link
Contributor

Hello71 commented Jul 5, 2018

Let me first check with @Hello71 what his actual problem is, i.e. what exactly fails with "permission denied", and why. If it should turn out to actually be a permission issue (e.g. /usr/share is rwx------ root.root), then all we can do is add permission checks to the cmake scripts to prompt the user to run the install under sudo.

  • DESTDIR is like a fake root (AT INSTALL TIME). Together with the point above this make the application only see the CMAKE_INSTALL_PREFIX, and not know about DESTDIR.
  • The DESTDIR is often a temporary install dir if you want to make a tar / binary package that can be unzipped to root. Other systems use this to install the whole application under a different root.
  • It is also used for testing the install, e.g. before making a release.
  • You can change DESTDIR without re-configuring and re-compiling.

In Gentoo, we have a QA feature called "sandbox" which forbids access to the real root during the src_install phase, when make install or ninja install or whatever is called. Packages must not write outside of the DESTDIR during the installation phase in order to pass QA. This is true of every major distribution that I am aware of. Even if it was ignored, however, the way you are doing it now, the symlinks would not be included in the distro package.

@c-alpha
Copy link
Member

c-alpha commented Jul 5, 2018

Thanks @Hello71 for following up, and the clarification. I'm already working on a fix for the cmake scripts.

@gauteh
Copy link
Member Author

gauteh commented Jul 5, 2018

Obsoleted by #517.

@gauteh gauteh closed this Jul 5, 2018
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