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

Implement fs searching in rust #5481

Merged
merged 55 commits into from
Jan 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
ea04d3d
Implement fs searching in rust
devongovett Dec 15, 2020
5b1a6e5
Fixes and improvements
devongovett Dec 15, 2020
eedba9b
Fix bug
devongovett Dec 15, 2020
a5fb932
Resolve package.json#source when in monorepo
devongovett Dec 15, 2020
bc91c03
Fix more tests
devongovett Dec 16, 2020
dd5015d
Fix flow
devongovett Dec 16, 2020
170938a
lint
devongovett Dec 16, 2020
d1c1f9e
Add type argument for windows symlinks
devongovett Dec 16, 2020
cbd3fc3
Try a junction?
devongovett Dec 16, 2020
30a2066
Cargo is confused by junctions
devongovett Dec 16, 2020
1adaeaa
Attempt custom build script
devongovett Dec 19, 2020
476ea25
Run with shell
devongovett Dec 19, 2020
7a58790
Debug release action
devongovett Dec 19, 2020
6267137
Link native
devongovett Dec 19, 2020
8f4dc5c
Fix copying artifacts
devongovett Dec 19, 2020
a9203e4
Attempt to build on linux musl
devongovett Dec 19, 2020
951efbb
Fix
devongovett Dec 19, 2020
7739aa5
Use token
devongovett Dec 19, 2020
506de2f
url?
devongovett Dec 19, 2020
f7968df
Load correct build
devongovett Dec 19, 2020
9a22f31
Add apple silicon build
devongovett Dec 19, 2020
b64f9ff
Use nightly toolchain
devongovett Dec 19, 2020
1d451a4
Use --target param
devongovett Dec 19, 2020
f999e58
Fix
devongovett Dec 19, 2020
dd648e7
linux arm
devongovett Dec 20, 2020
2bf1499
Fix
devongovett Dec 20, 2020
015fac5
Install cross-compilation toolchains
devongovett Dec 20, 2020
1714de3
Add linker config for arm
devongovett Dec 20, 2020
dd6219a
Test running arm binaries using emulator
devongovett Dec 20, 2020
b668361
Fix
devongovett Dec 20, 2020
dac67d8
Fix
devongovett Dec 20, 2020
07bd252
Fix
devongovett Dec 20, 2020
db7b9b8
Use prebuilt docker images
devongovett Dec 20, 2020
6a8fa7d
login?
devongovett Dec 20, 2020
528c453
oops
devongovett Dec 20, 2020
27131ad
wip
devongovett Dec 20, 2020
0fb6d82
???
devongovett Dec 20, 2020
a1ebe76
musl cross compiler
devongovett Dec 20, 2020
444b6aa
wip
devongovett Dec 20, 2020
007e2d5
dfpoidjfdpofj
devongovett Dec 20, 2020
34e768a
wtf
devongovett Dec 20, 2020
5840122
one last try
devongovett Dec 20, 2020
7263851
copy lib?
devongovett Dec 20, 2020
94e1032
dpofjdpojf
devongovett Dec 20, 2020
240b89f
everything
devongovett Dec 20, 2020
b9f03d9
Drop armv7
devongovett Dec 20, 2020
c922393
Update nightly release and restore tag release workflow
devongovett Dec 20, 2020
3ce9e41
Cleanup
devongovett Dec 20, 2020
a0b3eb8
Merge branch 'v2' into fs-search
devongovett Dec 20, 2020
2e585b9
Merge branch 'v2' into fs-search
DeMoorJasper Dec 29, 2020
1a9910d
Merge branch 'v2' into fs-search
DeMoorJasper Dec 31, 2020
c2ff251
Cleanup
devongovett Jan 1, 2021
a9f8a8e
🤦‍♂️
devongovett Jan 1, 2021
16ed008
prettier
devongovett Jan 1, 2021
4035983
Resolve realpath in default resolver (#5508)
devongovett Jan 2, 2021
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
154 changes: 154 additions & 0 deletions .github/workflows/nightly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,166 @@ on:
schedule:
- cron: '0 0 * * *'
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Link native packages
run: node scripts/link-native.js
- uses: bahmutov/[email protected]
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: bindings-${{ matrix.os }}
path: native-packages/*/*.node
- name: Smoke test
run: node -e "require('@parcel/fs-search')"

build-linux-gnu-arm:
strategy:
fail-fast: false
matrix:
include:
- target: arm-unknown-linux-gnueabihf
arch: armhf
- target: aarch64-unknown-linux-gnu
arch: arm64
name: ${{ matrix.target }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
target: ${{ matrix.target }}
- name: Install cross compile toolchains
run: |
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu g++-aarch64-linux-gnu -y
- name: Link native packages
run: node scripts/link-native.js
- uses: bahmutov/[email protected]
env:
RUST_TARGET: ${{ matrix.target }}
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: bindings-${{ matrix.target }}
path: native-packages/*/*.node
- name: debug
run: ls -l native-packages/*/*.node
- name: Configure binfmt-support
run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
- name: Smoke test
uses: addnab/docker-run-action@v1
with:
image: ghcr.io/devongovett/multiarch-node:node14-${{ matrix.arch }}-focal
options: -v ${{github.workspace}}:/work
run: cd /work && node -e "require('@parcel/fs-search')"

build-linux-musl:
strategy:
fail-fast: false
matrix:
target: [x86_64-unknown-linux-musl, aarch64-unknown-linux-musl]
name: ${{ matrix.target }}
runs-on: ubuntu-latest
container:
image: docker.pkg.github.com/napi-rs/napi-rs/rust-nodejs-alpine:lts
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN }}
steps:
- uses: actions/checkout@v1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
target: ${{ matrix.target }}
- name: Install cross compile toolchains
if: ${{ matrix.target == 'aarch64-unknown-linux-musl' }}
run: |
curl -O https://musl.cc/aarch64-linux-musl-cross.tgz
tar xzf aarch64-linux-musl-cross.tgz
cp -R aarch64-linux-musl-cross/* /usr
- name: Link native packages
run: node scripts/link-native.js
- uses: bahmutov/[email protected]
env:
RUST_TARGET: ${{ matrix.target }}
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: bindings-linux-musl
path: native-packages/*/*.node
- name: debug
run: ls -l native-packages/*/*.node
- name: Smoke test
if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }}
run: node -e 'require("@parcel/fs-search")'

build-apple-silicon:
name: aarch64-apple-darwin
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true
target: aarch64-apple-darwin
- name: Link native packages
run: node scripts/link-native.js
- uses: bahmutov/[email protected]
env:
RUST_TARGET: aarch64-apple-darwin
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: bindings-apple-aarch64
path: native-packages/*/*.node
- name: debug
run: ls -l native-packages/*/*.node

build-and-release:
runs-on: ubuntu-latest
name: Build and release nightly
needs:
- build
- build-linux-musl
- build-linux-gnu-arm
- build-apple-silicon
steps:
- uses: actions/checkout@v1
- name: Link native packages
run: node scripts/link-native.js
- uses: bahmutov/[email protected]
- name: Download artifacts
uses: actions/download-artifact@v2
with:
path: artifacts
- name: Move artifacts
run: for d in artifacts/*/*; do cp $d/*.node native-packages/$(basename $d); done
- name: Debug
run: ls -l native-packages/*/*
- run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
154 changes: 154 additions & 0 deletions .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,166 @@ on:
release:
types: [published]
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Link native packages
run: node scripts/link-native.js
- uses: bahmutov/[email protected]
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: bindings-${{ matrix.os }}
path: native-packages/*/*.node
- name: Smoke test
run: node -e "require('@parcel/fs-search')"

build-linux-gnu-arm:
strategy:
fail-fast: false
matrix:
include:
- target: arm-unknown-linux-gnueabihf
arch: armhf
- target: aarch64-unknown-linux-gnu
arch: arm64
name: ${{ matrix.target }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
target: ${{ matrix.target }}
- name: Install cross compile toolchains
run: |
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu g++-aarch64-linux-gnu -y
- name: Link native packages
run: node scripts/link-native.js
- uses: bahmutov/[email protected]
env:
RUST_TARGET: ${{ matrix.target }}
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: bindings-${{ matrix.target }}
path: native-packages/*/*.node
- name: debug
run: ls -l native-packages/*/*.node
- name: Configure binfmt-support
run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
- name: Smoke test
uses: addnab/docker-run-action@v1
with:
image: ghcr.io/devongovett/multiarch-node:node14-${{ matrix.arch }}-focal
options: -v ${{github.workspace}}:/work
run: cd /work && node -e "require('@parcel/fs-search')"

build-linux-musl:
strategy:
fail-fast: false
matrix:
target: [x86_64-unknown-linux-musl, aarch64-unknown-linux-musl]
name: ${{ matrix.target }}
runs-on: ubuntu-latest
container:
image: docker.pkg.github.com/napi-rs/napi-rs/rust-nodejs-alpine:lts
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN }}
steps:
- uses: actions/checkout@v1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
target: ${{ matrix.target }}
- name: Install cross compile toolchains
if: ${{ matrix.target == 'aarch64-unknown-linux-musl' }}
run: |
curl -O https://musl.cc/aarch64-linux-musl-cross.tgz
tar xzf aarch64-linux-musl-cross.tgz
cp -R aarch64-linux-musl-cross/* /usr
- name: Link native packages
run: node scripts/link-native.js
- uses: bahmutov/[email protected]
env:
RUST_TARGET: ${{ matrix.target }}
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: bindings-linux-musl
path: native-packages/*/*.node
- name: debug
run: ls -l native-packages/*/*.node
- name: Smoke test
if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }}
run: node -e 'require("@parcel/fs-search")'

build-apple-silicon:
name: aarch64-apple-darwin
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true
target: aarch64-apple-darwin
- name: Link native packages
run: node scripts/link-native.js
- uses: bahmutov/[email protected]
env:
RUST_TARGET: aarch64-apple-darwin
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: bindings-apple-aarch64
path: native-packages/*/*.node
- name: debug
run: ls -l native-packages/*/*.node

build-and-release:
runs-on: ubuntu-latest
name: Build and release the tagged version
needs:
- build
- build-linux-musl
- build-linux-gnu-arm
- build-apple-silicon
steps:
- uses: actions/checkout@v1
- name: Link native packages
run: node scripts/link-native.js
- uses: bahmutov/[email protected]
- name: Download artifacts
uses: actions/download-artifact@v2
with:
path: artifacts
- name: Move artifacts
run: for d in artifacts/*/*; do cp $d/*.node native-packages/$(basename $d); done
- name: Debug
run: ls -l native-packages/*/*
- run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ tmp
parcel-bundle-reports/
.verdaccio_storage/
sourcemap-info.json
packages/native-packages
3 changes: 3 additions & 0 deletions azure-pipelines-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ jobs:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p;
displayName: Bump max inotify watches

- script: node scripts/link-native.js
displayName: 'Link native dependencies'

# use `--frozen-lockfile` to fail immediately if the committed yarn.lock needs updates
# https://yarnpkg.com/lang/en/docs/cli/install/#toc-yarn-install-frozen-lockfile
- script: yarn --frozen-lockfile
Expand Down
11 changes: 11 additions & 0 deletions native-packages/fs-search/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[target.arm-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"

[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"

[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"

[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-musl-gcc"
2 changes: 2 additions & 0 deletions native-packages/fs-search/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target
*.node
Loading