You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
linux desktop: make install prefix configurable #73881
file INSTALL cannot copy file
"/home/me/programming/fdupes_gui/build/linux/debug/intermediates_do_not_run/fdupes_gui"
to "/usr/local/fdupes_gui": Permission denied.
/usr/local is not user writable and should not be. running the produced binary in the intermediates_do_not_run folder fails, as the directory name helpfully hints at ;)
fixing the install prefix manually in the CMakeLists.txt like this
IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
SET(CMAKE_INSTALL_PREFIX "/home/me/bin" CACHE PATH "install prefix in home bin" FORCE)
ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
fixes the build and I am able to run without problems.
Obviously this is a workaround, so i guess a build param would be handy? like, for example: flutter build linux --install-prefix /home/me/bin
/usr/local is not user writable and should not be.
I agree but I've never seen this error when building a Linux app.
Are you using snap or git clone Flutter?
Can you please provide your flutter doctor -v your flutter build linux --verbose
Thank you
small disclaimer: I have to admit I am using Opensuse Tumbleweed for the first time, normally I use Opensuse Leap. I am not using the snap, but simply cloned and followed the instructions. I am using fvm to keep the dev channel separate from my regular projects' flutter installs.
flutter doctor -v :
[✓] Flutter (Channel dev, 1.26.0-8.0.pre, on Linux, locale en_US.UTF-8)
• Flutter version 1.26.0-8.0.pre at /home/matthias/fvm/versions/dev
• Framework revision b9d06fffb2 (6 days ago), 2021-01-07 18:36:48 -0800
• Engine revision 42a8d4c681
• Dart version 2.12.0 (build 2.12.0-179.0.dev)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /home/matthias/programs/android-sdk
• Platform android-30, build-tools 30.0.3
• ANDROID_SDK_ROOT = /home/matthias/programs/android-sdk
• Java binary at: /usr/lib64/jvm/jre-openjdk/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.9.1+1-suse-1.1-x8664)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Linux toolchain - develop for Linux desktop
• clang version 11.0.0
• cmake version 3.19.2
• ninja version 1.10.2
• pkg-config version 1.7.3
[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).
[✓] IntelliJ IDEA Community Edition (version 2020.3)
• IntelliJ at /home/matthias/programs/idea-IC-203.6682.168
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] Connected device (1 available)
• Linux (desktop) • linux • linux-x64 • Linux
! Doctor found issues in 2 categories.
I note the Android Studio is not found although I have it installed. Apparently, the AS config dir is located at /home/matthias/.cache/Google/AndroidStudio4.1/ instead of the usual /home/matthias/.AndroidStudio4.1/
To have a fresh build env I first ran flutter clean and deleted the linux folder. After that I recreated the linux folder using flutter create . Okay..
So I was writing these comments on the go, and now it seems to build correctly!
The only reason I can think of as to why it didn't work yesterday, is that I have rebooted by now. Yesterday while installing some dependencies like cmake, etc, I noticed the package manager saying some processes needed to be restarted. At that time I ignored the message as I could not see why installing a compiler for example would need a restart of some process in order to correctly compile the flutter program.. :) i guess i was wrong.. sorry, for not trying a reboot first.
I post the list of installed packages, in case I install on my desktop too so I can validate this hypothesis:
cmake
clang
ninja
libblkid-devel
gtk3-devel
gcc-c++
xz-devel
Yesterday, I had some warning in the console when running the program, these are gone now too.
This is a duplicate of #59890. I've seen a few different reports of this over time, but we've never been able to figure out how CMake gets into this state.
fixing the install prefix manually in the CMakeLists.txt like this
IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
SET(CMAKE_INSTALL_PREFIX "/home/me/bin" CACHE PATH "install prefix in home bin" FORCE)
ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
fixes the build and I am able to run without problems.
But the CMakeLists.txt file already has code like that:
What's not clear is why, rarely, that's being ignored when people build. In every case I've seen, a flutter clean fixes it (i.e., when CMake regenerates its cache, it does so correctly the second time). The fact that it can't be reproduced so far makes it impossible to tell what's happening in the first place, unfortunately.
i guess a build param would be handy?
Install in this build isn't intended to actually install; it's been repurposed to create the relocatable bundle.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
TahaTesser commentedon Jan 14, 2021
Hi @mx1up
I agree but I've never seen this error when building a Linux app.
Are you using snap or git clone Flutter?
Can you please provide your
flutter doctor -vyourflutter build linux --verboseThank you
mx1up commentedon Jan 14, 2021
small disclaimer: I have to admit I am using Opensuse Tumbleweed for the first time, normally I use Opensuse Leap. I am not using the snap, but simply cloned and followed the instructions. I am using fvm to keep the dev channel separate from my regular projects' flutter installs.
flutter doctor -v:I note the Android Studio is not found although I have it installed. Apparently, the AS config dir is located at
/home/matthias/.cache/Google/AndroidStudio4.1/instead of the usual/home/matthias/.AndroidStudio4.1/To have a fresh build env I first ran
flutter cleanand deleted the linux folder. After that I recreated the linux folder usingflutter create .Okay..So I was writing these comments on the go, and now it seems to build correctly!
The only reason I can think of as to why it didn't work yesterday, is that I have rebooted by now. Yesterday while installing some dependencies like cmake, etc, I noticed the package manager saying some processes needed to be restarted. At that time I ignored the message as I could not see why installing a compiler for example would need a restart of some process in order to correctly compile the flutter program.. :) i guess i was wrong.. sorry, for not trying a reboot first.
I post the list of installed packages, in case I install on my desktop too so I can validate this hypothesis:
cmake
clang
ninja
libblkid-devel
gtk3-devel
gcc-c++
xz-devel
Yesterday, I had some warning in the console when running the program, these are gone now too.
stuartmorgan-g commentedon Jan 14, 2021
This is a duplicate of #59890. I've seen a few different reports of this over time, but we've never been able to figure out how CMake gets into this state.
But the CMakeLists.txt file already has code like that:
flutter/packages/flutter_tools/templates/app/linux.tmpl/CMakeLists.txt.tmpl
Lines 63 to 68 in bcfad20
What's not clear is why, rarely, that's being ignored when people build. In every case I've seen, a
flutter cleanfixes it (i.e., when CMake regenerates its cache, it does so correctly the second time). The fact that it can't be reproduced so far makes it impossible to tell what's happening in the first place, unfortunately.Install in this build isn't intended to actually install; it's been repurposed to create the relocatable bundle.
github-actions commentedon Aug 7, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.