hugo builds with read-only source-tree - hugo

We would like to integrate hugo for documentation generation in our automake project.
The problem i'm facing is, that I would like to support
out-of-tree builds
builds from read-only source trees (which is related to out-of-tree builds)
out-of-tree builds kind of work with:
hugo --source $(srcdir) --destination $(abs_builddir)
However, when my source-tree is read-only (e.g. as tested by make distcheck), this fails with:
$ make
hugo --source ../../../hugo --destination "<<SRCDIR>>/project-0.1/_build/sub/hugo"
Error: add site dependencies: create deps: failed to create file caches from configuration: mkdir <<SRCDIR>>/project-0.1/hugo/resources: permission denied
Total in 1 ms
make: *** [Makefile:555: all] Error 255
Obviously, hugo tries to create it's "file caches" as a resources/ directory in the (read-only) <<SRCDIR>>.
How can I tell hugo to creat this "file caches" directory in an alternative (writeable) place?
I tried setting --cacheDir (to $(abs_builddir), but this didn't change anything.
apparently there's a resourceDir config-file option, but afaict that is not available via the cmdline (and I don't know whether it would actually help).

Related

configure_file error on make install while compiling nfs-ganesha

My objective
I want to compile and install nfs-ganesha from source on a Oracle Linux machine.
Steps to reproduce
Using Oracle Linux Server release 7.4
Download nfs-ganesha from github: https://github.com/nfs-ganesha/nfs-ganesha
Follow steps from line 56 to 61 on this guide (just a normal compilation and installation): https://github.com/nfs-ganesha/nfs-ganesha/blob/next/src/COMPILING_HOWTO.txt
At some point, you might receive an error that you're missing userspace-rcu. Do sudo yum install userspace-rcu userspace-rcu-devel to fix it.
When I run the last command (make install) I get the following error:
Error
bash-4.2$ make install
[ 3%] Built target MainServices
normal build output...
[100%] Built target fsalmem
Install the project...
-- Install configuration: "Debug"
-- Installing: /etc/ganesha/ganesha.conf
CMake Error at cmake_install.cmake:54 (configure_file):
configure_file Problem configuring file
make: *** [install] Error 1
Some insights
I opened cmake_install.cmake to see what is failing, here is a fragment of the code:
I marked the faulty line with an arrow
IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
set(_destfile "/etc/ganesha/ganesha.conf")
if (NOT "$ENV{DESTDIR}" STREQUAL "")
# prepend install root prefix with install-time DESTDIR
set(_destfile "$ENV{DESTDIR}//etc/ganesha/ganesha.conf")
endif ()
if (EXISTS ${_destfile})
message(STATUS "Skipping: ${_destfile} (already exists)")
execute_process(COMMAND "/usr/bin/cmake" -E compare_files
/home/carlhida/Documents/ganesha/src/config_samples/ganesha.conf.example ${_destfile} RESULT_VARIABLE _diff)
if (NOT "${_diff}" STREQUAL "0")
message(STATUS "Installing: ${_destfile}.example")
configure_file(/home/carlhida/Documents/ganesha/src/config_samples/ganesha.conf.example ${_destfile}.example COPYONLY)
endif ()
else ()
message(STATUS "Installing: ${_destfile}")
# install() is not scriptable within install(), and
# configure_file() is the next best thing
-------->>> configure_file(/home/carlhida/Documents/ganesha/src/config_samples/ganesha.conf.example ${_destfile} COPYONLY)
# TODO: create additional install_manifest files?
endif ()
ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
What I found on this function is that it copies one file to another, but I'm not sure how to get more information from the error. My main concern is that it might have to do with permissions but when I use sudo, I just get:
bash-4.2$ sudo make install
CMake Error: The source directory "/home/carlhida/Documents/ganesha/src" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
make: *** [cmake_check_build_system] Error 1
So I think it is not related to that.
Pivoting questions
Is there a way to know what exactly is the problem with those files? I would really appreciate if anyone knows how to get a verbose output on those errors.
Thank you for your help!
I solved this problem by moving the repo's folder and the build folder to a directory called /scratch. Then I issued the command again by being root. It installed correctly this time.

Error: chaincode install failed with status: 500

I have created a chaincode and I am trying to install it on the peer organization. I am able to package the chaincode on the peer organization but when it turns to install phase, I got error message:
Error: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode': could not build chaincode: docker build failed: docker image build failed: docker build failed: Error returned from build: 2
# github.com/Nik-U/pbc
/usr/lib/gcc/x86_64-alpine-linux-musl/9.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lpbc
/usr/lib/gcc/x86_64-alpine-linux-musl/9.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lgmp
collect2: error: ld returned 1 exit status
I am using Nik-U's go wrapper of the PBC library Nik-U pbc. In his homepage, description shows:
This package must be compiled using cgo. It also requires the installation of GMP and PBC. During the build process, this package will attempt to include <gmp.h> and <pbc/pbc.h>, and then dynamically link to GMP and PBC.
Here's what I have tried:
I have manually configured the GMP and PBC under the Nik-U's directory and changed all the addresses of <gmp.h> and <pbc.h> to the right location.
I have tried to use command ln -s /usr/local/lib/libpbc.so libpbc.so and ln -s /usr/local/lib/libgmp.so to create link library files, but it shows the same error message.
As the Nik-U wrapper uses cgo, I changed the sentence in c.go file from #cgo LDFLAGS: -lpbc -lgmp to #cgo LDFLAGS: -L/usr/local/lib -lpbc -lgmp. Inside the /usr/loca/lib there are: libgmp.a libgmp.la libgmp.so libgmp.so.10 libgmp.so.10.4.1 libpbc.a libpbc.la libpbc.so libpbc.so.1 libpbc.so.1.0.0. This change did not work. I still got the same error message.
I copied all files of the directory /usr/local/lib to the same directory of the docker container using command docker cp **.so containerName:/usr/local/lib/. It does not work.
Here are what I doubt that may be the problem:
I am using go.mod file to manage all dependencies but the go.mod does not manage the original PBC library and GMP library. However, I do not know how to use go module to manage these two libraries (written in C?).
Nik-U's pbc wrapper has to link PBC and GMP libraries dynamically, which is why my efforts to manually configure and install them in the subdirectory, and change the include information such as from #include <pbc/pbc.h> to #include <pbc-0.5.14/include/pbc.h> of no use.
Can anybody help..
In hyperledger fabric, chaincode is executed in the form of sandbox based on virtual environment. In other words, it is not executed in the peer, but in a new docker container.
Even if you move the *.so file to the peer, it seems that a cannot find error has occurred because the newly created chaincode does not import it.
To solve this, two tasks are required.
1. import library to fabric-ccenv docker image
The go chaincode container of the fabric occurs in the image of fabric-ccenv. Based on the fabric-ccenv image, create a new image with your library embedded
FROM fabric-ccenv:<your_fabric_tag>
COPY <your_src_library_path> <your_target_library_path>
docker build -f <your_dockerfile> -t fabric-ccenv:<your_new_fabric_tag>
2. Change core.yaml of fabric-peer
You have to change the peer's configuration. That is, set the configuration for chaincode in core.yaml.
You can set information about fabric-ccenv in the builder item of chaincode. Change this value to the value of your image created in step 1 above.
chaincode:
id:
path:
name:
#builder: $(DOCKER_NS)/fabric-ccenv:$(TWO_DIGIT_VERSION)
builder: $(DOCKER_NS)/fabric-ccenv:<your_new_fabric_tag>
pull: false
golang:
runtime: $(DOCKER_NS)/fabric-baseos:$(TWO_DIGIT_VERSION)
dynamicLink: false

Bitbake: "Nothing PROVIDES" error

I'm new to Yocto and Bitbake. I'm running my yocto machine through a qemu emulator on Ubuntu and attempting to use the meta-selftest layer to get a sense of how to install new layers. I have downloaded the meta-selftest files into the directory where the rest of the meta- directories are, and added the path to the meta-selftest directory to the bblayers.conf file. Running bitbake-layers show-layers command gives the output
layer path priority
==========================================================================
meta /home/[my name]/Documents/poky/meta 5
meta-poky /home/[my name]/Documents/poky/meta-poky 5
meta-yocto-bsp /home/[my name]/Documents/poky/meta-yocto-bsp 5
meta-selftest /home/[my name]/Documents/poky/meta-selftest 5
however, when I try to run bitbake meta-selftest I get the error:
Loading cache: 100%
Loaded 1294 entries from dependency cache.
ERROR: Nothing PROVIDES 'meta-selftest'
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
What does this error mean? I checked meta-selftest's dependencies, and it doesn't have any, so I get the sense this error isn't saying there is a dependency issue, but I can't find any clear documentation on what this error is telling me. I get the vague sense it means that bitbake can't find meta-selftest, but show-layers contradicts that by listing it with the correct path.
Any help would be deeply appreciated.
-Patches
You don't bitbake a layer, you bitbake a recipe from that layer.
Try a bitbake test-empty-image for example. That is an image recipe provided by that layer.
Explore the meta-selftest directory and look for .bb files, the recipes. Those can be build using bitbake.
I recommend having a look at the quick start guide: http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html
You don't need bitbake the layers name.
Please check in meta-selftest dir and try to find the *.bb file (it's recipes). And try again with " bitbake recipes_name.bb "

Getting error when sending application to codename one build server

I have not done any build on the server before, but I have created numerous applications on my system. When trying to send this particular application to the build server, it was giving error on netbeans. This was the error I was getting:
init:
deps-clean:
Updating property file: C:\Users\Olubori\Documents\NetBeansProjects\Interview\build\built-clean.properties
Deleting directory C:\Users\Olubori\Documents\NetBeansProjects\Interview\build
refresh-libs:
Deleting directory C:\Users\Olubori\Documents\NetBeansProjects\Interview\lib\impl
clean:
copy-desktop-override:
Created dir: C:\Users\Olubori\Documents\NetBeansProjects\Interview\build\classes
copy-libs:
deps-jar:
Updating property file: C:\Users\Olubori\Documents\NetBeansProjects\Interview\build\built-jar.properties
Compile is forcing compliance to the supported API's/features for maximum device compatibility. This allows smaller code size and wider device support
Created dir: C:\Users\Olubori\Documents\NetBeansProjects\Interview\build\tmp
Compiling 1 source file to C:\Users\Olubori\Documents\NetBeansProjects\Interview\build\tmp
Created dir: C:\Users\Olubori\Documents\NetBeansProjects\Interview\build\empty
Compiling 1 source file to C:\Users\Olubori\Documents\NetBeansProjects\Interview\build\classes
warning: [options] bootstrap class path not set in conjunction with -source 1.5
1 warning
Copying 1 file to C:\Users\Olubori\Documents\NetBeansProjects\Interview\build\classes
compile:
Created dir: C:\Users\Olubori\Documents\NetBeansProjects\Interview\dist
Copying 1 file to C:\Users\Olubori\Documents\NetBeansProjects\Interview\build
C:\Users\Olubori\Documents\NetBeansProjects\Interview\nbproject\build-impl.xml:990: The following error occurred while executing this line:
C:\Users\Olubori\Documents\NetBeansProjects\Interview\nbproject\build-impl.xml:834: copylibs doesn't support the "excludeFromCopy" attribute.
BUILD FAILED (total time: 0 seconds)
What could be the cause and how will I solve it?
Just remove that attribute from the XML build file, its a NetBeans bug: https://groups.google.com/d/msg/codenameone-discussions/X_HMILMsw_Y/jE0xDsL7nfAJ

aspnet_compiler ASPParse Could Not Load Type

I am unable to build my Web Application (not Web Site) in our build environement. We use DMAKE in our build environment (this unfortunately is non negotiable, therefore using MSBUILD is not permitted ) and when invoking the asp.net precompiler through
C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler -d -nologo -p Site -f -fixednames -errorstack -v / Debug
We get the following error
error ASPPARSE: Could not load type 'X.Y.Admin.Site.Global
If I compile from the ide it is successful. If i then compile with aspnet_compilier it is successful. So i only get a successful compile with aspnet_compiler when the target dll i am trying to compile is in the bin of the web application i am compiling.
I keep running into postings that talk about solutions using MSBUILD which unfortunately I cant try.
Any help would be appreciated
We had the same problem on our web application:
error ASPPARSE: Could not load type '...'
The problem was that we had the file on disk (on the project folder) but it wasn't included in our application project (in the .csproj file). We solved the problem by including the file in the project :)
I ran into a similar problem using NANT. The trick was to compile the web applications code files into a dll then include that when using aspnet_compiler.
use the command line compiler,either csc.exe (c#) or vbc.exe (visual basic), to compile your web application with an output of type library. This will create a dll that you can use in your aspnet_compiler task
Have you tried specifying the path using -p? Sounds to me like it can't find that type / assembly.
http://msdn.microsoft.com/en-us/library/ms229863(VS.80).aspx
For web applications, you have to build the .vb files into a dll and put that in the bin folder before you run the aspnet compiler. Check the output window in visual studio and you'll see the command line for the VB compiler. Run that first before you run the aspnet compiler, and the asp pages should be able to find the missing types.
This problem was resolved for me by simply deleting all bin and obj folders. Seems like they were in a bad state somehow. I also deleted the the .sou file, but I don't think that was the issue.
I received the same problem.
I fixed it by copying my webapp's DLL from the OBJ/DEBUG folder to the BIN folder.
I just had this error and found 2 ways to fix it, either:
Change the Codebehind attribute in the global.asax file to CodeFile and add "partial" to the class declaration
In the deployment project's property pages, set "Version output assemblies" and provide a version number
I don't really know why either worked, but it did.
solution :
-p Site path must have the directory path of .csproj file location.
ex :-
aspnet_compiler -p D:\Projects\MGM\mgm\mgm -v / D:\Projects\MGM-deploy\mgm_compiled

Resources