Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #95 Fixes #75 Repairing libcurl compilation for 0.26.0 ARM #96

Merged
merged 40 commits into from
Jul 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
6ee89a1
use CMAKE_BUILD_TYPE o debug as default value if none specified ref #66
May 26, 2019
29c7110
build lib curl in release mode ref #66
May 26, 2019
d304b68
update changeslog ref #66
May 26, 2019
bf51ecd
refs #66 - Minor fix in CHANGELOG
olemis Jun 12, 2019
3e0b289
Merge pull request #67 from simelo/stdevAlDen_t66_curl_lib_in_release
olemis Jun 12, 2019
3d8b9ca
[release] Add static installation to skyapi
stdevMac Jun 27, 2019
f9ce81d
Merge commit '3d8b9ca50' into v0.25dev
stdevMac Jun 27, 2019
8938f5c
[release] Solve issue in cmake generation in skyapi
stdevMac Jun 27, 2019
0c2241f
[circle] refs #75 Changing the distros to execute the tests and defin…
Jun 27, 2019
8c133e3
[docker-circle] refs #75 Change dist and install deps `make install-…
Jun 27, 2019
db1024f
[ci-script] refs #75 Install `software-properties-common` in Ubuntu a…
Jun 27, 2019
9d40db1
[ci-scripts][docker-test-arm] refs #75 Installing the dependencies of…
Jun 27, 2019
cc8d8bd
[circle] refs #75 Changes in the distribution of linux where the libs…
Jun 28, 2019
ecc7ccf
[circle][docker] refs #75 Changing the installation packages for the …
Jun 28, 2019
f3e87b2
[docker-deploy-arm] refs #75 Change the imagen docker `arch-debian-go…
Jun 28, 2019
b86db5b
[swig] refs #88 Changing the generation of values for int64 in the mu…
Jun 29, 2019
1d862bc
Merge pull request #89 from simelo/stdevHan_t88_swig_multiple_return
olemis Jun 29, 2019
277387e
Merge pull request #85 from simelo/stdevHan_t75_circle_deploy
olemis Jun 29, 2019
bc6635e
Merge remote-tracking branch 'origin/v0.25dev' into v0.25dev
stdevMac Jun 29, 2019
d1e5218
[release] Update readme release instructions
stdevMac Jun 29, 2019
0398340
[release] Update CHANGELOG. removed unrelease section
stdevMac Jun 30, 2019
06dd0f4
Merge pull request #65 from simelo/v0.25dev
olemis Jun 30, 2019
4515f32
Merge pull request #90 from simelo/v0.25dev
olemis Jun 30, 2019
84cb511
[circle][docker-deploy] refs #75 Modifying Circle CI configurations a…
Jul 3, 2019
2f3c513
[circle] refs #75 Restore conf the Circle CI
Jul 3, 2019
a69eca5
[circle] refs #75 Change in image testing `circleci/buildpack-deps:bi…
Jul 3, 2019
43624dd
Merge branch 'v0.25dev' of https://github.com/skycoin/libskycoin into…
Jul 3, 2019
19878e2
[circle] refs #75 Remove circle/Dockerfile
Jul 3, 2019
03af670
[circle] refs #75 Correcting path the script validator
Jul 3, 2019
f075766
[circle] refs #75 Change path the script validarot to deploy-arm
Jul 3, 2019
69fa684
[circle] refs #75 Define `working_directory` in `publish-github-relea…
Jul 3, 2019
d4adfbb
[docker-arm] refs #75 Correcting that label RUN => ENV
Jul 3, 2019
0219090
Merge pull request #91 from simelo/stdevHan_t75_not_deploy_circle
olemis Jul 3, 2019
75696d4
Merge pull request #92 from skycoin/v0.25dev
olemis Jul 3, 2019
0a247bf
[circle] refs #75 Correcting the deploy statement in Circle CI
Jul 4, 2019
379e4df
Merge pull request #93 from simelo/stdevHan_t75_correct_path_deploy
olemis Jul 4, 2019
81c5b0f
Merge pull request #94 from skycoin/v0.25dev
olemis Jul 4, 2019
d584eef
[circle] refs #95 Fixed how to compile libcurl for use in ARM
Jul 9, 2019
2fa0873
[test-libc] refs #95 Rewrite `isU8Eq` to avoid random errors in the t…
Jul 9, 2019
11d9589
Merge branch 'develop' of https://github.com/skycoin/libskycoin into …
Jul 9, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
orangepi-plus2:
docker:
- image: docker:18.06.0-ce-git
- image: circleci/golang:1.12
working_directory: $GOPATH/src/github.com/skycoin/libskycoin
environment:
QEMU_PLATFORM: orangepi-plus2
Expand All @@ -12,11 +12,12 @@ jobs:
- checkout
- setup_remote_docker:
version: 18.06.0-ce
docker_layer_caching: true
- run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test

raspberrypi3:
docker:
- image: docker:18.06.0-ce-git
- image: circleci/golang:1.12
working_directory: $GOPATH/src/github.com/skycoin/libskycoin
environment:
QEMU_PLATFORM: raspberrypi3
Expand All @@ -26,11 +27,12 @@ jobs:
- checkout
- setup_remote_docker:
version: 18.06.0-ce
docker_layer_caching: true
- run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test

raspberrypi2:
docker:
- image: docker:18.06.0-ce-git
- image: circleci/golang:1.12
working_directory: $GOPATH/src/github.com/skycoin/libskycoin
environment:
QEMU_PLATFORM: raspberry-pi2
Expand All @@ -40,11 +42,12 @@ jobs:
- checkout
- setup_remote_docker:
version: 18.06.0-ce
docker_layer_caching: true
- run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test

bananapi_m1_plus:
docker:
- image: docker:18.06.0-ce-git
- image: circleci/golang:1.12
working_directory: $GOPATH/src/github.com/skycoin/libskycoin
environment:
QEMU_PLATFORM: bananapi-m1-plus
Expand All @@ -54,18 +57,20 @@ jobs:
- checkout
- setup_remote_docker:
version: 18.06.0-ce
docker_layer_caching: true
- run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test

publish-github-release_32:
docker:
- image: docker:18.06.0-ce-git
- image: circleci/golang:1.12
working_directory: $GOPATH/src/github.com/skycoin/libskycoin
steps:
- run: mkdir -p $GOPATH/src/github.com/ $GOPATH/src/github.com/skycoin
- checkout
- setup_remote_docker:
version: 18.06.0-ce
- run: if [[ $CIRCLE_TAG ]]; then docker build --build-arg SHA1=$CIRCLE_SHA1 --build-arg GITHUB_OAUTH_TOKEN --build-arg PROJECT_USERNAME=$CIRCLE_PROJECT_USERNAME --build-arg PROJECT_REPONAME=$CIRCLE_PROJECT_REPONAME --build-arg QEMU_PLATFORM=raspberrypi3 --build-arg VERSION --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/deploy-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-deploy ; fi
docker_layer_caching: true
- run: cd $GOPATH/src/github.com/skycoin/libskycoin/ci-scripts && bash deploy-arm.sh

workflows:
version: 2
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Added

- Be able to set a build type for lib curl.
- Export functions in Skycoin 0.25.1 core API's
- `skyapi` C client for Skycoin node REST at `lib/curl`.
- Support for building `libskycoin` on ARM and 32 / 64 bits.
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ BUILDLIB_DIR = $(BUILD_DIR)/libskycoin
BUILDLIBSKYAPI_DIR = $(BUILD_DIR)/libskyapi
LIBNAME_Linux = libskyapi.so
LIBNAME_Darwin = libskyapi.dylib
LIBNAME_Static = libskyapiStatic.a
LIB_DIR = lib
BIN_DIR = bin
DOC_DIR = docs
Expand Down Expand Up @@ -103,6 +104,7 @@ build-skyapi: ## Build skyapi(libcurl based) library
(cd lib/curl && bash ./install_lib_curl.sh)
mkdir -p ./build/libskyapi
cp lib/curl/build/$(LIBNAME_$(UNAME_S)) ./build/libskyapi
cp lib/curl/build/$(LIBNAME_Static) ./build/libskyapi

build: build-libc build-skyapi ## Build libraries

Expand Down
39 changes: 38 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ $ make test-libc
0. Make a PR merging the release branch into `master`
0. Review the PR and merge it
0. Tag the `master` branch with the version number. Version tags start with `v`, e.g. `v0.20.0`. Sign the tag. If you have your GPG key in github, creating a release on the Github website will automatically tag the release. It can be tagged from the command line with `git tag -as v0.20.0 $COMMIT_ID`, but Github will not recognize it as a "release".
0. Release builds are created and uploaded by travis. To do it manually, checkout the master branch and follow the [create release builds instructions](#creating-release-builds).
0. Release builds are created and uploaded by travis. To do it manually, checkout the master branch and make release.
0. Merge changes in `master` back into `develop` branch to start working towards next stable version.

#### Pre-release testing
Expand All @@ -98,6 +98,43 @@ Perform these actions before releasing:
```sh
make check
```
#### Release signing

Releases are signed with this PGP key:

`0x5801631BD27C7874`

The fingerprint for this key is:

```
pub ed25519 2017-09-01 [SC] [expires: 2023-03-18]
10A7 22B7 6F2F FE7B D238 0222 5801 631B D27C 7874
uid GZ-C SKYCOIN <[email protected]>
sub cv25519 2017-09-01 [E] [expires: 2023-03-18]
```

Keybase.io account: https://keybase.io/gzc

##### Alternative signing keys:

Keybase.io account: https://keybase.io/olemis

The fingerprint for this key is:

```
pub rsa4096 2019-01-17 [SC] [expires: 2024-01-16]
uid Olemis Lang <[email protected]>
sub rsa4096 2019-01-17 [E] [expires: 2024-01-16]
```

Follow the [Tor Project's instructions for verifying signatures](https://www.torproject.org/docs/verifying-signatures.html.en).

If you can't or don't want to import the keys from a keyserver, the signing key is available in the repo: [gz-c.asc](gz-c.asc).

Releases and their signatures can be found on the [releases page](https://github.com/skycoin/skycoin/releases).

Instructions for generating a PGP key, publishing it, signing the tags and binaries:
https://gist.github.com/gz-c/de3f9c43343b2f1a27c640fe529b067c

## Development

Expand Down
12 changes: 12 additions & 0 deletions ci-scripts/deploy-arm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

set -x

git --version

export VERSION="$(git describe --tags --exact-match HEAD)"

if [[ "$VERSION" ]]; then
docker build --build-arg SHA1=$CIRCLE_SHA1 --build-arg GITHUB_OAUTH_TOKEN --build-arg PROJECT_USERNAME=$CIRCLE_PROJECT_USERNAME --build-arg PROJECT_REPONAME=$CIRCLE_PROJECT_REPONAME --build-arg QEMU_PLATFORM=armv7hf --build-arg VERSION --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/deploy-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-deploy
docker build --build-arg SHA1=$CIRCLE_SHA1 --build-arg GITHUB_OAUTH_TOKEN --build-arg PROJECT_USERNAME=$CIRCLE_PROJECT_USERNAME --build-arg PROJECT_REPONAME=$CIRCLE_PROJECT_REPONAME --build-arg QEMU_PLATFORM=aarch64 --build-arg VERSION --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/deploy-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-deploy
fi
8 changes: 6 additions & 2 deletions ci-scripts/docker_install_debian.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#!/usr/bin/env bash

apt-get update
apt-get install gcc-6 g++-6 curl wget -y
apt-get install gcc-6 g++-6 wget cmake libcurl3-gnutls -y

wget -c https://github.com/libcheck/check/releases/download/0.12.0/check-0.12.0.tar.gz
tar -xzf check-0.12.0.tar.gz
cd check-0.12.0 && ./configure --prefix=/usr --disable-static && make && sudo make install
cd check-0.12.0 && ./configure --prefix=/usr --disable-static && make && sudo make install

wget -c http://curl.haxx.se/download/curl-7.58.0.tar.gz
tar -xvf curl-7.58.0.tar.gz
cd curl-7.58.0/ && make && sudo make install
6 changes: 5 additions & 1 deletion ci-scripts/docker_install_ubuntu.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/usr/bin/env bash

apt-get update
apt-get install gcc-6 g++-6 curl wget -y
apt-get install gcc-6 g++-6 curl wget cmake libcurl3-gnutls -y

sudo apt-get remove curl -y
(cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure && make && sudo make install)
(cd deps && git clone https://github.com/uncrustify/uncrustify.git && cd uncrustify && mkdir build && cd build && cmake .. && make && sudo make install)

wget -c https://github.com/libcheck/check/releases/download/0.12.0/check-0.12.0.tar.gz
tar -xzf check-0.12.0.tar.gz
Expand Down
12 changes: 6 additions & 6 deletions docker/images/deploy-arm/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
ARG QEMU_PLATFORM
FROM balenalib/${QEMU_PLATFORM}-debian-golang

ARG QEMU_PLATFORM
ARG GITHUB_OAUTH_TOKEN
ARG PROJECT_USERNAME
ARG PROJECT_REPONAME
ARG SHA1
ARG VERSION
ADD . $GOPATH/src/github.com/skycoin/libskycoin/

RUN [ "cross-build-start" ]
Expand All @@ -15,12 +16,11 @@ RUN make -C $GOPATH/src/github.com/skycoin/libskycoin dep
RUN go get github.com/gz-c/gox
RUN go get -t ./...
ENV CGO_ENABLED=1
RUN export VERSION="$(git describe --tags --exact-match HEAD 2> /dev/null)"
RUN export ARCH="$(uname -m)"
RUN export OS="$(uname -s)"
ENV ARCH=${QEMU_PLATFORM}
ENV OS="Linux"
RUN make -C $GOPATH/src/github.com/skycoin/libskycoin build
RUN tar -c -z -f libskycoin-${VERSION}-${OS}-${ARCH}.tar.gz -C $GOPATH/src/github.com/skycoin/libskycoin/build $GOPATH/src/github.com/skycoin/libskycoin/build/*
RUN tar -czf libskycoin-${VERSION}-${OS}-${ARCH}.tar.gz -C $GOPATH/src/github.com/skycoin/libskycoin/build $GOPATH/src/github.com/skycoin/libskycoin/build/*
RUN go get github.com/tcnksm/ghr
RUN ghr -t ${GITHUB_OAUTH_TOKEN} -u ${PROJECT_USERNAME} -r ${PROJECT_REPONAME} -c ${SHA1} -delete ${VERSION} libskycoin-${VERSION}-${OS}-${ARCH}.tar.gz

RUN [ "cross-build-end" ]
RUN [ "cross-build-end" ]
2 changes: 1 addition & 1 deletion docker/images/test-arm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ RUN make -C $GOPATH/src/github.com/skycoin/libskycoin test-libc
RUN [ "cross-build-end" ]

WORKDIR $GOPATH/src/github.com/skycoin
VOLUME $GOPATH/src/
VOLUME $GOPATH/src/
13 changes: 7 additions & 6 deletions lib/cgo/tests/testutils/libsky_assert.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,14 @@ GoInt_ isSigEq(cipher__Sig *sig1, cipher__Sig *sig2) {
return memcmp((void *)sig1, (void *)sig2, sizeof(cipher__Sig)) == 0;
}

GoInt_ isU8Eq(unsigned char p1[], unsigned char p2[], size_t len) {

if (strncmp(p1, p2, len) == 0) {

GoInt_ isU8Eq(unsigned char p1[], unsigned char p2[], size_t len)
{
for (GoInt i = 0; i < len; i++) {
if (p1[i] != p2[i]) {
return 0;
}
}
return 1;
}
return 0;
}

GoInt_ isSHA256Eq(cipher__SHA256 *sh1, cipher__SHA256 *sh2) {
Expand Down
5 changes: 4 additions & 1 deletion lib/curl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project(CGenerator)
#set(CMAKE_C_VISIBILITY_PRESET default)
#set(CMAKE_CXX_VISIBILITY_PRESET default)
#set(CMAKE_VISIBILITY_INLINES_HIDDEN OFF)
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_BUILD_TYPE Release)

set(pkgName "skyapi")

Expand Down Expand Up @@ -116,11 +116,14 @@ set(HDRS
include_directories(${CURL_INCLUDE_DIR})
# Add library with project file with projectname as library name
add_library(${pkgName} SHARED ${SRCS} ${HDRS})
add_library(${pkgName}Static STATIC ${SRCS} ${HDRS})
# Link dependent libraries
target_link_libraries(${pkgName} ${CURL_LIBRARIES})
#install library to destination
install(TARGETS ${pkgName} DESTINATION ${CMAKE_INSTALL_PREFIX})

unset(CMAKE_BUILD_TYPE CACHE)

# Setting file variables to null
#set(SRCS "")
#set(HDRS "")
Expand Down
2 changes: 1 addition & 1 deletion lib/curl/install_lib_curl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cd build
#echo "brew ls --verbose curl"
#brew ls --verbose curl
# for normal install use following command
cmake -DCMAKE_VERBOSE_MAKEFILE=ON ..
cmake -DCMAKE_BUILD_TYPE=Release ..
grep -R object_convertToJSON ../../
make
sudo make install
Expand Down
4 changes: 2 additions & 2 deletions lib/swig/dynamic/mem.i
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

/* Handle out typemap. */
%typemap(argout) Handle* {
%append_output( SWIG_From_long(*$1) );
%append_output( SWIG_From_long_SS_long(*$1) );
}

/* Handle not as pointer is input. */
%typemap(in) Handle {
SWIG_AsVal_long($input, (long*)&$1);
SWIG_AsVal_long_SS_long($input, (long*)&$1);
}


Expand Down
7 changes: 6 additions & 1 deletion lib/swig/dynamic/typemaps.i
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
/*GoInt64* as function return typemap*/
%typemap(argout) GoInt64* {
%append_output( SWIG_From_long( *$1 ) );
%append_output( SWIG_From_long_SS_long( *$1 ) );
}

/*GoUint64* as function return typemap*/
%typemap(argout) GoUint64* {
%append_output( SWIG_From_unsigned_SS_long_SS_long( *$1 ) );
}

/*
Expand Down