Comments (9)
I finally find a way to build successfully on macOS 11.2.2 with Xcode 12.4.
STEP 1
Run commands as follows in xi-editor/rust
directory:
cargo build --release --target "x86_64-apple-darwin"
xcrun --sdk macosx lipo -create "target/x86_64-apple-darwin/release/xi-core" -output "xi-core"
cargo build --release -p xi-syntect-plugin --target "x86_64-apple-darwin"
xcrun --sdk macosx lipo -create "target/x86_64-apple-darwin/release/xi-syntect-plugin" -output "xi-syntect-plugin"
now we have xi-core
and xi-syntect-plugin
file.
STEP 2
Modify build-rust-xcode.sh
file.
comment following lines at 74 and 75
build_target xi-core ""
build_target xi-syntect-plugin "-p xi-syntect-plugin"
add line after mkdir -p
at line 78
cp "xi-core" "${BUILT_PRODUCTS_DIR}/xi-core"
change line 80 as follows
mv "xi-syntect-plugin" "${BUILT_PRODUCTS_DIR}/plugins/syntect/bin/"
save file.
STEP 3
run command
xcodebuild -scheme XiEditor -configuration Release build
Now we got the build app in derived data folder.
The root cause of failure while building is because the build-rust-xcode.sh is always error.
So instead running it, I run the command mannually in terminal and leave a little command in it to run so will not break the xcode build phases.
from xi-mac.
confirmed not working under latest "Big Sur" + xcode 12.3
from xi-mac.
Now we got the build app in derived data folder.
In case anyone else is unfamiliar with what this means it's in (at least for me) ~/Library/Developer/Xcode/DerivedData/
.
from xi-mac.
from xi-mac.
#494 (comment)
It's not working.
from xi-mac.
@Lyrillind I failed at Step 3 with the following error:
mv: xi-syntect-plugin: No such file or directory
Command ExternalBuildToolExecution failed with a nonzero exit code
** BUILD FAILED **
I'm using macOS 11.2.3 with Xcode 12.4.
This is my build-rust-xcode.sh
after following Step 2:
#!/bin/bash
# When building from Xcode we want to ensure that `cargo` is in PATH.
# as a convenience, add the default cargo install location
export PATH="$PATH:${HOME}/.cargo/bin"
# Users can optionally set cargo path in xi-mac/.env
if [[ -f "${SRCROOT}/.env" ]]; then
source "${SRCROOT}/.env"
if ! [[ -z "$CARGO_PATH" ]]; then
export PATH="$CARGO_PATH:$PATH"
else
echo "warning: ${SRCROOT}/.env file found, but CARGO_PATH not set."
fi
fi
if ! [[ -x "$(command -v cargo)" ]]; then
echo 'error: Unable to find cargo command. If cargo is not installed visit rustup.rs, otherwise set CARGO_PATH in xi-mac/.env' >&2
exit 127
fi
set -e
function build_target () {
TARGET_NAME="$1"
CARGO_PROJECT_FLAG="$2"
cd "${SRCROOT}/xi-editor/rust"
if [[ ${ACTION:-build} = "build" ]]; then
if [[ $PLATFORM_NAME = "" ]]; then
# default for building with xcodebuild
PLATFORM_NAME="macosx"
fi
if [[ $PLATFORM_NAME = "macosx" ]]; then
RUST_TARGET_OS="darwin"
else
RUST_TARGET_OS="ios"
fi
for ARCH in $ARCHS
do
if [[ $(lipo -info "${BUILT_PRODUCTS_DIR}/${TARGET_NAME}" 2>&1) != *"${ARCH}"* ]]; then
rm -f "${BUILT_PRODUCTS_DIR}/${TARGET_NAME}"
fi
done
if [[ $CONFIGURATION = "Debug" ]]; then
RUST_CONFIGURATION="debug"
RUST_CONFIGURATION_FLAG=""
else
RUST_CONFIGURATION="release"
RUST_CONFIGURATION_FLAG="--release"
fi
EXECUTABLES=()
for ARCH in $ARCHS
do
RUST_ARCH=$ARCH
if [[ $RUST_ARCH = "arm64" ]]; then
RUST_ARCH="aarch64"
fi
cargo build $RUST_CONFIGURATION_FLAG $CARGO_PROJECT_FLAG --target "${RUST_ARCH}-apple-${RUST_TARGET_OS}"
EXECUTABLES+=("target/${RUST_ARCH}-apple-${RUST_TARGET_OS}/${RUST_CONFIGURATION}/${TARGET_NAME}")
done
mkdir -p "${BUILT_PRODUCTS_DIR}"
xcrun --sdk $PLATFORM_NAME lipo -create "${EXECUTABLES[@]}" -output "${BUILT_PRODUCTS_DIR}/${TARGET_NAME}"
elif [[ $ACTION = "clean" ]]; then
cargo clean
rm -f "${BUILT_PRODUCTS_DIR}/${TARGET_NAME}"
fi
}
# build_target xi-core ""
# build_target xi-syntect-plugin "-p xi-syntect-plugin"
# move syntect plugin into plugins dir
mkdir -p "${BUILT_PRODUCTS_DIR}/plugins/syntect/bin"
mv "xi-syntect-plugin" "${BUILT_PRODUCTS_DIR}/plugins/syntect/bin/"
cp "${SRCROOT}/xi-editor/rust/syntect-plugin/manifest.toml" "${BUILT_PRODUCTS_DIR}/plugins/syntect/"
# workaround for https://github.com/travis-ci/travis-ci/issues/6522
set +e
from xi-mac.
- check the xi-core and xi-syntect-plugin file after STEP 1.
- missing
cp "xi-core" "${BUILT_PRODUCTS_DIR}/xi-core"
in sh file described in STEP 2
from xi-mac.
run open XiEditor.xcodeproj
, and use the Product > Build
option on the top menu or just command + B
this work for me, macOS 11.2.3; Xcode 12.5.1
from xi-mac.
run
open XiEditor.xcodeproj
, and use theProduct > Build
option on the top menu or justcommand + B
this work for me, macOS 11.2.3; Xcode 12.5.1
Thanks, that worked for me (had to reinstall arm64 Rust on M1).
from xi-mac.
Related Issues (20)
- autosave triggers HOT 11
- Xcode colorscheme HOT 3
- xi --wait does not return after application exit HOT 1
- update to swift 5 HOT 9
- Doesn't compile for Swift 5 HOT 13
- Change default find highlight color HOT 2
- package ID specification `xi-syntect-plugin` matched no packages
- build-rust-xcode.sh fails with Permission denied (os error 13) HOT 6
- Status Bar hiding last line HOT 3
- Scroll bars disappearing when switching from different application HOT 3
- Drag events cause file to be opened HOT 1
- Wrong top margin with statusbar -- first visible line is not rendered
- Crash when deleting (backspace) selection HOT 2
- Line numbers become bogus when scrolling HOT 1
- xcodebuild error (Xcode 11.3.1) HOT 14
- (Save) Dialog Overshoots Window in Splitwindow mode (macOS Catalina)
- Where is built .app? HOT 1
- No text is displayed at all
- xcodebuild fails on Mac Version OS 12 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xi-mac.