audiowaveform error (No such file or directory #include "gmock/gmock.h") while installing on aws elastic beanstalk - amazon-elastic-beanstalk

I have been installing and using audiowaveform on AWS Elastic Beanstalk via an ebextensions but for some reason I now get an error during the build process:
...
[ 72%] Building CXX object CMakeFiles/audiowaveform_tests.dir/src/WavFileWriter.cpp.o
[ 73%] Building C object CMakeFiles/audiowaveform_tests.dir/src/madlld-1.1p1/bstdfile.c.o
[ 75%] Building CXX object CMakeFiles/audiowaveform_tests.dir/test/FileFormatTest.cpp.o
/opt/src/audiowaveform/audiowaveform-master/test/FileFormatTest.cpp:26:25:
fatal error: gmock/gmock.h: No such file or directory #include "gmock/gmock.h" ^ compilation terminated.
make[2]: *** [CMakeFiles/audiowaveform_tests.dir/test/FileFormatTest.cpp.o] Error 1
make[1]: *** [CMakeFiles/audiowaveform_tests.dir/all] Error 2 make: *** [all] Error 2.
Below is the ebextension that I have been using:
packages:
yum:
make: []
cmake: []
gcc-c++: []
gd-devel: []
boost-devel: []
sources:
/opt/src/audiowaveform: https://github.com/bbc/audiowaveform/archive/master.zip
/opt/src/googletest: https://github.com/google/googletest/archive/release-1.10.0.tar.gz
/opt/src/libmad: https://sourceforge.net/projects/mad/files/libmad/0.15.1b/libmad-0.15.1b.tar.gz/download
/opt/src/libsndfile: http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.28.tar.gz
/opt/src/libid3tag: https://sourceforge.net/projects/mad/files/libid3tag/0.15.1b/libid3tag-0.15.1b.tar.gz/download
files:
/usr/lib/pkgconfig/mad.pc:
mode: "000755"
owner: root
group: root
content: |
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: mad
Description: MPEG audio decoder
Requires:
Version: 0.15.1b
Libs: -L${libdir} -lmad
Cflags: -I${includedir}
/etc/ld.so.conf.d/libsndfile:
mode: "000644"
owner: root
group: root
content: |
/usr/lib/
commands:
00-install-libmad-make:
command: "sed -i '/-fforce-mem/d' configure"
cwd: /opt/src/libmad/libmad-0.15.1b/
01-install-libmad-make:
command: "./configure --prefix=/usr && make && make install"
cwd: /opt/src/libmad/libmad-0.15.1b
test: "[ ! -f /usr/local/bin/audiowaveform ]"
02-install-libsndfile-make:
command: "./configure --prefix=/usr --disable-static --docdir=/usr/share/doc/libsndfile-1.0.28 && make && make install"
cwd: /opt/src/libsndfile/libsndfile-1.0.28
test: "[ ! -f /usr/local/bin/audiowaveform ]"
03-install-libid3tag-make:
command: "./configure --prefix=/usr && make && make install"
cwd: /opt/src/libid3tag/libid3tag-0.15.1b
test: "[ ! -f /usr/local/bin/audiowaveform ]"
04-change-mod-audiowaveform:
command: "chmod -R 755 audiowaveform-master"
cwd: /opt/src/audiowaveform
05-audiowaveform-ln-test:
command: "ln -s ../../googletest/googletest-release-1.10.0/googletest ./googletest"
cwd: /opt/src/audiowaveform/audiowaveform-master/
test: "[ ! -L ./googletest ]"
06-audiowaveform-ln-mock:
command: "ln -s ../../googletest/googletest-release-1.10.0/googlemock ./googlemock"
cwd: /opt/src/audiowaveform/audiowaveform-master/
test: "[ ! -L ./googlemock ]"
07-audiowaveform-mkdir-build:
command: "sudo mkdir build"
cwd: /opt/src/audiowaveform/audiowaveform-master/
test: "[ ! -d ./build ]"
08-audiowaveform-cmake:
command: "cmake .."
cwd: /opt/src/audiowaveform/audiowaveform-master/build/
test: "[ ! -f /usr/local/bin/audiowaveform ]"
09-audiowaveform-make:
command: "make"
cwd: /opt/src/audiowaveform/audiowaveform-master/build/
test: "[ ! -f /usr/local/bin/audiowaveform ]"
10-audiowaveform-make-install:
command: "make install"
cwd: /opt/src/audiowaveform/audiowaveform-master/build/
test: "[ ! -f /usr/local/bin/audiowaveform ]"
11-ldconfig:
command: "ldconfig"
Anyone know of something that has changed? So far I haven't found anything.
Do I need to use a different process? I am really not sure what to do next. I have created an new application and environment and tried deploying to it to make sure I haven't messed up the current one but I get the same error.

Well it looks like it is a version issue. This was on our dev environment and found out it was trying to install version 1.5.1 and our production version is on 1.4.2. So I changed the
/opt/src/audiowaveform: https://github.com/bbc/audiowaveform/archive/master.zip
to
/opt/src/audiowaveform: https://github.com/bbc/audiowaveform/archive/refs/tags/1.4.2.zip
and changed all the references to audiowaveform-master to audiowaveform-1.4.2 in the commands below and it seems to work.
Currently we are on a deprecated platform so am transitioning to a supported platform at the same time so I haven't made sure that it works completely but at least it builds it.

Related

Install problem MiKTeX under GitHub Actions

Since around October 16 2022 we have problems with installing MiKTeX under GitHub Actions.
The error we get is:
Run ./miktexsetup_standalone --local-package-repository=C:/miktex-repository \
./miktexsetup_standalone --local-package-repository=C:/miktex-repository \
--package-set=essential \
--shared \
install
shell: C:\Program Files\Git\bin\bash.EXE --noprofile --norc -e -o pipefail {0}
initexmf.exe: The executed process did not succeed.
initexmf.exe: Data: fileName="C:\Program Files\MiKTeX\miktex\bin\x64\initexmf.exe", exitCode="1"
Error: Process completed with exit code 1.
The procedure followed in GitHub Actions consists of a few steps:
Step 1:
- name: Download MikTex (Windows)
run: |
$wc = New-Object System.Net.WebClient;
$maxAttempts=5;
$attemptCount=0;
Do {
$attemptCount++;
Try {
$wc.DownloadFile("https://ctan.math.illinois.edu/systems/win32/miktex/setup/windows-x64/miktexsetup-5.1-x64.zip","miktexsetup-5.1-x64.zip")
} Catch [Exception] {
Write-Host $_.Exception | format-list -force
}
} while (((Test-Path "miktexsetup-5.1-x64.zip") -eq $false) -and ($attemptCount -le $maxAttempts))
shell: pwsh
if: matrix.config.os == 'windows-latest'
Step 2:
- name: Extract MikTex zip (Windows)
shell: bash
run: |
unzip miktexsetup-5.1-x64.zip
if: matrix.config.os == 'windows-latest'
Step 3:
- name: Download MikTex packages (Windows)
shell: bash
run: |
./miktexsetup_standalone --verbose \
--local-package-repository=C:/miktex-repository \
--remote-package-repository="https://ctan.math.illinois.edu/systems/win32/miktex/tm/packages/" \
--package-set=essential \
download
if: matrix.config.os == 'windows-latest'
Step 4 (the failing step):
- name: Install MikTex packages (Windows)
shell: bash
run: |
./miktexsetup_standalone --local-package-repository=C:/miktex-repository \
--package-set=essential \
--shared \
install
if: matrix.config.os == 'windows-latest'
Step 5:
- name: Setting MikTex paths (Windows)
shell: bash
run: |
echo "C:/Program Files/MiKTeX/miktex/bin/x64/" >> $GITHUB_PATH
export PATH="/c/Program Files/MiKTeX/miktex/bin/x64/:$PATH"
echo "Configuring MiKTeX to install missing packages on the fly"
initexmf --admin --verbose --set-config-value='[MPM]AutoInstall=1'
if: matrix.config.os == 'windows-latest'
Any ideas how to solve this problem / what can be the problem?
Based on discussions in https://github.com/MiKTeX/miktex/discussions/1204 and https://github.com/MiKTeX/miktex/issues/1213 the solution is to replace the MiKTeX version's zip file
from:
miktexsetup-5.1-x64.zip
to:
miktexsetup-5.2.0+b8f430f-x64.zip

xcodebuild fails until pod installing again(twice) after the failure occurs - how to resolve?

I'm setting up github actions to test my xcode app (kotlin multiplatform) and for some reason my build is not successful until pod installing a second time after attempting to build.
So I pod install -> build -> build fails -> pod install again -> build -> build succeeds.
Steps to reproduce this locally:
Checkout the repo
arch -x86_64 pod install
xcodebuild ARCHS=x86_64 ONLY_ACTIVE_ARCH=NO -workspace myworkspace.xcworkspace -scheme
myScheme -configuration Release -destination 'platform=iOS Simulator,name=iPhone 12,OS=15.4'
The build fails on this step trying to import the common kotlin library:
import common
^
** BUILD FAILED **
and then if I run these steps again
arch -x86_64 pod install
xcodebuild ARCHS=x86_64 ONLY_ACTIVE_ARCH=NO -workspace myworkspace.xcworkspace -scheme myScheme -configuration Release -destination 'platform=iOS Simulator,name=iPhone 12,OS=15.4'
the build is successful
/usr/bin/codesign --force --sign - --entitlements /Users/me/Library/Developer/Xcode/DerivedData/myApp-esecylpzfadofbsakhxtkqqgzuk/Build/Intermediates.noindex/myApp.build/Release-iphonesimulator/myApp.build/myApp.app.xcent --timestamp\=none --generate-entitlement-der /Users/me/Library/Developer/Xcode/DerivedData/myApp-esecylpzfadofbsakhxtkqqgzuk/Build/Products/Release-iphonesimulator/myApp.app
** BUILD SUCCEEDED **
Here is my podfile:
platform :ios, '15.2'
use_frameworks!
inhibit_all_warnings!
def shared_pods
pod 'common', :path => '../common'
pod 'GoogleSignIn'
end
target 'myApp' do
shared_pods
end
target 'myApp_Tests' do
shared_pods
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
end
end
end
and here's my BuildTests.yaml file for github actions
name: ios-unit-tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
run_tests:
runs-on: macos-latest
strategy:
matrix:
include:
- ios: "15.2"
name: test iOS (${{ matrix.ios }})
steps:
- uses: actions/setup-java#v2
with:
distribution: 'temurin'
java-version: '11'
- name: Checkout repository
uses: actions/checkout#v3
- name: Install the Apple certificate and provisioning profile
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $PP_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
# apply provisioning profile
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
- name: Install M1 Pod
run: sudo arch -x86_64 gem install ffi;
- name: Pod Install
run: cd myApp; which pod; rm myApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved; arch -x86_64 pod install
- name: Build
run: xcodebuild ARCHS=x86_64 ONLY_ACTIVE_ARCH=NO -workspace myApp/myApp.xcworkspace -scheme myApp -configuration Release -destination 'platform=iOS Simulator,name=iPhone 12,OS=${{ matrix.ios }}'
- name: Run unit tests
run: xcodebuild test -workspace myApp/myApp.xcworkspace -scheme myApp -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 12,OS=${{ matrix.ios }}'
UPDATE:
Resolution was to delete .gitignore and build the project and see which files changed. Turned out there were some build files commented out that should have been committed

Packer: create docker image with ubuntu and nginx

I have the following Dockerfile:
FROM ubuntu:bionic
RUN apt-get update -y && apt-get install -y nginx
EXPOSE 80
CMD ["/usr/sbin/nginx", "-g", "daemon off;"]
Building the container and running it through the following commands works:
$ docker build -t web:1.0 .
$ docker run -itd -p 8200:80 --name webserver1 web:1.0
I made an equivalent Packer file as follows:
packer {
required_plugins {
docker = {
version = ">= 1.0.1"
source = "github.com/hashicorp/docker"
}
}
}
source "docker" "ubuntu" {
image = "ubuntu:bionic"
commit = true
changes = [
"EXPOSE 80",
"CMD [\"/usr/sbin/nginx\", \"-g\", \"daemon off;\"]"
]
}
build {
name = "learn-packer"
sources = [
"source.docker.ubuntu"
]
provisioner "shell" {
inline = [
"apt-get -y update",
"apt-get install -y nginx",
]
}
post-processors {
post-processor "docker-tag" {
repository = var.docker_repo
tags = ["1.1"]
}
}
}
I'm creating the image with packer build . When I run the image through Docker
docker run -itd -p 8201:80 --name webserver2 xxx/web:1.1
I get the following error:
usr/sbin/nginx: 1: usr/sbin/nginx: Syntax error: ")" unexpected

run realize start for a Go program, outputs exec: not started

when I run realize start for a Go program, I got this error result
[14:55:13][V2-USER-API.YUMMY.ID] : Watching 159 file/s 118 folder/s
[14:55:13][V2-USER-API.YUMMY.ID] : Install started
[14:55:13][V2-USER-API.YUMMY.ID] : Install
exec: not started
I have set up my file .realize.yaml, like this
settings:
legacy:
force: false
interval: 0s
schema:
- name: v2-user-api.yummy.id
path: ./cmd/server
commands:
run:
status: true
watcher:
extensions:
- go
paths:
- ../../
ignored_paths:
- .git
- .realize
- vendor
but I got error after run realize start
This command work for me
#!/usr/bin/env bash
export GO111MODULE=off
cd ~/
go get github.com/oxequa/realize
cd /go/src/github.com/oxequa/realize && \
git fetch && \
git checkout v2.0.2 && \
go get github.com/oxequa/realize
RV=$(realize --version)
echo "Realize installed #: $RV"
export GO111MODULE=on
use realize version v2.0.2

Busybox rpm scriplets

I am packaging with rpm for embedded device with busybox instead normal GNU system.
When I install with busybox, it install module, but do not even try to run scriplets.
On regular system, It runs them and fails(ofc, another version of kernel).
Question: Where am I wrong, and how to work around it?
Here is my spec-file:
# The kernel version you are building for
%define kernel 3.4.0-rc6-01292-g9b8149d
# The name of the module you are supplying
%define modname ktgrabber
# The path to the module, after it is installed
%define modpath /lib/modules/%{kernel}/kernel/net/ipv4
# Which revision are we on
%define pkgrelease 1.SL
# Is this a new module, or are we replacing an existing module
# 1 - new module
# 0 - replacing an existing module
%define newmodule 1
# Optional - what Architecture we are building for
#%define thisarch ia32e
Name: kernel-module-%{modname}-%{kernel}
Summary: Kernel Module %{modname} for the %{kernel} kernel
Version: 0.99
Release: 1
Epoch: 0
License: GPLv2+
Packager: Troy Dawson <dawson#fnal.gov>
Group: System Environment/Kernel
BuildRoot: %{_tmppath}/%{name}-%{version}-root
#Requires: /boot/vmlinux-%{kernel}, modutils
Provides: kernel-module-%{modname} = %{epoch}:%{version}
Source0: %{modname}.ko.%{kernel}
%description
This package provides a %{modname} kernel module for
kernel %{kernel}.
%install
mkdir -p $RPM_BUILD_ROOT/%{modpath}
%if %{newmodule}
install -m 644 %{SOURCE0} $RPM_BUILD_ROOT/%{modpath}/%{modname}.ko
%else
install -m 644 %{SOURCE0} $RPM_BUILD_ROOT/%{modpath}/%{modname}.%{version}.%{pkgrelease}.o
%endif
%pre
touch /root/bar
mkdir /alice
%post
touch /bar
/bin/echo %{modname} >> /etc/modules
depmod
mkdir /foo
depmod -ae %{kernel} >/dev/null 2>&1
modprobe %{modname}
%postun
sed -i 's/^%{modname}$//g' /etc/modules
%if %{newmodule}
depmod -ae %{kernel} >/dev/null 2>&1 || :
%else
if [ "" = "0" ] ; then
if ! [ -f %{modpath}/%{modname}.original.o ] ; then
mv %{modpath}/%{modname}.o %{modpath}/%{modname}.original.o
fi
cp -f %{modpath}/%{modname}.%{version}.%{pkgrelease}.o %{modpath}/%{modname}.o
depmod -ae %{kernel} >/dev/null 2>&1 || :
fi
%endif
%files
%if %{newmodule}
%{modpath}/%{modname}.ko
%else
%{modpath}/%{modname}.%{version}.%{pkgrelease}.ko
%endif
Check out this link : http://lists.busybox.net/pipermail/busybox/2006-November/059507.html scriptlets aren't run by busybox's rpm command.
Looking at the source at http://git.busybox.net/busybox/tree/archival/rpm.c#n149 that appears to be true.