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

Support .exe file extension in Makefile on MSYS2 #15123

Merged

Conversation

HertzDevil
Copy link
Contributor

.build/crystal already adds the .exe file extension in Makefile when run on MSYS2. This PR does the same to the spec executables so that running make std_spec twice will only build the executable once.

@HertzDevil HertzDevil added kind:feature topic:infrastructure kind:specs platform:windows-gnu Windows support based on the MinGW-w64 toolchain + MSYS2 labels Oct 24, 2024
@straight-shoota straight-shoota added this to the 1.15.0 milestone Oct 24, 2024
@straight-shoota straight-shoota merged commit 0987812 into crystal-lang:master Oct 25, 2024
68 checks passed
@HertzDevil HertzDevil deleted the feature/makefile-exe branch October 25, 2024 16:07
@straight-shoota
Copy link
Member

straight-shoota commented Oct 28, 2024

This patch broke the Makefile due to an unrelated error. But this failure also showed that replacing $(CRYSTAL_BIN) with $(CRYSTAL)$(EXE) was wrong. CRYSTAL describes the base compiler, not the output path.

Fix is in #15123

straight-shoota added a commit that referenced this pull request Oct 28, 2024
#15123 broke the Makefile (and in turn CI: https://app.circleci.com/pipelines/github/crystal-lang/crystal/16310/workflows/f2194e36-a31e-4df1-87ab-64fa2ced45e2/jobs/86740)

Since this commit, `"$(O)/$(CRYSTAL)$(EXE)"` in the `install` recpie resolves to the path `.build/crystal ` which doesn't exist. It looks like `$(EXE)` resolves to a single whitespace, but the error is actually in the definition of `CRYSTAL` which contains a trailing whitespace.
This is only an issue in the `install` recipe because it's the only place where we put the path in quotes. So it would be simple to fix this by removing the quotes.

The introduction of `$(EXE)` replaced `$(CRYSTAL_BIN)` with `$(CRYSTAL)$(EXE)`. But this is wrong. `CRYSTAL` describes the base compiler, not the output path.

This patch partially reverts #15123 and reintroduces `$(CRYSTAL_BIN)`, but it's now based on `$(EXE)`.
CTC97 pushed a commit to CTC97/crystal that referenced this pull request Nov 9, 2024
)

`.build/crystal` already adds the `.exe` file extension in `Makefile` when run on MSYS2. This PR does the same to the spec executables so that running `make std_spec` twice will only build the executable once.
CTC97 pushed a commit to CTC97/crystal that referenced this pull request Nov 9, 2024
…15131)

crystal-lang#15123 broke the Makefile (and in turn CI: https://app.circleci.com/pipelines/github/crystal-lang/crystal/16310/workflows/f2194e36-a31e-4df1-87ab-64fa2ced45e2/jobs/86740)

Since this commit, `"$(O)/$(CRYSTAL)$(EXE)"` in the `install` recpie resolves to the path `.build/crystal ` which doesn't exist. It looks like `$(EXE)` resolves to a single whitespace, but the error is actually in the definition of `CRYSTAL` which contains a trailing whitespace.
This is only an issue in the `install` recipe because it's the only place where we put the path in quotes. So it would be simple to fix this by removing the quotes.

The introduction of `$(EXE)` replaced `$(CRYSTAL_BIN)` with `$(CRYSTAL)$(EXE)`. But this is wrong. `CRYSTAL` describes the base compiler, not the output path.

This patch partially reverts crystal-lang#15123 and reintroduces `$(CRYSTAL_BIN)`, but it's now based on `$(EXE)`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:feature kind:specs platform:windows-gnu Windows support based on the MinGW-w64 toolchain + MSYS2 topic:infrastructure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants