Recompiling does not reflect changes - c++

I am attempting to make a simple change to the bitcoin core codebase locally but my changes are not reflected after recompilation. Below are the steps to reproduce the issue:
Clone the bitcoin source code:
git clone https://github.com/bitcoin/bitcoin.git
cd bitcoin
Edit: src/rpc/rawtransaction.cpp and change something (anything). Here I just put "HELLO WORLD" in the signrawtransactionwithkey method as shown below and left everything else the same:
static RPCHelpMan signrawtransactionwithkey()
{
return RPCHelpMan{"signrawtransactionwithkey",
"\n HELLO WORLD Sign inputs for raw transaction (serialized, hex-encoded).\n"
... <code continues> ...
Recompile:
./autogen.sh
./configure
make -j 16
make command output:
Making all in src
make[1]: Entering directory '/home/bitcoinfacts/bitcoin/src'
make[2]: Entering directory '/home/bitcoinfacts/bitcoin/src'
make[3]: Entering directory '/home/bitcoinfacts/bitcoin'
make[3]: Leaving directory '/home/bitcoinfacts/bitcoin'
CXXLD qt/bitcoin-qt
CXXLD test/fuzz/fuzz
CXXLD qt/test/test_bitcoin-qt
make[2]: Leaving directory '/home/bitcoinfacts/bitcoin/src'
make[1]: Leaving directory '/home/bitcoinfacts/bitcoin/src'
Making all in doc/man
make[1]: Entering directory '/home/bitcoinfacts/bitcoin/doc/man'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/bitcoinfacts/bitcoin/doc/man'
make[1]: Entering directory '/home/bitcoinfacts/bitcoin'
make[1]: Nothing to be done for 'all-am'.
make[1]: Leaving directory '/home/bitcoinfacts/bitcoin'
Run the signrawtransactionwithkey command:
./src/bitcoin-cli signrawtransactionwithkey
The output does not include HELLO WORLD:
error code: -1
error message:
signrawtransactionwithkey "hexstring" ["privatekey",...] ( [{"txid":"hex","vout":n,"scriptPubKey":"hex","redeemScript":"hex","witnessScript":"hex","amount":amount},...] "sighashtype" )
Sign inputs for raw transaction (serialized, hex-encoded).
... <output continues> ...
Why? What I am I doing wrong?

The reason was that I had to kill and restart bitcoind because that's where the change actually was (not bitcoin-cli, as I previously thought. Duh!)

Related

build/org/qore/jni/QoreJavaApi.class: No such file or directory

make[2]: Entering directory
/export/home/build/src/el7/develop/qore/git/module-jni/build'
/usr/bin/cmake -E cmake_progress_report /export/home/build/src/el7/develop/qore/git/module-jni/build/CMakeFiles 36
[ 22%] unhandled QORE System exception thrown in TID 1 at 2017-01-10 07:23:45.694794 Tue +01:00 (CET) in FileInputStream::constructor() (/export/home/build/src/el7/develop/qore/gi
t/module-jni/make-inc:53, builtin code)
FILE-OPEN2-ERROR: cannot open '/export/home/build/src/el7/develop/qore/git/module-jni/build/org/qore/jni/QoreJavaApi.class': No such file or directory
call stack:
2: FileInputStream::constructor() (/export/home/build/src/el7/develop/qore/git/module-jni/make-inc:53, builtin code)
1: MakeInc::constructor() (line -1, user code)
make[2]: *** [JavaClassQoreJavaApi.inc] Error 3
make[2]: Leaving directory /export/home/build/src/el7/develop/qore/git/module-jni/build
make[1]: *** [CMakeFiles/jni.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
does anybody know why the class is not exported?
it looks like you just have to run cmake again from the build directory - try:
rm -rf * && cmake .. && make
from the build directory - if you are building from the develop branch, this should work on centos7 / rhel7 (just tried it myself)

Opam installation error from source

The following error was obtained while installing opam from source
make -C ocp-build
make[1]: Entering directory `/home/14810/opam-master/ocp-build'
make[1]: `ocp-build' is up to date.
make[1]: Leaving directory `/home/14810/opam-master/ocp-build'
make clone
make[1]: Entering directory `/home/14810/opam-master'
make -C src_ext
make[2]: Entering directory `/home/14810/opam-master/src_ext'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/14810/opam-master/src_ext'
make[1]: Leaving directory `/home/14810/opam-master'
make compile
make[1]: Entering directory `/home/14810/opam-master'
make -C ocp-build
make[2]: Entering directory `/home/14810/opam-master/ocp-build'
make[2]: `ocp-build' is up to date.
make[2]: Leaving directory `/home/14810/opam-master/ocp-build'
ocaml shell/get-git-id.ml src/core/opamGitVersion.ml
./ocp-build/ocp-build -no-use-opamfind -init -scan
Unknown option -no-use-opamfind.
make[1]: *** [compile] Error 2
make[1]: Leaving directory `/home/14810/opam-master'
make: *** [all] Error 2
tried removing options from the makefile but did not work

Apache thrift can not make

When I'm trying to configure and make thrift 0.9.1 it gives some errors. Can anyone tell me the reason for that and what should I do to overcome this issue. Errors are shown in below.
user#linux-yyzo:~/WorkDir/thrift-0.9.1> make
make all-recursive
make[1]: Entering directory `/home/user/WorkDir/thrift-0.9.1'
Making all in compiler/cpp
make[2]: Entering directory `/home/user/WorkDir/thrift-0.9.1/compiler/cpp'
make all-am
make[3]: Entering directory `/home/user/WorkDir/thrift-0.9.1/compiler/cpp'
\
\
/bin/sh ../../ylwrap `test -f 'src/thrifty.yy' || echo './'`src/thrifty.yy y.tab.c thrifty.cc y.tab.h thrifty.h y.output thrifty.output -- yacc -d
../../ylwrap: line 113: yacc: command not found
make[3]: *** [thrifty.cc] Error 1
make[3]: Leaving directory `/home/user/WorkDir/thrift-0.9.1/compiler/cpp'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/user/WorkDir/thrift-0.9.1/compiler/cpp'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/user/WorkDir/thrift-0.9.1'
make: *** [all] Error 2
user#linux-yyzo:~/WorkDir/thrift-0.9.1>
There are two resources on the Thrift web site worth reading when one runs into troubles like this.
The Requirements give a good overview about the dependencies; the Building From Source page explains build steps and configure switches briefly. Additionally, the requirements page holds some links to more specific information for builds on Ubuntu, CentOS, Windows and OS X.

Makefile install target sometimes working, sometimes not

I'm currently working on a project that should also provide a source package to be packaged into linux systems. Since I'm using monodevelop, I used
mdtool generate-makefiles AudioCuesheetEditor.sln --simple-makefiles
to generate makefiles,etc. But there is a little problem. On some system everything works fine when running the last step
make install
but sometimes not. The output then says
[root#VMFedora17 Downloads]# make install
make[1]: Entering directory `/home/sven/Downloads'
make[1]: Leaving directory `/home/sven/Downloads'
make[1]: Entering directory `/home/sven/Downloads'
make pre-install-local-hook prefix=/usr/local
make[2]: Entering directory `/home/sven/Downloads'
make[2]: Leaving directory `/home/sven/Downloads'
make install-satellite-assemblies prefix=/usr/local
make[2]: Entering directory `/home/sven/Downloads'
mkdir -p '/usr/local/lib'
cp bin/Release /usr/local/lib/AudioCuesheetEditor
cp: omitting directory `bin/Release'
make[2]: *** [/usr/local/lib/AudioCuesheetEditor] Error 1
make[2]: Leaving directory `/home/sven/Downloads'
make[1]: *** [install-local] Error 2
make[1]: Leaving directory `/home/sven/Downloads'
make: *** [install-recursive] Error 1
This was run on a Fedora 17 Linux with KDE installed. On another Fedora 17 KDE everything went perfect.
Could somebody help me, where the error is?
Makefile can be found here: http://sourceforge.net/p/audiocuesheet/code/140/tree/trunk/Quellcode/AudioCuesheetEditor.make
Thanks for your help!
From your output and the link you provided, I found the error in the following snippet:
install-local: $(ASSEMBLY) $(ASSEMBLY_MDB)
make pre-install-local-hook prefix=$(prefix)
make install-satellite-assemblies prefix=$(prefix)
mkdir -p '$(DESTDIR)$(libdir)/$(PACKAGE)'
$(call cp,$(ASSEMBLY),$(DESTDIR)$(libdir)/$(PACKAGE))
I guess $(ASSEMBLY) was a directory, but I am not sure. And the command cp without the parameter -r will not copy the directory recursively. You can try to modify
$(call cp,$(ASSEMBLY),$(DESTDIR)$(libdir)/$(PACKAGE))
to
$(call cp,-r,$(ASSEMBLY),$(DESTDIR)$(libdir)/$(PACKAGE))
or
cp -r $(ASSEMBLY) $(DESTDIR)$(libdir)/$(PACKAGE)
Additionally, if you want to find out why the original works on one machine but not on the another, you can add a command:
echo $(ASSEMBLY)
before the above command to see if the output of them are different on different machines.

gcc 4.5 installation problem under ubuntu

I tried to install gcc 4.5 on ubuntu 10.04 but failed.
Here is a compile error that I don't know how to solve. Is there anyone successfully install the latest gcc on ubuntu?
Following is my steps and the error message, I'd like to know where is the problem....
Step1: download these files:
gcc-core-4.5.0.tar.gz
gcc-g++-4.5.0.tar.gz
gmp-4.3.2.tar.bz2
mpc-0.8.1.tar.gz
mpfr-2.4.2.tar.gz
Step2: Unzip above files
Step3: move gmp, mpc, mpfr to the gcc-4.5.0/ directory.
mv gmp-4.3.2 gcc-4.5.0/gmp
mv mpc-0.8.1 gcc-4.5.0/mpc
mv mpfr-2.4.2 gcc-4.5.0/mpfr
Step4: go to gcc-4.5.0 directory and do configuration:
sudo ./configure
Step5: compile and install
sudo make
sudo make install
The first 4 steps is OK, I can configure it successfully. However, when I try to compile it, following error message comes out, I cannot figure out what the problem is. Should I change the name from "gcc 4.5" to "gcc"?? It's a little strange that we need to do this by ourself. Is there anything I missed during the installation?
xxx#xxx-laptop:/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0$ sudo make
[sudo] password for xxx:
[ -f stage_final ] || echo stage3 > stage_final
/bin/bash: line 2: test: /media/Data/Tool/linux/gcc: binary operator expected
/bin/bash: /media/Data/Tool/linux/gcc: No such file or directory
make[1]: Entering directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0'
make[2]: Entering directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0'
make[3]: Entering directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0'
rm -f stage_current
make[3]: Leaving directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0'
make[2]: Leaving directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0'
make[2]: Entering directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0'
Configuring stage 1 in host-x86_64-unknown-linux-gnu/intl
/bin/bash: /media/Data/Tool/linux/gcc: No such file or directory
make[2]: *** [configure-stage1-intl] Error 127
make[2]: Leaving directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0'
make: *** [all] Error 2
It might not be a good idea to have a space in your path - it's kind of rare and can easily mess up shell scripts that aren't specially designed to deal with it (which is a bad combination!)
Another potential problem is that you're running configure inside the gcc source directory - this isn't recommended (and didn't work at all for me on at least one version of gcc 4). Instead make an empty build directory, parallel to the source directory, so you have something like:
gcc 4.5 <- but might want to avoid the space
gcc-4.5.0
...
build
Then cd into build and run
../gcc-4.5.0/configure
You may also need to start from a freshly unzipped source directory, as the previous failed build may have broken it.