Skip to content

Commit

Permalink
fix(spider)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhheider committed Jan 30, 2025
1 parent 2c55a63 commit 680f5e3
Showing 1 changed file with 42 additions and 7 deletions.
49 changes: 42 additions & 7 deletions projects/crates.io/spider_cli/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,52 @@ versions:

build:
dependencies:
rust-lang.org: '>=1.56'
rust-lang.org: '>=1.81'
rust-lang.org/cargo: '*'
script:
# needs openssl 3 on linux, but our rust locks us to 1.1.1
- run: sed -f $PROP -i Cargo.toml
working-directory: spider_cli
- run: source <(pkgx +openssl^3)
if: linux
# -shared and -pie don't mix
- run:
- cp $PROP cc-wrapper
- chmod +x cc-wrapper
prop: |
/^serde_json =/a\
openssl-sys = { version = "*", features = ["vendored"] }
#!/bin/bash
# Capture all arguments into an array
ARGS=("$@")
# Check if the '-shared' flag is present in the arguments
if printf "%s\n" "${ARGS[@]}" | grep -q -e '-shared'; then
# Use a loop to filter out the '-pie' flag from the arguments
FILTERED_ARGS=()
for arg in "${ARGS[@]}"; do
if [ "$arg" != "-pie" ]; then
FILTERED_ARGS+=("$arg")
fi
done
# Pass the filtered arguments to clang
exec clang "${FILTERED_ARGS[@]}"
else
# Pass the original arguments to clang
exec clang "${ARGS[@]}"
fi
working-directory: $HOME/.local/bin
if: linux/x86-64
- cargo install --locked --path spider_cli --root {{prefix}} --features smart
skip: fix-patchelf # dumps on x86-64
env:
linux:
# since we are tricking _ourselves_ into using openssl 3, we need to
# link it statically.
OPENSSL_STATIC: 1
OPENSSL_DIR: ${{pkgx.prefix}}/openssl.org/v3/
OPENSSL_NO_VENDOR: 1
linux/x86-64:
RUSTFLAGS: -Crelocation-model=pic -Clink-arg=-Wl,-pie -Clink-arg=-fPIC
PATH: $HOME/.local/bin:$PATH
CC: cc-wrapper
LD: cc-wrapper

test: spider -v --url https://choosealicense.com crawl
test: spider -v --url https://choosealicense.com scrape

0 comments on commit 680f5e3

Please sign in to comment.