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

ObjFW support #117

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
56 changes: 54 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
# Faster compilation and error on warnings
RUSTFLAGS: "-C debuginfo=0 -D warnings"
RUSTDOCFLAGS: "-D warnings"
# RUSTFLAGS: "-C debuginfo=0 -D warnings"
# RUSTDOCFLAGS: "-D warnings"
CARGO_TERM_VERBOSE: true
FEATURES: malloc,block,exception,catch_all,verify_message
UNSTABLE_FEATURES: unstable_autoreleasesafe
Expand All @@ -34,6 +34,7 @@ jobs:

test:
name: ${{ matrix.name }}
if: false # Temporarily disabled

strategy:
fail-fast: false
Expand Down Expand Up @@ -366,3 +367,54 @@ jobs:
' objc2/Cargo.toml
cargo dinghy --device=$SIM_ID test
cargo dinghy --device=$SIM_ID test --release

test_objfw:
name: Test ObjFW

env:
RUN_TESTS:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install Clang
run: |
sudo apt-get update
sudo apt-get -y install clang
clang --version

- name: Set up ObjFW
run: |
wget https://objfw.nil.im/downloads/objfw-0.90.2.tar.gz
tar -xzf objfw-0.90.2.tar.gz
cd objfw-0.90.2

# Remove -Werror, since it breaks the build
sed -i -e '/OBJCFLAGS="$OBJCFLAGS -Werror"/d' configure.ac
sed -i -e 's/-Wpointer-arith -Werror/-Wpointer-arith/g' configure.ac

autoreconf
./configure --prefix=$HOME/objfw
make
make install

echo "PATH=$HOME/objfw/bin:$PATH" >> $GITHUB_ENV
echo "LIBRARY_PATH=$HOME/objfw/lib:$LIBRARY_PATH" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$HOME/objfw/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "CPATH=$HOME/objfw/include:$CPATH" >> $GITHUB_ENV
ls -al $HOME/objfw/*
ls -al $HOME/objfw/include/ObjFW
ls -al $HOME/objfw/include/ObjFW-RT

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true

- name: Test
# Everything except objc2-foundation
run: cargo test --no-fail-fast -p objc-sys -p objc2-encode -p objc2 -p block-sys -p block2 -p tests --features objfw
1 change: 0 additions & 1 deletion block-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ fn main() {
cc_args.push_str(" -I");
cc_args.push_str(compat_headers.to_str().unwrap());
println!("cargo:rustc-link-lib=dylib=objfw");
unimplemented!("ObjFW is not yet supported")
}
// Checked in if-let above
(false, false, false, false) => unreachable!(),
Expand Down
6 changes: 1 addition & 5 deletions objc-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,7 @@ fn main() {
GNUStep(1, 7)
}
}
(false, false, true) => {
// For now
unimplemented!("ObjFW is not yet supported")
// ObjFW(None)
}
(false, false, true) => ObjFW(None),
(false, false, false) => {
// Choose sensible defaults when generating docs
if std::env::var("DOCS_RS").is_ok() {
Expand Down
3 changes: 2 additions & 1 deletion objc2/src/message/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ mod verify;
#[cfg(apple)]
#[path = "apple/mod.rs"]
mod platform;
#[cfg(gnustep)]
// TODO: This is _not_ correct, struct return works differently!
#[cfg(any(gnustep, objfw))]
#[path = "gnustep.rs"]
mod platform;

Expand Down