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

Installing executables on Windows only works for .exe #592

Closed
straight-shoota opened this issue Jul 15, 2023 · 0 comments · Fixed by #593
Closed

Installing executables on Windows only works for .exe #592

straight-shoota opened this issue Jul 15, 2023 · 0 comments · Fixed by #593
Labels

Comments

@straight-shoota
Copy link
Member

When shards installs executables, it unconditionally appends .exe to the name specified in shard.yml.
This is a nice feature to ensure the same executable name works on all platforms. But the implementation is very wrong.
It does not allow to install any other kinds of executables, such as shell scripts.

Reproduction (ref: crystal-ameba/ameba#391).

$ cat shard.yml
name: foo
version: 0.1.0

development_dependencies:
  ameba:
    github: straight-shoota/ameba
    commit: 15ce5437d13f47e023778e3be2a78e55759c263b
$ shards install
Resolving dependencies
Fetching https://github.com/straight-shoota/ameba.git
Installing ameba (1.4.3 at 15ce543)
Postinstall of ameba: shards build -Dpreview_mt
Unhandled exception: Error opening file with mode 'r': 'C:\\crystal\\shards\\foo\\lib\\ameba\\bin\\ameba.cr.exe': No such file or directory (File::NotFoundError)
  from C:\Users\johannes\scoop\apps\crystal\current\shards.exe +43309 in '??'
  from C:\Users\johannes\scoop\apps\crystal\current\shards.exe +72883 in '??'
  from C:\Users\johannes\scoop\apps\crystal\current\shards.exe +331539 in '??'
  from C:\Users\johannes\scoop\apps\crystal\current\shards.exe +742269 in '??'
  from C:\Users\johannes\scoop\apps\crystal\current\shards.exe +741894 in '??'
  from C:\Users\johannes\scoop\apps\crystal\current\shards.exe +529299 in '??'
  from C:\Users\johannes\scoop\apps\crystal\current\shards.exe +322587 in '??'
  from C:\Users\johannes\scoop\apps\crystal\current\shards.exe +36666 in '??'
  from C:\Users\johannes\scoop\apps\crystal\current\shards.exe +133225 in '??'
  from C:\Users\johannes\scoop\apps\crystal\current\shards.exe +134533 in '??'
  from C:\Users\johannes\scoop\apps\crystal\current\shards.exe +1290932 in '??'
  from C:\WINDOWS\System32\KERNEL32.DLL +75437 in 'BaseThreadInitThunk'
  from C:\WINDOWS\SYSTEM32\ntdll.dll +371304 in 'RtlUserThreadStart'

There are actually two issues with this:

  • Shards should find and install ameba.cr without appending .exe
  • If an executable does not exist, the error message should be nicer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant