Fix/cmake run dt from build dir#5086
Conversation
A component of file_name does not name an existing file or file_name points to an empty string: /home/david/.config/darktable/library.db
e344c47 to
cb5ad8b
Compare
|
I have no idea why this fails on travis. I cannot reproduce failing tests locally running ci-script.sh. Any suggestions? |
|
This definitely looks like something I want. At the moment, on debian unstable, I get: A component of file_name does not name an existing file or file_name points to an empty string: /opt/darktable.test/bin/../share/darktable Also, it looks like a lot was installed in the install target directory while I build the "all" target. Maybe I'm confused. |
|
@dterrahe
|
codingdave
left a comment
There was a problem hiding this comment.
all requested changes have been made - afaik
parafin
left a comment
There was a problem hiding this comment.
I couple more minor comments, but otherwise this PR works for me.
parafin
left a comment
There was a problem hiding this comment.
Clarification needed on bindir handling.
|
Github shows that some changes are still requested, but I don't see any unresolved comments. I'm not sure how it works or why it happened. Anyway, I think the only thing left is confirmation that current version of PR works on Windows too. |
|
right @parafin, I also don't understand that. Im installing the windows system right now to verify. |
|
@parafin took some time but finally got it compiled and it runs relatively, as planned. Can you confirm that it works on OSX?
Regarding the l10n error, Im checking now... @TurboGit this PR took so much time and effort I will not rebase this into smaller chunks. So feel free to merge it as you like when this is done. Thanks in advance. |
|
So this is ready for merging! Great work ! I'll test. |
|
I cannot build: And indeed into the directory whereami I have no file: Are you missing a file in a commit ? |
|
A note I have of course deleted build directory:
|
|
Please call
Git submodule init
Git submodule update
Then you should have whereami
I'm not sure the pr works yet for msys.
Good night.
Pascal Obry <notifications@github.com> schrieb am Mi., 14. Okt. 2020, 22:59:
… A note I have of course deleted build directory:
$ rm -fr build ; ./build.sh
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5086 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXO4OLB2HUZG73Z4YIB7YTSKYGMXANCNFSM4NC6U25A>
.
|
|
A new submodule indeed :) The build went fine. What I'll do is squash everything together so we will have a single commit that could be reverted locally to build with MSYS in case of troubles. I'll merge today to ensure more field testing as I know many people are building on Windows. Thanks for the hard work! |
|
Thank you @TurboGit. I have trouble building on windows and such testing the PR. Also I did not change how l10n is resolved on windows. This hardcoded approach should not get broken by my changeset. I agree, more field testing would be helpful here. Also updating the windows build instructions. I can file some suggestions as PR but I might not be the best person to decide what is good and what is bad in the Windows MSYS2 environment with the interactions to MINGW64, MINGW32, CYGWIN, and what else. |
In order to support run-from-build-dir[0], what basically did is "manually do what will be done during installation in the build time", that contains a mixture of change binary_dir of "change binary_dir of subdirectories to pretend it as the same structure of install dir" and "manually copy files to build dir to pretend it as the same structure of install dir". This changes the structure of build dir, adds a lot of variables into CMake files, and often use variables wrongly. Because this makes CMake files hard to read (the variables are misleading), and running desktop apps directly from build dir is not a recommended way to user, this commit will drop it. User should always install it before running it, it is easy to install to where a normal user has permission by changing `CMAKE_INSTALL_PREFIX`. Loading resources and plugins relatively is kept so the app is still relocatable. [0]: darktable-org#5086
In order to support run-from-build-dir[0], what basically did is "manually do what will be done during installation in the build time", that contains a mixture of change binary_dir of "change binary_dir of subdirectories to pretend it as the same structure of install dir" and "manually copy files to build dir to pretend it as the same structure of install dir". This changes the structure of build dir, adds a lot of variables into CMake files, and often use variables wrongly. Because this makes CMake files hard to read (the variables are misleading), and running desktop apps directly from build dir is not a recommended way to user, this commit will drop it. User should always install it before running it, it is easy to install to where a normal user has permission by changing `CMAKE_INSTALL_PREFIX`. Loading resources and plugins relatively is kept so the app is still relocatable. [0]: darktable-org#5086
In order to support run-from-build-dir[0], what basically did is "manually do what will be done during installation in the build time", that contains a mixture of change binary_dir of "change binary_dir of subdirectories to pretend it as the same structure of install dir" and "manually copy files to build dir to pretend it as the same structure of install dir". This changes the structure of build dir, adds a lot of variables into CMake files, and often use variables wrongly. Because this makes CMake files hard to read (the variables are misleading), and running desktop apps directly from build dir is not a recommended way to user, this commit will drop it. User should always install it before running it, it is easy to install to where a normal user has permission by changing `CMAKE_INSTALL_PREFIX`. Loading resources and plugins relatively is kept so the app is still relocatable. [0]: darktable-org#5086
In order to support run-from-build-dir[0], what basically did is "manually do what will be done during installation in the build time", that contains a mixture of change binary_dir of "change binary_dir of subdirectories to pretend it as the same structure of install dir" and "manually copy files to build dir to pretend it as the same structure of install dir". This changes the structure of build dir, adds a lot of variables into CMake files, and often use variables wrongly. Because this makes CMake files hard to read (the variables are misleading), and running desktop apps directly from build dir is not a recommended way to user, this commit will drop it. User should always install it before running it, it is easy to install to where a normal user has permission by changing `CMAKE_INSTALL_PREFIX`. Loading resources and plugins relatively is kept so the app is still relocatable. [0]: darktable-org#5086
In order to support run-from-build-dir[0], what basically did is "manually do what will be done during installation in the build time", that contains a mixture of change binary_dir of "change binary_dir of subdirectories to pretend it as the same structure of install dir" and "manually copy files to build dir to pretend it as the same structure of install dir". This changes the structure of build dir, adds a lot of variables into CMake files, and often use variables wrongly. Because this makes CMake files hard to read (the variables are misleading), and running desktop apps directly from build dir is not a recommended way to user, this commit will drop it. User should always install it before running it, it is easy to install to where a normal user has permission by changing `CMAKE_INSTALL_PREFIX`. Loading resources and plugins relatively is kept so the app is still relocatable. [0]: darktable-org#5086
In order to support run-from-build-dir[0], what basically did is "manually do what will be done during installation in the build time", that contains a mixture of change binary_dir of "change binary_dir of subdirectories to pretend it as the same structure of install dir" and "manually copy files to build dir to pretend it as the same structure of install dir". This changes the structure of build dir, adds a lot of variables into CMake files, and often use variables wrongly. Because this makes CMake files hard to read (the variables are misleading), and running desktop apps directly from build dir is not a recommended way to user, this commit will drop it. User should always install it before running it, it is easy to install to where a normal user has permission by changing `CMAKE_INSTALL_PREFIX`. Loading resources and plugins relatively is kept so the app is still relocatable. [0]: darktable-org#5086
This is my proposal for being able to run darktable without installing it, meaning out of binary tree runs.
Basically it is expected from CMake projects to have a working program in the build directory. Until now the user had to build and install darktable. This PR eliminates the install requirement because the application runs from the binary tree, wherever that is. This makes dt more compatible to CMake capable IDEs like e.g. Visual Studio Code.
There is just a minimum change to the CMake structure. Basically the idea is instead of using absolute pathes to generate relative pathes from CMake that can be resolved at runtime from both, the installed location and the build-tree. The relative path then is expanded at runtime in C.
I was removing redundancies and created functions for the common part.
FIXED:
One change that I am not so sure about happened: Before my PR the function dt_loc_init_tmp_dir returns 1 in case of an error, whereas all the other dt_loc_init_xxx_dir functions were exiting withexit(EXIT_FAILURE);. Since I put all that code in one function no 1 is returned any longer for the temporary directory, but a exit is triggered like for any other directory. I think consistency wins but I might have overlooked something here.FIXED:
Also whats strange for me is that I getA component of file_name does not name an existing file or file_name points to an empty string:messages for existing files/directories. I am not sure what causes this (realpath returns ENOENT).I'm happy about feedback.
Kind regards
Possible startup calls: