I need to get correct information from uname command when uname-hack script is running on Solaris.
More details about uname-hack:
https://blogs.oracle.com/jonh/entry/it_s_been_a_long
There is any file that contain this information or any command that can give me the correct information?
You can go to peek the information straight from the kernel with the kernel modular debugger:
Without the hack:
# uname -a
SunOS s10u11 5.10 Generic_147148-26 i86pc i386 i86pc
With the hack:
# uname -a
SunOS PowerPC 5.5.1 gate:1996-12-01 PPC i386 i86pc
# echo "$<utsname" | mdb -k
{
sysname = [ "SunOS" ]
nodename = [ "s10u11" ]
release = [ "5.10" ]
version = [ "Generic_147148-26" ]
machine = [ "i86pc" ]
}
Related
macOS Catalina, installed jenv 0.5.4 using homebrew, using zsh, followed all the steps listed in https://www.jenv.be/
In terminal I have the following error
Last login: Tue Dec 22 10:10:15 on ttys002
/usr/local/Cellar/jenv/0.5.4/libexec/libexec/jenv-refresh-plugins: line 14: /Users/username/.jenv/jenv.version: Permission denied
The below is the code from jenv-refresh-plugins
#!/usr/bin/env bash
# Summary: Refresh plugins links
resolve_link() {
$(type -p greadlink readlink | head -1) "$1"
}
set -e
[ -n "$JENV_DEBUG" ] && set -x
FORCE_REFRESH=0
if [ ! -f "${JENV_ROOT}/jenv.version" ]; then
echo "NONE" > ${JENV_ROOT}/jenv.version
fi
if [ "$1" = "--complete" ]; then
echo "--force"
exit
fi
if [ "$1" = "--force" ]; then
FORCE_REFRESH=1
fi
lastVersion=$(cat "${JENV_ROOT}/jenv.version" || echo "none")
currentVersion=$(jenv --version)
if [ ! "$lastVersion" == "$currentVersion" ] || [ $FORCE_REFRESH == "1" ]; then
echo "jenv has been updated, process to refresh plugin links"
for path in "${JENV_ROOT}/plugins/"*; do
if [ -L "$path" ]; then
pluginName=$(basename $path)
echo "Refresh plugin $pluginName"
ln -sfn "${JENV_INSTALL_DIR}/available-plugins/$pluginName" "${JENV_ROOT}/plugins/$pluginName"
fi
done
fi
echo "$currentVersion" > "${JENV_ROOT}/jenv.version"
jenv doctor
[OK] No JAVA_HOME set
[OK] Java binaries in path are jenv shims
[OK] Jenv is correctly loaded
Any help, much appreciated.
I just experienced this same issue on mac- it was caused because for some reason the folder /Users/username/.jenv had become locked.
I couldn't find a way to unlock it, so i just copied it to another directory, then ran sudo rm -rf /Users/username/.jenv , copied it back, and that has solved the problem.
I add depends packet to a exist .bb file, such as add DPENDS="AAA" line to .bb file, when I compile the .bb file, it failed for XXX rdepends on AAA-dev [dev-deps], and I search google, all the answer almost is add line INSANE_SKIP_${PN} += "dev-deps" or RDEPENDS_${PN}_remove = "AAA-dev" to .bb file.
But my question is why? why one packet depend AAA packet, it should also RDPENDS AAA-dev, is there any other answer to fix this problem
The bb source file is:
inherit autotools qcommon
DESCRIPTION = "Daemon to handle AT commands"
DEPENDS = "glib-2.0 qmi qmi-framework qmi-client-helper ocean-link"
SRC_DIR = "${WORKSPACE}/atfwd-daemon/"
S = "${WORKDIR}/atfwd-daemon/"
PR = "r3"
EXTRA_OECONF += "--with-glib --with-common-includes=${STAGING_INCDIR}"
do_configure_append() {
echo "/*This is compiled to generate, only look don't try*/" > ${S}atfwd_config.h
echo "#ifndef _ATFWD_CONFIG_H_" >> ${S}atfwd_config.h
echo "#define _ATFWD_CONFIG_H_" >> ${S}atfwd_config.h
#//<!-- ODM feature caogang#2015-07-13
if [ "${PRJ_NAU8810}" = "NAU8810_CODEC" ]; then
echo "#define NAU8810_CODEC" >> ${S}atfwd_config.h
fi
if [ "${FEATURE_ACDB_ENABLE}" = "true" ]; then
echo "#define FEATURE_ACDB_ENABLE 1" >> ${S}atfwd_config.h
fi
if [ "${PRJ_XXX}" != "" ]; then
echo "#define ${PRJ_XXX}" >> ${S}atfwd_config.h
fi
#//end-->
I add a DEPENDS on onenet pkg
inherit autotools qcommon
DESCRIPTION = "Daemon to handle AT commands"
DEPENDS = "glib-2.0 qmi qmi-framework qmi-client-helper ocean-link onenet"
SRC_DIR = "${WORKSPACE}/atfwd-daemon/"
S = "${WORKDIR}/atfwd-daemon/"
PR = "r3"
EXTRA_OECONF += "--with-glib --with-common-includes=${STAGING_INCDIR}"
do_configure_append() {
echo "/*This is compiled to generate, only look don't try*/" > ${S}atfwd_config.h
echo "#ifndef _ATFWD_CONFIG_H_" >> ${S}atfwd_config.h
echo "#define _ATFWD_CONFIG_H_" >> ${S}atfwd_config.h
#//<!-- ODM feature caogang#2015-07-13
if [ "${PRJ_NAU8810}" = "NAU8810_CODEC" ]; then
echo "#define NAU8810_CODEC" >> ${S}atfwd_config.h
fi
if [ "${FEATURE_ACDB_ENABLE}" = "true" ]; then
echo "#define FEATURE_ACDB_ENABLE 1" >> ${S}atfwd_config.h
fi
if [ "${PRJ_XXX}" != "" ]; then
echo "#define ${PRJ_XXX}" >> ${S}atfwd_config.h
fi
#//end-->
The onenet.bb is:
inherit pkgconfig cmake
DESCRIPTION = "onenet sdk"
LICENSE = "PD"
PR = "r0"
LIC_FILES_CHKSUM = "file://${WORKDIR}/git/LICENSE;md5=bae84cdd023be37582157d865da54cc6"
SRCREV = "065d98dd8de91544315d6167ce73626ce739666d"
SRC_URI = "git://github.com/cm-heclouds/MQTT.git;protocol=https"
S = "${WORKDIR}/git/mqtt_sdk"
do_install() {
install -d ${D}/usr/lib
install -d ${D}/usr/include/onenet
install -m 0644 ${B}/bin/libmqtt.so -D ${D}/usr/lib/
for inc in $(find ${S} -name *.h ! -name 'cJSON.h'); do
install -m 0644 ${inc} -D ${D}/usr/include/onenet
done
}s
The sanity check documentation explains this:
dev-deps: Checks that all packages except -dev or -staticdev packages
do not depend on -dev packages, which would be a packaging bug.
It's telling you that in your current recipe "XXX" runtime-depends on "AAA-dev" and that this is a normally an error. You need to find out how/why this dependency is added before you can decide what the correct solution is.
Based on the added recipes: The issue seems to be that onenet build produces an unversioned ".so" file. This is typically a mistake (the actual library file should be e.g. "libmqtt.so.1.1" and the unversioned file should just be a symlink to the versioned one). I'm very surprised that you are not getting a fatal error on this issue when you build onenet. Are you suppressing the QA error for this?
Since you've managed to build onenet somehow, you now probably have a onenet-dev package that erroneously contains the actual library: The build system notices this during atfwd-daemon build, adds a runtime dependency to onenet-dev (because that's where the library is) and then the QA error triggers because normal packages should not depend on -dev packages.
Possible fixes:
Either fix the onenet build system so it produces a versioned library, or
Force the .so file to be packaged into the actual onenet package instead of onenet-dev, like this:
FILES_${PN}-dev = "${includedir}/"
FILES_${PN} += "${libdir}/libmqtt.so"
A bonus suggestion: Using directory variables instead of paths like /usr/include and /usr/lib (like I did above) is a good "Best Practice".
I am testing out the Apache Ignite 2.7 Linux ODBC Driver, and it's not working correctly for some reason.
When I run a SQL statement, like SELECT Id FROM MyTable, the value is "garbled" returning a value like 8\00\05\07\09\0d\09\08\0-\0 for the the Id column. It's similar to the value I expect, though, which is 80579d98-9010-4610-b12e-ed33ed7d3c62. I don't know if those are ASCII null characters (\0), or what, but something isn't right and I can't figure it out.
When I use the SQLLine tool, the values are not "garbled". I also installed the Windows ODBC driver, and that worked fine, but I need the Linux ODBC Driver.
I built the driver with the following libraries:
gcc 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)
GNU Make 4.1
libtoolize 2.4.6
aclocal 1.15
autoheader 2.69
automake 1.15
autoreconf 2.69
unixodbc 2.3.4-1
libssl 1.0.2r-1~deb9u1
Here's the contents of the ignite-odbc-install.ini:
# cat /src/apache-ignite-2.7.0-bin/platforms/cpp/odbc/install/ignite-odbc-install.ini
[Apache Ignite]
Description=Apache Ignite
Driver=/usr/local/lib/libignite-odbc.so
Setup=/usr/local/lib/libignite-odbc.so
DriverODBCVer=03.00
FileUsage=0
Here's the result of running odbcinst:
# odbcinst -i -d -f /src/apache-ignite-2.7.0-bin/platforms/cpp/odbc/install/ignite-odbc-install.ini
odbcinst: Driver installed. Usage count increased to 1.
Target directory is /etc
Here's the contents of the /usr/local/lib folder:
# cd /usr/local/lib
# ls
libignite-binary-2.7.0.33575.so.0 libignite-common-2.7.0.33575.so.0 libignite-odbc-2.7.0.33575.so.0 libignite-thin-client-2.7.0.33575.so.0
libignite-binary-2.7.0.33575.so.0.0.0 libignite-common-2.7.0.33575.so.0.0.0 libignite-odbc-2.7.0.33575.so.0.0.0 libignite-thin-client-2.7.0.33575.so.0.0.0
libignite-binary.a libignite-common.a libignite-odbc.a libignite-thin-client.a
libignite-binary.la libignite-common.la libignite-odbc.la libignite-thin-client.la
libignite-binary.so libignite-common.so libignite-odbc.so libignite-thin-client.so
Here's the result from the ldd command:
# ldd /usr/local/lib/libignite-odbc.so
linux-vdso.so.1 (0x00007fffa46d0000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f18d554c000)
libignite-binary-2.7.0.33575.so.0 => /usr/local/lib/libignite-binary-2.7.0.33575.so.0 (0x00007f18d531d000)
libodbcinst.so.2 => /usr/lib/x86_64-linux-gnu/libodbcinst.so.2 (0x00007f18d5108000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f18d4d86000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f18d4a82000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f18d46e3000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f18d44cc000)
/lib64/ld-linux-x86-64.so.2 (0x00007f18d59f8000)
libignite-common-2.7.0.33575.so.0 => /usr/local/lib/libignite-common-2.7.0.33575.so.0 (0x00007f18d42b5000)
libltdl.so.7 => /usr/lib/x86_64-linux-gnu/libltdl.so.7 (0x00007f18d40ab000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f18d3e8e000)
UPDATE 1
I ran this from a .Net Core 2.2 C# Console program, with only the System.Data.Odbc 4.5.0 NuGet reference in a Docker Linux Environment.
IgniteGarbledDataReproducer.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Data.Odbc" Version="4.5.0" />
</ItemGroup>
</Project>
Program.cs
using System;
using System.Data.Odbc;
namespace IgniteGarbledDataReproducer {
internal class Program {
private static void Main(string[] args) {
Console.WriteLine("START");
var connectionString = Environment.GetEnvironmentVariable("IGNITE_CONNECTION_STRING");
Console.WriteLine(connectionString);
using (var conn = new OdbcConnection(connectionString)) {
conn.Open();
Console.WriteLine("Connection Opened");
using (var cmd = conn.CreateCommand()) {
cmd.CommandText = "DROP TABLE IF EXISTS MyTable;";
cmd.ExecuteNonQuery();
}
Console.WriteLine("Table Dropped (if it existed)");
using (var cmd = conn.CreateCommand()) {
cmd.CommandText = "CREATE TABLE MyTable (Id varchar(36) not null, FirstName varchar(255), LastName varchar(255), PRIMARY KEY (Id));";
cmd.ExecuteNonQuery();
}
Console.WriteLine("Table Created");
using (var cmd = conn.CreateCommand()) {
cmd.CommandText = "INSERT INTO MyTable (Id) VALUES ('80579d98-9010-4610-b12e-ed33ed7d3c62');";
cmd.ExecuteNonQuery();
}
Console.WriteLine("Data Inserted");
using (var cmd = conn.CreateCommand()) {
cmd.CommandText = "SELECT Id FROM MyTable;";
using (var rdr = cmd.ExecuteReader()) {
while (rdr.Read())
Console.WriteLine($"Id = '{rdr["Id"]}'");
}
}
Console.WriteLine("Data Returned");
}
Console.WriteLine("DONE");
}
}
}
Dockerfile
FROM microsoft/dotnet:2.2-runtime AS base
WORKDIR /app
WORKDIR /src
# Install pre-requisites for building and installing Ignite ODBC Driver
RUN apt-get update \
&& apt-get install -y gcc g++ make automake autotools-dev libtool m4 libssl1.0-dev unixodbc-dev unixodbc-bin unzip \
&& apt-get clean -y
# Download and unzip Ignite binary release
#ADD http://apache.mirrors.hoobly.com/ignite/2.7.0/apache-ignite-2.7.0-bin.zip /src/
COPY apache-ignite-2.7.0-bin.zip .
RUN unzip -q /src/apache-ignite-2.7.0-bin.zip \
&& rm /src/apache-ignite-2.7.0-bin.zip
# Build Ignite ODBC Driver
ARG IGNITE_HOME=/src/apache-ignite-2.7.0-bin
WORKDIR /src/apache-ignite-2.7.0-bin/platforms/cpp
RUN libtoolize \
&& aclocal \
&& autoheader \
&& automake --add-missing \
&& autoreconf \
&& ./configure --enable-odbc --disable-core --disable-node \
&& make \
&& make install
# Install Ignite ODBC Driver
RUN apt-get update \
&& apt-get install -y unixodbc \
&& apt-get clean -y \
&& odbcinst -i -d -f /src/apache-ignite-2.7.0-bin/platforms/cpp/odbc/install/ignite-odbc-install.ini
FROM microsoft/dotnet:2.2-sdk AS build
WORKDIR /src
COPY IgniteGarbledDataReproducer/IgniteGarbledDataReproducer.csproj IgniteGarbledDataReproducer/
RUN dotnet restore IgniteGarbledDataReproducer/IgniteGarbledDataReproducer.csproj
COPY . .
WORKDIR /src/IgniteGarbledDataReproducer
RUN dotnet build IgniteGarbledDataReproducer.csproj -c Release -o /app
FROM build AS publish
RUN dotnet publish IgniteGarbledDataReproducer.csproj -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "IgniteGarbledDataReproducer.dll"]
docker-compose.yml
version: '3.4'
services:
ignitegarbleddatareproducer:
image: ${DOCKER_REGISTRY-}ignite-garbled-data-reproducer
build:
context: .
dockerfile: IgniteGarbledDataReproducer/Dockerfile
docker-compose-override.yml
version: '3.4'
services:
ignitegarbleddatareproducer:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- IGNITE_CONNECTION_STRING=DRIVER={Apache Ignite};ADDRESS=my-ignite-3e8b8cb9a4e192af.elb.us-east-1.amazonaws.com:10800;SSL_MODE=disable;
Build
docker build . -t ignitegarbleddatareproducer -f IgniteGarbledDataReproducer/Dockerfile
Execute
PS C:\IgniteGarbledDataReproducer> docker-compose up
Starting ignitegarbleddatareproducer_ignitegarbleddatareproducer_1 ... done
Attaching to ignitegarbleddatareproducer_ignitegarbleddatareproducer_1
ignitegarbleddatareproducer_1 | START
ignitegarbleddatareproducer_1 | DRIVER={Apache Ignite};ADDRESS=my-ignite-3e8b8cb9a4e192af.elb.us-east-1.amazonaws.com:10800;SSL_MODE=disable;
ignitegarbleddatareproducer_1 | Connection Opened
ignitegarbleddatareproducer_1 | DROP TABLE IF EXISTS MyTable;
ignitegarbleddatareproducer_1 | Table Dropped (if it existed)
ignitegarbleddatareproducer_1 | CREATE TABLE MyTable (Id varchar(36) not null, FirstName varchar(255), LastName varchar(255), PRIMARY KEY (Id));
ignitegarbleddatareproducer_1 | Table Created
ignitegarbleddatareproducer_1 | INSERT INTO MyTable (Id) VALUES ('80579d98-9010-4610-b12e-ed33ed7d3c62');
ignitegarbleddatareproducer_1 | Data Inserted
ignitegarbleddatareproducer_1 | SELECT Id FROM MyTable;
ignitegarbleddatareproducer_1 | Id = '8 0 5 7 9 d 9 8 - '
ignitegarbleddatareproducer_1 | Data Returned
ignitegarbleddatareproducer_1 | DONE
ignitegarbleddatareproducer_ignitegarbleddatareproducer_1 exited with code 0
UPDATE 2
I turned on ODBC logging by adding the following to /src/apache-ignite-2.7.0-bin/platforms/cpp/odbc/install/ignite-odbc-install.ini and you can get the logs here.
[ODBC]
Trace=yes
TraceFile=/logs/odbc.log
The end of the log after the SELECT Id From MyTable; statement is below for convenience.
[ODBC][1][1556564832.827181][SQLExecDirectW.c][177]
Entry:
Statement = 0xf27a80
SQL = [SELECT Id FROM MyTable;][length = 23 (SQL_NTS)]
[ODBC][1][1556564832.847882][SQLExecDirectW.c][445]
Exit:[SQL_SUCCESS]
[ODBC][1][1556564832.852889][SQLRowCount.c][173]
Entry:
Statement = 0xf27a80
Row Count = 0x7ffd7da98f00
[ODBC][1][1556564832.856831][SQLRowCount.c][247]
Exit:[SQL_SUCCESS]
Row Count = 0x7ffd7da98f00 -> 0
[ODBC][1][1556564832.860335][SQLNumResultCols.c][156]
Entry:
Statement = 0xf27a80
Column Count = 0x7ffd7da98f50
[ODBC][1][1556564832.864944][SQLNumResultCols.c][251]
Exit:[SQL_SUCCESS]
Count = 0x7ffd7da98f50 -> 1
[ODBC][1][1556564832.869909][SQLFetch.c][162]
Entry:
Statement = 0xf27a80
[ODBC][1][1556564832.884876][SQLFetch.c][351]
Exit:[SQL_SUCCESS]
[ODBC][1][1556564832.894173][SQLColAttributeW.c][156]
Entry:
Statement = 0xf27a80
Column Number = 1
Field Identifier = SQL_DESC_NAME
Character Attr = 0xf2e190
Buffer Length = 4096
String Length = 0x7ffd7da98f20
Numeric Attribute = 0x7ffd7da98ee0
[ODBC][1][1556564832.898409][SQLColAttributeW.c][523]
Exit:[SQL_SUCCESS]
[ODBC][1][1556564832.910800][SQLColAttributeW.c][156]
Entry:
Statement = 0xf27a80
Column Number = 1
Field Identifier = SQL_DESC_CONCISE_TYPE
Character Attr = 0xf2e190
Buffer Length = 4096
String Length = 0x7ffd7da98f40
Numeric Attribute = 0x7ffd7da98f00
[ODBC][1][1556564832.914551][SQLColAttributeW.c][523]
Exit:[SQL_SUCCESS]
[ODBC][1][1556564832.925913][SQLGetData.c][237]
Entry:
Statement = 0xf27a80
Column Number = 1
Target Type = -8 SQL_WCHAR
Buffer Length = 4094
Target Value = 0xf2e190
StrLen Or Ind = 0x7ffd7da98ee0
[ODBC][1][1556564832.929959][SQLGetData.c][534]
Exit:[SQL_SUCCESS]
Buffer = [8](unicode)
Strlen Or Ind = 0x7ffd7da98ee0 -> 36
[ODBC][1][1556564832.934835][SQLFetch.c][162]
Entry:
Statement = 0xf27a80
[ODBC][1][1556564832.938930][SQLFetch.c][351]
Exit:[SQL_NO_DATA]
[ODBC][1][1556564832.943970][SQLMoreResults.c][162]
Entry:
Statement = 0xf27a80
[ODBC][1][1556564832.960311][SQLMoreResults.c][345]
Exit:[SQL_NO_DATA]
[ODBC][1][1556564832.965960][SQLFreeStmt.c][144]
Entry:
Statement = 0xf27a80
Option = 0
[ODBC][1][1556564832.970025][SQLFreeStmt.c][266]
Exit:[SQL_SUCCESS]
[ODBC][1][1556564832.975135][SQLFreeHandle.c][381]
Entry:
Handle Type = 3
Input Handle = 0xf27a80
[ODBC][1][1556564832.981240][SQLFreeHandle.c][494]
Exit:[SQL_SUCCESS]
[ODBC][1][1556564832.991337][SQLDisconnect.c][208]
Entry:
Connection = 0xf0a6f0
[ODBC][1][1556564832.996778][SQLDisconnect.c][379]
Exit:[SQL_SUCCESS]
[ODBC][1][1556564833.001505][SQLFreeHandle.c][284]
Entry:
Handle Type = 2
Input Handle = 0xf0a6f0
[ODBC][1][1556564833.006038][SQLFreeHandle.c][333]
Exit:[SQL_SUCCESS]
UPDATE 3
I have a hunch that it might have something to do with UTF-16 due to a similar question where characters are separated with a \0.
Maybe something to do with the UNICODE setting in this line from the ODBC logs?
[ODBC][1][1556564832.214691][SQLDriverConnectW.c][290]
Entry:
Connection = 0xf0a6f0
Window Hdl = (nil)
Str In = [DRIVER={Apache Ignite};ADDRESS=my-ignite-3e8b8cb9a4e192af.elb.us-east-1.amazonaws.com:10800;SSL_MODE=disable;][length = 115 (SQL_NTS)]
Str Out = (nil)
Str Out Max = 0
Str Out Ptr = 0x7ffd7da98dd0
Completion = 0
UNICODE Using encoding ASCII 'ANSI_X3.4-1968' and UNICODE 'UCS-2LE'
UPDATE 4
I found this document from Microsoft which said
If the ASCII character encoding is not UTF-8, for example:
UNICODE Using encoding ASCII 'ISO8859-1' and UNICODE 'UCS-2LE' There
is more than one Driver Manager installed and your application is
using the wrong one, or the Driver Manager was not built correctly.
I'm assuming my driver isn't built correctly.
And this document said to use --enable-iconv --with-iconv-char-enc=UTF8 --with-iconv-ucode-enc=UTF16LE.
UPDATE 5
I also found this git issue related to .Net Core, unixODBC, and UTF16.
UPDATE 6
I tried adding --enable-iconv --with-iconv-char-enc=UTF8 --with-iconv-ucode-enc=UTF16LE when calling unixODBC's configure, which changed the ODBC connection to UNICODE Using encoding ASCII 'UTF8' and UNICODE 'UTF16LE', but I got the same bad data back regardless. I also tried --with-iconv-ucode-enc=UNICODE, but no change.
This is how I changed my Dockerfile. I removed unixodbc from apt-get and added the following to my Dockerfile
ADD ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.7.tar.gz .
RUN gunzip unixODBC*.tar.gz && tar xvf unixODBC*.tar
WORKDIR /src/unixODBC-2.3.7
RUN ./configure --enable-gui=no --enable-drivers=no --enable-iconv --with-iconv-char-enc=UTF8 --with-iconv-ucode-enc=UTF16LE
RUN make && make install
ENV LD_LIBRARY_PATH="/usr/local/lib"
And this is what the odbc log looks like now:
[ODBC][7][1556723781.839804][SQLDriverConnectW.c][290]
Entry:
Connection = 0x1ddff70
Window Hdl = (nil)
Str In = [DRIVER={Apache Ignite};ADDRESS=my-ignite-3e8b8cb9a4e192af.elb.us-east-1.amazonaws.com:10800;SSL_MODE=disable;][length = 115 (SQL_NTS)]
Str Out = (nil)
Str Out Max = 0
Str Out Ptr = 0x7ffeca3331a0
Completion = 0
UNICODE Using encoding ASCII 'UTF8' and UNICODE 'UTF16LE'
UPDATE 7
I connected via isql and got the correct response, but when I connected via iusql I got the "bad data" from my reproducer.
UPDATE 8
Adding some odbc installation info:
root#4efdb5ed98b5:/app# odbc_config --cflags
-DHAVE_UNISTD_H -DHAVE_PWD_H -DHAVE_SYS_TYPES_H -DHAVE_LONG_LONG -DSIZEOF_LONG_INT=8 -I/usr/local/include
root#4efdb5ed98b5:/app# odbc_config --ulen
-DSIZEOF_SQLULEN=8
root#4efdb5ed98b5:/app# odbcinst -j
unixODBC 2.3.7
DRIVERS............: /usr/local/etc/odbcinst.ini
SYSTEM DATA SOURCES: /usr/local/etc/odbc.ini
FILE DATA SOURCES..: /usr/local/etc/ODBCDataSources
USER DATA SOURCES..: /root/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8
This is a bug with Apache Ignite 2.7.0, so there is no answer. An issue has been filed with Apache Ignite to fix it.
http://issues.apache.org/jira/browse/IGNITE-11845
After 6-7 attempts to compile QT static version i used this article Building_a_static_Qt_for_Windows_using_MinGW
and again errors:
I have installed QT 5.7.
I downloaded
windows-build-qt-static.ps1 then changing the necessary lines
[CmdletBinding()]
param(
$QtSrcUrl = "https://download.qt.io/snapshots/qt/5.8/5.8.0/latest_src/qt-everywhere-opensource-src-5.8.0.7z",
$QtStaticDir = "C:\Qt\Static",
$QtVersion = "5.7",
$MingwDir = "C:\Qt\Tools\mingw530_32\bin\gcc.exe",
[switch]$NoPause = $false
)
and the error is
Windows PowerShell
Copyright (C) 2012 Microsoft Corporation. All rights reserved.
PS C:\Users\Admin> C:\Qt\windows-build-qt-static.ps1
Building static Qt version 5.7
Using MinGW from C:\Qt\Tools\mingw530_32\bin\gcc.exe
Downloading https://download.qt.io/snapshots/qt/5.8/5.8.0/latest_src/qt-everywhere-opensource-src-5.8.0.7z ...
Expanding C:\Qt\Static\src\qt-everywhere-opensource-src-5.8.0.7z ...
7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
Scanning the drive for archives:
1 file, 353390329 bytes (338 MiB)
--
Path = C:\Qt\Static\src\qt-everywhere-opensource-src-5.8.0.7z
Type = 7z
Physical Size = 353390329
Headers Size = 1959904
Method = LZMA2:24
Solid = +
Blocks = 1
Everything is Ok
Folders: 17053
Files: 155016
Size: 1670093035
Compressed: 353390329
Patching C:\Qt\Static\src\qt-everywhere-opensource-src-5.8.0\qtbase\mkspecs\win32-g++\qmake.conf ...
+ cd qtbase
+ C:\Qt\Static\src\qt-everywhere-opensource-src-5.8.0\qtbase\configure.bat -top-level -static -debug-and-release -platfo
rm win32-g++ -prefix C:\Qt\Static\5.7 -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -qt-
sql-sqlite -no-openssl -opensource -confirm-license -make libs -nomake tools -nomake examples -nomake te
sts
Please wait while bootstrapping configure ...
Perl not found in PATH. Aborting.
mingw32-make : The term 'mingw32-make' is not recognized as the name of a cmdlet, function, script file, or operable pr
ogram. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Qt\windows-build-qt-static.ps1:170 char:5
+ mingw32-make -k -j4
+ ~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (mingw32-make:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
mingw32-make : The term 'mingw32-make' is not recognized as the name of a cmdlet, function, script file, or operable pr
ogram. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Qt\windows-build-qt-static.ps1:171 char:5
+ mingw32-make -k install
+ ~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (mingw32-make:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Out-File : Could not find a part of the path 'C:\Qt\Static\5.7\mkspecs\win32-g++\qmake.conf'.
At C:\Qt\windows-build-qt-static.ps1:178 char:6
+ "# | Out-File -Append $File -Encoding Ascii
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (:) [Out-File], DirectoryNotFoundException
+ FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.OutFileCommand
Please wait while bootstrapping configure ...
Perl not found in PATH. Aborting.
mingw32-make : The term 'mingw32-make' is not r .....
Out-File : Could not find a part of the path 'C:\Qt\Static\5.7\mkspecs\win32-g++\qmake.conf'.
At C:\Qt\windows-build-qt-static.ps1:178 char:6
+ "# | Out-File -Append $File -Encoding Ascii
This windows-build-qt-static.ps1 script worked for me a year ago.
Note at line 117, I just removed one * from path C:\Qt\Tools\mingw*\bin\gcc.exe between Qt\ and Tools
#-----------------------------------------------------------------------------
#
# Copyright (c) 2013-2015, Thierry Lelegard
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.
#
#-----------------------------------------------------------------------------
<#
.SYNOPSIS
Build a static version of Qt for Windows.
.DESCRIPTION
This scripts downloads Qt source code, compiles and installs a static version
of Qt. It assumes that a prebuilt Qt / MinGW environment is already installed,
typically in C:\Qt. This prebuilt environment uses shared libraries. It is
supposed to remain the main development environment for Qt. This script adds
a static version of the Qt libraries in order to allow the construction of
standalone and self-sufficient executable.
This script is typically run from the Windows Explorer.
Requirements:
- Windows PowerShell 3.0 or higher.
- 7-zip.
.PARAMETER QtSrcUrl
URL of the Qt source file archive.
By default, use the latest identified version.
.PARAMETER QtStaticDir
Root directory where the static versions of Qt are installed.
By default, use C:\Qt\Static.
.PARAMETER QtVersion
The Qt version. By default, this script tries to extract the version number
from the Qt source file name.
.PARAMETER MingwDir
Root directory of the MinGW prebuilt environment. By default, use the version
which was installed by the prebuilt Qt environment.
.PARAMETER NoPause
Do not wait for the user to press <enter> at end of execution. By default,
execute a "pause" instruction at the end of execution, which is useful
when the script was run from Windows Explorer.
#>
[CmdletBinding()]
param(
$QtSrcUrl = "http://download.qt.io/official_releases/qt/5.5/5.5.1/single/qt-everywhere-opensource-src-5.5.1.7z",
$QtStaticDir = "C:\Qt\Static",
$QtVersion = "",
$MingwDir = "",
[switch]$NoPause = $false
)
# PowerShell execution policy.
Set-StrictMode -Version 3
#-----------------------------------------------------------------------------
# Main code
#-----------------------------------------------------------------------------
function Main
{
# Check that 7zip is installed. We use it to expand the downloaded archive.
[void] (Get-7zip)
# Get Qt source file name from URL.
$QtSrcFileName = Split-Path -Leaf $QtSrcUrl
# If Qt version is not specified on the command line, try to extract the value.
if (-not $QtVersion) {
$QtVersion = $QtSrcFileName -replace "`.[^`.]*$",''
$QtVersion = $QtVersion -replace 'qt-',''
$QtVersion = $QtVersion -replace 'everywhere-',''
$QtVersion = $QtVersion -replace 'opensource-',''
$QtVersion = $QtVersion -replace 'src-',''
$QtVersion = $QtVersion -replace '-src',''
}
Write-Output "Building static Qt version $QtVersion"
# Qt installation directory.
$QtDir = "$QtStaticDir\$QtVersion"
# Get MinGW root directory, if not specified on the command line.
if (-not $MingwDir) {
# Search all instances of gcc.exe from C:\Qt prebuilt environment.
$GccList = #(Get-ChildItem -Path C:\Qt\Tools\mingw*\bin\gcc.exe | ForEach-Object FullName | Sort-Object)
if ($GccList.Length -eq 0) {
Exit-Script "MinGW environment not found, no Qt prebuilt version?"
}
$MingwDir = (Split-Path -Parent (Split-Path -Parent $GccList[$GccList.Length - 1]))
}
Write-Output "Using MinGW from $MingwDir"
# Build the directory tree where the static version of Qt will be installed.
Create-Directory $QtStaticDir\src
Create-Directory $QtDir
# Download the Qt source package if not yet done.
Download-File $QtSrcUrl $QtStaticDir\src\$QtSrcFileName
# Directory of expanded packages.
$QtSrcDir = "$QtStaticDir\src\$((Get-Item $QtStaticDir\src\$QtSrcFileName).BaseName)"
# Expand archives if not yet done
Expand-Archive $QtStaticDir\src\$QtSrcFileName $QtStaticDir\src $QtSrcDir
# Patch Qt's mkspecs for static build.
$File = "$QtSrcDir\qtbase\mkspecs\win32-g++\qmake.conf"
if (-not (Select-String -Quiet -SimpleMatch -CaseSensitive "# [QT-STATIC-PATCH]" $File)) {
Write-Output "Patching $File ..."
Copy-Item $File "$File.orig"
#"
# [QT-STATIC-PATCH]
QMAKE_LFLAGS += -static -static-libgcc
QMAKE_CFLAGS_RELEASE -= -O2
QMAKE_CFLAGS_RELEASE += -Os -momit-leaf-frame-pointer
DEFINES += QT_STATIC_BUILD
"# | Out-File -Append $File -Encoding Ascii
}
# Set a clean path including MinGW.
$env:Path = "$MingwDir\bin;$MingwDir\opt\bin"
# Force English locale to avoid weird effects of tools localization.
$env:LANG = "en"
# Set environment variable QT_INSTALL_PREFIX. Documentation says it should be
# used by configure as prefix but this does not seem to work. So, we will
# also specify -prefix option in configure.
$env:QT_INSTALL_PREFIX = $QtDir
# Configure, compile and install Qt.
Push-Location $QtSrcDir
& $env:SystemRoot\System32\cmd.exe /c "configure.bat -static -debug-and-release -platform win32-g++ -prefix $QtDir `
-qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -qt-sql-sqlite -no-openssl `
-opensource -confirm-license `
-make libs -nomake tools -nomake examples -nomake tests"
mingw32-make -k -j4
mingw32-make -k install
Pop-Location
# Patch Qt's installed mkspecs for static build of application.
$File = "$QtDir\mkspecs\win32-g++\qmake.conf"
#"
CONFIG += static
"# | Out-File -Append $File -Encoding Ascii
Exit-Script
}
#-----------------------------------------------------------------------------
# A function to exit this script. The Message parameter is used on error.
#-----------------------------------------------------------------------------
function Exit-Script ([string]$Message = "")
{
$Code = 0
if ($Message -ne "") {
Write-Output "ERROR: $Message"
$Code = 1
}
if (-not $NoPause) {
pause
}
exit $Code
}
#-----------------------------------------------------------------------------
# Silently create a directory.
#-----------------------------------------------------------------------------
function Create-Directory ([string]$Directory)
{
[void] (New-Item -Path $Directory -ItemType "directory" -Force)
}
#-----------------------------------------------------------------------------
# Download a file if not yet present.
# Warning: If file is present but incomplete, do not download it again.
#-----------------------------------------------------------------------------
function Download-File ([string]$Url, [string]$OutputFile)
{
$FileName = Split-Path $Url -Leaf
if (-not (Test-Path $OutputFile)) {
# Local file not present, start download.
Write-Output "Downloading $Url ..."
try {
$webclient = New-Object System.Net.WebClient
$webclient.DownloadFile($Url, $OutputFile)
}
catch {
# Display exception.
$_
# Delete partial file, if any.
if (Test-Path $OutputFile) {
Remove-Item -Force $OutputFile
}
# Abort
Exit-Script "Error downloading $FileName"
}
# Check that the file is present.
if (-not (Test-Path $OutputFile)) {
Exit-Script "Error downloading $FileName"
}
}
}
#-----------------------------------------------------------------------------
# Get path name of 7zip, abort if not found.
#-----------------------------------------------------------------------------
function Get-7zip
{
$Exe = "C:\Program Files\7-Zip\7z.exe"
if (-not (Test-Path $Exe)) {
$Exe = "C:\Program Files (x86)\7-Zip\7z.exe"
}
if (-not (Test-Path $Exe)) {
Exit-Script "7-zip not found, install it first, see http://www.7-zip.org/"
}
$Exe
}
#-----------------------------------------------------------------------------
# Expand an archive file if not yet done.
#-----------------------------------------------------------------------------
function Expand-Archive ([string]$ZipFile, [string]$OutDir, [string]$CheckFile)
{
# Check presence of expected expanded file or directory.
if (-not (Test-Path $CheckFile)) {
Write-Output "Expanding $ZipFile ..."
& (Get-7zip) x $ZipFile "-o$OutDir" | Select-String -Pattern "^Extracting " -CaseSensitive -NotMatch
if (-not (Test-Path $CheckFile)) {
Exit-Script "Error expanding $ZipFile, $OutDir\$CheckFile not found"
}
}
}
#-----------------------------------------------------------------------------
# Execute main code.
#-----------------------------------------------------------------------------
. Main
I'm using CentOS 7, and Tmux 2.0. I found the windows-status-format shows $PS1:
I checked the tmux manual, it shows:
window_name #W Name of window
I don't understand why it works in RHEL6.6 (in RHEL6.6, tmux 1.6, the tab name shows "bash"), but it shows path in CentOS 7.
And How can I restore the same format?
$ cat /etc/centos-release
CentOS Linux release 7.2.1511 (Core)
$ uname -a
Linux marslojiao.engma.symantec.com 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
My tmux configuration: https://github.com/Marslo/LinuxStuff/blob/master/Configs/HOME/Tmux/.tmux.conf
Thanks in advanced.
-----------First Update------------
My PS1 as blow:
echo "$PS1" | cat -v
\n\[\033[30;1m\]M-bM-^TM-^LM-bM-^TM-^# (\u#\h \[\033[31;1m\]\w\[\033[30;1m\]) ->\nM-bM-^TM-^TM-bM-^TM-^# `if [ $? = 0 ]; then echo \[\e[1\;30m\]\$\[\e[1m\]; else echo \[\e[1\;31m\]\$\[\e[0m\]; fi` \[\033[0m\]
This is the PS1 configuration:
# ┌─ (USERNAME#HOSTNAME PATH) ->
# └─ $
if [ -z "$DISPLAY" ]
then
export PS1="\n\[\033[30;1m\]┌─ (\u#\h \[\033[31;1m\]\w\[\033[30;1m\]) ->\n└─ \`if [ \$? = 0 ]; then echo \[\e[1\;30m\]\\$\[\e[1m\]; else echo \[\e[1\;31m\]\\$\[\e[0m\]; fi\` \[\033[0m\]"
export PS2="\[\033[30;1m\] ->\[\033[30;1m\] \[\033[0m\]"
else
export PS1="\n\[\033[30;1m\]\[\033(0\]l\[\033(B\]\[\033(0\]q\[\033(B\] (\u#\h \[\033[31;1m\]\w\[\033[30;1m\]) ->\n\[\033(0\]m\[\033(B\]\[\033(0\]q\[\033(B\] \`if [ \$? = 0 ]; then echo \[\
e[1\;30m\]\\$\[\e[1m\]; else echo \[\e[1\;31m\]\\$\[\e[0m\]; fi\` \[\033[0m\]"
export PS2="\[\033[30;1m\] ->\[\033(0\]q\[\033(B\] \[\033[0m\]"
fi
Actually, I've disabled the all of my settings to debug the issue. But nothing different.
After asked github:tmux/tmux, set allow-rename to off will prevent show long-long-path in windows-status-format:
set-option -g allow-rename off