Why is dh_usrlocal throwing a build error? - deb

I am trying to compile a deb package for my server. When I go to build, everything looks good until it gets to dh_usrlocal The build stops and make returns an error. The problem is I am trying this for the first time and I really don't know where to look for the problem.
This is the output from my terminal, I also included the command I ran at the bottom of the output.
make[2]: Leaving directory `/home/ian/Desktop/scst-2.1.0/src'
make[1]: Leaving directory `/home/ian/Desktop/scst-2.1.0'
dh_install
dh_installdocs
dh_installchangelogs
dh_installexamples
dh_installman
dh_installcatalogs
dh_installcron
dh_installdebconf
dh_installemacsen
dh_installifupdown
dh_installinfo
dh_pysupport
dh_installinit
dh_installmenu
dh_installmime
dh_installmodules
dh_installlogcheck
dh_installlogrotate
dh_installpam
dh_installppp
dh_installudev
dh_installwm
dh_installxfonts
dh_bugfiles
dh_lintian
dh_gconf
dh_icons
dh_perl
dh_usrlocal
dh_usrlocal: debian/scst/usr/local/include/scst/scst.h is not a directory
dh_usrlocal: debian/scst/usr/local/include/scst/scst_user.h is not a directory
dh_usrlocal: debian/scst/usr/local/include/scst/Module.symvers is not a directory
dh_usrlocal: debian/scst/usr/local/include/scst/scst_debug.h is not a directory
dh_usrlocal: debian/scst/usr/local/include/scst/scst_const.h is not a directory
dh_usrlocal: debian/scst/usr/local/include/scst/scst_sgv.h is not a directory
rmdir: failed to remove `debian/scst/usr/local/include/scst': Directory not empty
dh_usrlocal: rmdir debian/scst/usr/local/include/scst returned exit code 1
make: *** [binary] Error 1
dpkg-buildpackage: error: debian/rules binary gave error exit status 2
ian#vm01:~/Desktop/scst-2.1.0$ sudo dpkg-buildpackage -rfakeroot
Any help would be appreciated.

you should skip running dh_usrlocal. to do it you just add this to debian/rules file: override_dh_usrlocal:
In general manner if you have a problem with a specific target, you just override it by adding override_{target} in your debian/rules file.
example, you have a problem with dh_icons. you just add this in your debian/rules file.
override_dh_icons:
{insert your processing commands or do nothing to skip it when building package}

A proper Debian package is not allowed to generate stuff there but empty directories.That is why it is complaining that it can not delete the directory. It doesnt expect files to be there.the only thing you can have is a directory in /usr/local and that's what dh_usrlocal tries to handle
but you shouldn't have files
Users only put files in /usr/local/.
Also i think if you have usr/local name in your directory path it will cause the error also like even though it is not the correct usr/local. An example of what could cause the problem also. I think the regex in build software looks for usr/local.
/var/tmp/usr/local/
I know this is an old post but it is ranked #1 on google so needs a good answer so people solve this problem quickly.

IMPORTANT: This error ONLY occurs when you try to install to /usr/local/
I moved my package to install from /usr/local/lib/python3/dist-packages/ to /usr/lib/python3/dist-packages and the error disappeared. dh_usrlocal seems to be broken or my package is not abiding by rules it expects.
I started getting the error after adding a package.install file to my debian package so it would copy the package contents to the filesystem. (I was installing to /usr/local/ at the time)
Contents of my install file when it failed:
usr/* usr/
Contents when it works correctly:
usr/ usr/
File structure of debian package:
packagename-0.1/
debian/
usr/
local/
lib/
python3/
packagename/
Edit:
This seems only to work when copying root directories. Once I try to specify copying past usr/, it breaks with the same error. See top of answer to find my solution.

Related

Error with install.packages using renv|knit|rmarkdown

I'm updating the renv folder from a project in order to adjust the libraries, but it seems I'm having a permission problem. After running renv::init() and trying to installing manually the remaining libraries using install.packages() I always get the message
Error: failed to retrieve 'https://cran.rstudio.com/bin/windows/contrib/4.2/ipeadatar_0.1.6.zip' [error code 23]
1: curl: (23) Failure writing output to destination
2: curl: (23) Failure writing output to destination
Using .libPath() I can see that the renv was created in the "AppData" hidden folder
1] "C:/Users/André Ferreira/AppData/Local/R/cache/R/renv/library/MacroBRA_Wrld-09789847/R-4.2/x86_64-w64-mingw32"
So checking my permissions, I couldn't see anything wrong. Any thoughts about this problem? The thing it's that when I open my .Rmd file and try to knit, I receive the same message "1: curl: (23) Failure writing output to destination", now from rmarkdown retrieve installation, so it may be a configuration/permission problem.
Adding "C:\rtools42\usr\bin" and "C:\Program Files\R\R-4.2.1\bin" in the environment variable didn't help.
As I could see, opening an empty file from rstudio, I could use install.packages() without problem.
Although this doesn't solve the problem directly, you can also instruct renv to use a different library path with something like:
# use a project-local library path
RENV_PATHS_LIBRARY = renv/library
in your project's .Renviron file. Depending on your environment, you might also consider placing the library path in an alternate location.
See https://rstudio.github.io/renv/articles/packages.html#r-cmd-build-and-the-project-library for more details.

Error reading or writing history file in PowerShell on Linux

I've just had PS 7.0.2 installed on 2x boxes running RHEL 7.x (maipo). Oddly enough, one of them is showing the following error
$ pwsh
PS /home/user_name> dir
Error reading or writing history file '/home/user_name/.local/share/powershell/PSReadLine/Console_history.txt': Access to the path '/home/user_name/.local/share/powershell/PSReadLine/Console_history.txt' is denied
PS /home/user_name> exit
Error reading or writing history file '/home/user_name/.local/share/powershell/PSReadLine/Console_history.txt': Access to the path '/home/user_name/.local/share/powershell/PSReadLine/Console_history.txt' is denied
This error will not be reported again in this session. Consider using a different path with:
Set-PSReadLineOption -HistorySavePath <Path>
Or not saving history with:
Set-PSReadLineOption -HistorySaveStyle SaveNothing
I can't figure out why. All I did was download the RPM and install it. And both the boxes are practically copies of each other :(
Any suggestions?
Err .. just figured it out. It was an errant umask setting overriding the default in my ~/.bashrc.
Commenting it out solved the problem.

How to fix the gnu make error about a header file location

I have the following output:
compiling platform/msm8974/common/cpu.c
In file included from platform/msm8974/include/asm/types.h:4:0,
from platform/msm8974/include/linux/types.h:4,
from platform/msm8974/include/linux/list.h:4,
from platform/msm8974/include/module.h:9,
from platform/msm8974/common/cpu.c:13:
platform/msm8974/include/asm-generic/int-ll64.h:11:25: fatal error: bitsperlong.h: No such file or directory
compilation terminated.
make[1]: *** [../build-msm8974/platform/msm8974/common/cpu.o] Error 1
My understanding is that int-1164.h refers to bitsperlong.h and make does not see it in that directory. Right?
Well I see the file in this directory when I do an 'ls'. In fact I put the file in the same directory myself. What am I doing wrong and how do I fix it please?
I have tried cleaning the build environment a couple of times. I am stuck; I am not sure why that file is not visible to make or why I get this error.
#Etan Reisner- Hi Etan, I put the file bitsperlong.h in the same directory.
#Brian McFarland- Hey Brain, Thanks. So if I want to add it to actual makefile it would be something like:
#include /AbsolutePathtomyDesiredDirectory
Right?

Building PhantomJS 2.0 on Windows results in a strange error

I am trying to build PhantomJS 2.0 on Windows from the c:\fastio\phantomjs\phantomjs directory. For some reason, the build process fails after a while, with 2 errors (see error message below):
1) It tries to access "C:fastiophantomjsphantomjssrcqtqtbasebinmoc.exe". Obviously, the backslash characters between directory names are somehow getting stripped away deep in the build process - possibly a mismatch between Windows-style "\" and Linux-style "/" (but this is only a guess).
2) There's another error, "Failed to read names from file: C:/fastio/phantomjs/phantomjs/src/qt/qtwebkit/Source/WebCore/mathml/mathtags.in".
If I remove sh.exe from the PATH, the build still gets to this point, and only error #2 appears, leading me to think that error #2 is the real problem here.
Here is the full error message (as far as I can tell this is happening while building WebKit):
sh: C:fastiophantomjsphantomjssrcqtqtbasebinmoc.exe: command not found
Failed to read names from file: C:/fastio/phantomjs/phantomjs/src/qt/qtwebkit/Source/WebCore/mathml/mathtags.in at C:/fastio/phantomjs/phantomjs/src/qt/qtwebkit/Source/WebCore/dom/make_names.pl line 315.
NMAKE : fatal error U1077: 'C:\Users\Eugene\AppData\Local\GitHub\PortableGit_c2ba306e536fdf878271f7fe636a147ff37326ad\bin\perl.EXE' : return code '0x7f'
Stop.
(By the way, I saw this question but I'm already past the issues described there, my error is happening later in the build process.)
How can I make this work?
Full logs below:
Console output:
http://pastebin.com/btMeNPz4
QT build log file build_qt_4-285-20-0859.log:
http://pastebin.com/LUEJz7E0
WebKit build log file build_webkit_4-285-20_0859.log:
http://pastebin.com/494TivXF
PhantomJS build log file build_phantomjs_4-285-20_0859.log:
Empty
Looks like I found the solution myself, here were my steps:
Remove as much as possible from the PATH leaving only the entries critical to the build process
Most importantly, remove all GitHub's git directories from the PATH
Install GIT separately (not from GitHub but from git-scm.com), add its cmd directory only (not its bin directory) to the PATH
Install ActivePerl separately, add it to the PATH
It's moving past the error I asked about with the steps above (still not sure if it will finish the build successfully, it's taking a while).

GOBJECT_INTROSPECTION_CHECK syntax error on configure

On "./configure" of an open source project I get:
user agent OS = Linux
./configure: line 13957: syntax error near unexpected token 0.9.3'
./configure: line 13957: GOBJECT_INTROSPECTION_CHECK(0.9.3)'
make: *** [config.status] Error 2
Ubuntu 12.04 package "gobject-introspection" and "libgirepository1.0-dev" are present. Removing the GOBJECT_INTROSPECTION_CHECK line allows configure to complete, but the project fails a dependency later.
How can I get past this configure step cleanly? Googling for this issue shows bugs filed against numerous OS projects for this same blocking issue, but the usual answer is "install gobject-introspection".
As the OP discovered on his own he had to install the gobject-introspection package to get the m4 macros that were being used.
The error message has the raw macro in it, as configure scripts are generated from configure.in/configure.ac files via m4/etc the fact that the raw macro is in the output file indicates that the macro did not get translated at generation time.
The gobject-introspection m4 files were apparently installed after autogen.sh (or equivalent) was run to generate the configure script. Re-running the autogen.sh script should regenerate the configure script and run the macro correctly.

Resources