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

Build the compiler with PCRE2 #13084

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions .github/workflows/aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Build Crystal
uses: docker://jhass/crystal:1.0.0-alpine-build
with:
args: make crystal
args: make crystal PCRE1=true
- name: Upload Crystal executable
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
- name: Build Crystal
uses: docker://jhass/crystal:1.0.0-build
with:
args: make crystal
args: make crystal PCRE1=true
- name: Upload Crystal executable
uses: actions/upload-artifact@v3
with:
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,18 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
crystal_bootstrap_version: [1.2.2, 1.3.2, 1.4.1, 1.5.1, 1.6.2, 1.7.2]
crystal_bootstrap_version: [1.2.2, 1.3.2, 1.4.1, 1.5.1, 1.6.2]
env: ["PCRE1=true"]
include:
# libffi is only available starting from the 1.2.2 build images
- crystal_bootstrap_version: 1.0.0
flags: -Dwithout_ffi
env: PCRE1=true
- crystal_bootstrap_version: 1.1.1
flags: -Dwithout_ffi
env: PCRE1=true
- crystal_bootstrap_version: 1.7.2
env: ""
steps:
- name: Download Crystal source
uses: actions/checkout@v3
Expand All @@ -33,7 +38,7 @@ jobs:
run: bin/ci prepare_build

- name: Test
run: FLAGS=${{ matrix.flags }} bin/ci build
run: FLAGS=${{ matrix.flags }} ${{ matrix.env}} bin/ci build
straight-shoota marked this conversation as resolved.
Show resolved Hide resolved

x86_64-musl-test:
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
make deps
- name: Cross-compile Crystal
run: |
LLVM_TARGETS=X86 bin/crystal build --cross-compile --target x86_64-pc-windows-msvc src/compiler/crystal.cr -Dwithout_playground -Dwithout_iconv -Dwithout_interpreter -Duse_pcre
LLVM_TARGETS=X86 bin/crystal build --cross-compile --target x86_64-pc-windows-msvc src/compiler/crystal.cr -Dwithout_playground -Dwithout_iconv -Dwithout_interpreter -Duse_pcre2

- name: Upload Crystal object file
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -333,7 +333,7 @@ jobs:
run: make -f Makefile.win deps
- name: Link Crystal executable
run: |
Invoke-Expression "cl crystal.obj /Fecrystal src\llvm\ext\llvm_ext.obj $(llvm\bin\llvm-config.exe --libs) libs\pcre.lib libs\gc.lib WS2_32.lib advapi32.lib libcmt.lib dbghelp.lib ole32.lib shell32.lib legacy_stdio_definitions.lib /link /LIBPATH:$(pwd)\libs /STACK:0x800000 /ENTRY:wmainCRTStartup"
Invoke-Expression "cl crystal.obj /Fecrystal src\llvm\ext\llvm_ext.obj $(llvm\bin\llvm-config.exe --libs) libs\pcre2-8.lib libs\gc.lib WS2_32.lib advapi32.lib libcmt.lib dbghelp.lib ole32.lib shell32.lib legacy_stdio_definitions.lib /link /LIBPATH:$(pwd)\libs /STACK:0x800000 /ENTRY:wmainCRTStartup"
mkdir .build
mv crystal.exe .build/

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ $(O)/primitives_spec: $(O)/crystal $(DEPS) $(SOURCES) $(SPEC_SOURCES)
$(O)/crystal: $(DEPS) $(SOURCES)
$(call check_llvm_config)
@mkdir -p $(O)
$(EXPORTS) $(EXPORTS_BUILD) ./bin/crystal build $(FLAGS) -o $@ src/compiler/crystal.cr -D without_openssl -D without_zlib -D use_pcre
$(EXPORTS) $(EXPORTS_BUILD) ./bin/crystal build $(FLAGS) -o $@ src/compiler/crystal.cr -D without_openssl -D without_zlib $(if $(PCRE1),-D use_pcre,-D use_pcre2)

$(LLVM_EXT_OBJ): $(LLVM_EXT_DIR)/llvm_ext.cc
$(call check_llvm_config)
Expand Down
2 changes: 1 addition & 1 deletion Makefile.win
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ $(O)\crystal.exe: $(DEPS) $(SOURCES) $(O)\crystal.res
@$(call MKDIR,"$(O)")
$(call export_vars)
$(call export_build_vars)
.\bin\crystal build $(FLAGS) -o "$(O)\crystal-next.exe" src\compiler\crystal.cr -D without_openssl -D without_zlib -D without_playground -D use_pcre --link-flags=/PDBALTPATH:crystal.pdb "--link-flags=$(realpath $(O)\crystal.res)"
.\bin\crystal build $(FLAGS) -o "$(O)\crystal-next.exe" src\compiler\crystal.cr -D without_openssl -D without_zlib -D without_playground $(if $(PCRE1),-D use_pcre,-D use_pcre2) --link-flags=/PDBALTPATH:crystal.pdb "--link-flags=$(realpath $(O)\crystal.res)"
$(call MV,"$(O)\crystal-next.exe","$@")
$(call MV,"$(O)\crystal-next.pdb","$(O)\crystal.pdb")

Expand Down
1 change: 1 addition & 0 deletions bin/ci
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ with_build_env() {
-w /mnt \
-e CRYSTAL_CACHE_DIR="/tmp/crystal" \
-e SPEC_SPLIT_DOTS \
-e PCRE1 \
"$DOCKER_TEST_IMAGE" \
"$ARCH_CMD" /bin/sh -c "'$command'"

Expand Down
2 changes: 1 addition & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ let
};

stdLibDeps = with pkgs; [
boehmgc gmp libevent libiconv libxml2 libyaml openssl pcre zlib
boehmgc gmp libevent libiconv libxml2 libyaml openssl pcre2 zlib
] ++ lib.optionals stdenv.isDarwin [ libiconv ];

tools = [ pkgs.hostname pkgs.git llvm_suite.extra ];
Expand Down