Compare commits

..

24 Commits

Author SHA1 Message Date
Dom Rodriguez
fabeb618a9 Remove Debug build agents for Mac CI jobs
This addresses @p12tic's feedback regarding CI CPU time.

Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2021-11-06 17:52:49 +00:00
Dom Rodriguez
20f0583c18 As per @p12tic's feedback on PR #1385, revert previous log message
@p12tic felt that we should have the log message at the end of the build
script to assist log inspections

Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2021-11-06 17:52:49 +00:00
Dom Rodriguez
0ac60d34e9 Remove Release type condition for artifact publishing (Mac)
This commit removes the 'Release' `B_BUILD_TYPE` condition for the Mac
builder, and instead just keeps the condition of the image ONLY to be
built by the Big Sur build agent.

Now, the reason for that condition is because I am future proofing the
CI configuration for when we ship M1 builds. Currently, we do not. The
other reason, but also more pressing, is to avoid multiple artifacts
being published. There *is* a possibility the Big Sur build agent
becomes incompatible with older macOS releases, but the CMake
configuration would seem to suggest there's backwards compatibility
being available.

Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2021-11-06 17:52:49 +00:00
Dom Rodriguez
275f19461d Revert artifact name to original name (Mac)
Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2021-11-06 17:52:49 +00:00
Dom Rodriguez
af99862143 Revert Mac build job name to original name
Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2021-11-06 17:52:49 +00:00
Dom Rodriguez
bafd58387f Simplify sourcing of environment overriding script
Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2021-11-06 17:52:49 +00:00
Dom Rodriguez
c61e98169c Remove obvious comments
Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2021-11-06 17:52:49 +00:00
Dom Rodriguez
09863ead1b Remove redundant exit command
Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2021-11-06 17:52:49 +00:00
Dom Rodriguez
c05efd2393 Remove experimental Rust code - what?
I was working on experimental Rust code to see if it'd be possible to glue C++ and Rust together, and didn't stash it. When I did `git add`, it added the Rust code, and ... yeah, whoops.

Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2021-11-06 17:52:49 +00:00
Dom Rodriguez
db90a85aa4 Remove file existence check for Mac environment variables
Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2021-11-06 17:52:48 +00:00
Dom Rodriguez
08128f9a07 Remove Universal Binary reference in Mac Release build
Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2021-11-06 17:52:48 +00:00
Dom Rodriguez
8ee832263b Revert back to previous building behaviour on *nix/Mac systems
This is based on the feedback from @p12tic, and I also think it might
lead to a regression on systems that don't have the correct version of CMake,
and/or a Make implementation that doesn't support "-C".

Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2021-11-06 17:52:48 +00:00
Dom Rodriguez
ac1148a8b8 Remove noisy commented-out code in CMakeLists.txt
Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2021-11-06 17:52:48 +00:00
Dom Rodriguez
21de971a94 Simplify build directory clean up
Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2021-11-06 17:52:48 +00:00
Dom Rodriguez
16b2f93bf5 Remove check for macos_environment.sh - no need for it
We can just do a one-liner here, if it fails, the script fails, and it
should do that. Also renamed macOS_environment to all lower-case (and snake_case).

Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2021-11-06 17:52:48 +00:00
Dom Rodriguez
cb754b6799 Simplify B_CMAKE_FLAGS, and declare before further configuration
Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2021-11-06 17:52:48 +00:00
Dom Rodriguez
4308e91214 Remove redundant comments and output as per @p12tic's feedback
Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2021-11-06 17:52:48 +00:00
Dom Rodriguez
61898a6509 Renamed Mac env script as per @p12tic's feedback
Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2021-11-06 17:52:48 +00:00
Dom Rodriguez
5d50eec10d Disable arm64 & x86_64 Mac builds - Qt causes build failures
Related to #1395.

Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2021-11-06 17:52:47 +00:00
Dom Rodriguez
2e0f54822e Simplify CI jobs, and merge DMG generation into one job
This commit merges the macOSRelease job into one unified Mac build job.

Using Azure Pipelines conditionals (AND), we check for the build type being an release, and the build agent being Big Sur.

Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2021-11-06 17:52:47 +00:00
Dom Rodriguez
f1c5405873 Modify CI configuration - Mac matrix dual builds
This commit changes the CI configuration to dual-build Release and Debug types
for the Mac build agents - Mojave, Catalina and Big Sur. This ensures for a double check on each build type during testing.

Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2021-11-06 17:52:47 +00:00
Dom Rodriguez
55dac2333d Remove CMAKE_OSX_ARCHITECTURES env variable, wrong place
Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2021-11-06 17:52:47 +00:00
Dom Rodriguez
464949b402 Adjust CMakeLists to compile for M1 and x86
Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2021-11-06 17:52:47 +00:00
Dom Rodriguez
f5c759a910 Refactoring of CI configurations and build scripts
Now, CI builds for macOS involve three separate builds for a range of macOS versions, and a final Universal macOS Binary made on Big Sur. It should work with the M1 chip and x86_64 Intel Macs.

I have also renamed osx_environment->macOS_environment.sh to reflect the new name change of Apple's desktop OS.

In terms of the clean_builds.sh script, this has also been refactored to be more resilient, and efficient (marginally).

Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2021-11-06 17:52:47 +00:00
15 changed files with 45 additions and 68 deletions

View File

@@ -86,7 +86,7 @@ specific packages.
**Q: Does drag and drop work on linux?**
> A: No *(see [#855](https://github.com/debauchee/barrier/issues/855) if you'd like to change that)*
> A: No *(see [#855](https://github.com/debauchee/barrier/issues/544) if you'd like to change that)*
**Q: What OSes are supported?**

View File

@@ -80,7 +80,7 @@ jobs:
displayName: Clean Build
- job: MacBuild
displayName: Mac Build
displayName: macOS builds
strategy:
matrix:
big-sur-Release:
@@ -110,8 +110,8 @@ jobs:
- script: sh -x ./clean_build.sh
displayName: Clean Build
- task: PublishBuildArtifacts@1
displayName: Publish Release DMG
condition: eq(variables['B_BUILD_TYPE'], 'Release')
displayName: Publish Release DMG if on Big Sur agent
condition: eq(variables['imageName'], 'macOS-11')
inputs:
pathtoPublish: build/bundle
artifactName: Mac Release Disk Image and App $(imageName)
artifactName: Mac Release DMG and App $(imageName)

View File

@@ -1,32 +1,47 @@
#!/bin/sh
cd "$(dirname "$0")" || exit 1
# some environments have cmake v2 as 'cmake' and v3 as 'cmake3'
# check for cmake3 first then fallback to just cmake
B_CMAKE=`type cmake3 2>/dev/null`
if [ $? -eq 0 ]; then
B_CMAKE=`echo "$B_CMAKE" | cut -d' ' -f3`
B_CMAKE=$(command -v cmake3 2>/dev/null)
if [ "$?" -eq 0 ]; then
continue
else
B_CMAKE=cmake
if command -v cmake 2>/dev/null; then
B_CMAKE=$(command -v cmake)
else
echo "ERROR: CMake not in $PATH, cannot build! Please install CMake, or if this persists, file a bug report."
exit 1
fi
fi
# default build configuration
B_BUILD_TYPE=${B_BUILD_TYPE:-Debug}
B_BUILD_TYPE="${B_BUILD_TYPE:-Debug}"
B_CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=${B_BUILD_TYPE} ${B_CMAKE_FLAGS:-}"
if [ "$(uname)" = "Darwin" ]; then
# OSX needs a lot of extra help, poor thing
# run the osx_environment.sh script to fix paths
. ./osx_environment.sh
B_CMAKE_FLAGS="-DCMAKE_OSX_SYSROOT=$(xcode-select --print-path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 $B_CMAKE_FLAGS"
# macOS needs a little help, so we source this environment script to fix paths.
. ./macos_environment.sh
B_CMAKE_FLAGS="${B_CMAKE_FLAGS} -DCMAKE_OSX_SYSROOT=$(xcode-select --print-path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9"
fi
# allow local customizations to build environment
[ -r ./build_env.sh ] && . ./build_env.sh
# Source local build variables to the environment, if available.
# If not, continue as normal, and silently.
[ -e "./build_env.sh" ] && . "./build_env.sh"
# Initialise Git submodules
git submodule update --init --recursive
B_CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=$B_BUILD_TYPE $B_CMAKE_FLAGS"
rm -rf build
mkdir build || exit 1
cd build || exit 1
echo "Starting Barrier $B_BUILD_TYPE build..."
$B_CMAKE $B_CMAKE_FLAGS .. || exit 1
make || exit 1
rm -rf ./build
mkdir build
cd ./build
$B_CMAKE "$B_CMAKE_FLAGS" .. || exit 1
echo "INFO: Now commencing Barrier build process..."
echo "INFO: We're building an $B_BUILD_TYPE output type."
$(command -v make) || exit 1
echo "Build completed successfully"

View File

@@ -0,0 +1 @@
Refactor CI builds, and build scripts to be more resilient, and effective

View File

@@ -1 +0,0 @@
Fixed FAQ link to Linux drag and drop issue.

View File

@@ -1 +0,0 @@
Fixed a regression in 2.4.0 that caused Barrier to not support scaling other than 100% (https://github.com/debauchee/barrier/issues/1462).

View File

@@ -21,9 +21,7 @@ set(sources
if (WIN32)
file(GLOB arch_headers "MSWindows*.h")
file(GLOB arch_sources "MSWindows*.cpp")
list(APPEND sources
barrierc.rc
barrierc.exe.manifest)
list(APPEND sources barrierc.rc)
elseif (APPLE)
file(GLOB arch_headers "OSX*.h")
file(GLOB arch_sources "OSX*.cpp")

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
</requestedPrivileges>
</security>
</trustInfo>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitor</dpiAwareness>
</windowsSettings>
</application>
</assembly>

View File

@@ -21,9 +21,7 @@ set(sources
if (WIN32)
file(GLOB arch_headers "MSWindows*.h")
file(GLOB arch_sources "MSWindows*.cpp")
list(APPEND sources
barriers.rc
barriers.exe.manifest)
list(APPEND sources barriers.rc)
elseif (APPLE)
file(GLOB arch_headers "OSX*.h")
file(GLOB arch_sources "OSX*.cpp")

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
</requestedPrivileges>
</security>
</trustInfo>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitor</dpiAwareness>
</windowsSettings>
</application>
</assembly>

View File

@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>

View File

@@ -98,7 +98,7 @@ FileChunk::assemble(barrier::IStream* stream, String& dataReceived, size_t& expe
case kDataChunk:
dataReceived.append(content);
if (CLOG->getFilter() >= kDEBUG2) {
LOG((CLOG_DEBUG2 "recv file chunk size=%i", content.size()));
LOG((CLOG_DEBUG2 "recv file chunck size=%i", content.size()));
double interval = stopwatch.getTime();
receivedDataSize += content.size();
LOG((CLOG_DEBUG2 "recv file interval=%f s", interval));

View File

@@ -190,7 +190,7 @@ void generate_pem_self_signed_cert(const std::string& path)
X509_sign(cert, private_key, EVP_sha256());
auto fp = fopen_utf8_path(path.c_str(), "w");
auto fp = fopen_utf8_path(path.c_str(), "r");
if (!fp) {
throw std::runtime_error("Could not open certificate output path");
}

View File

@@ -324,7 +324,7 @@ XWindowsScreen::leave()
m_impl->XGetInputFocus(m_display, &m_lastFocus, &m_lastFocusRevert);
// take focus
if (!m_preserveFocus) {
if (m_isPrimary || !m_preserveFocus) {
m_impl->XSetInputFocus(m_display, m_window, RevertToPointerRoot, CurrentTime);
}