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

Danger-swift requers libDanger to be in system directories #3424

Open
msnazarow opened this issue Dec 9, 2024 · 7 comments · Fixed by #3441
Open

Danger-swift requers libDanger to be in system directories #3424

msnazarow opened this issue Dec 9, 2024 · 7 comments · Fixed by #3441
Labels

Comments

@msnazarow
Copy link
Contributor

msnazarow commented Dec 9, 2024

Describe the bug
when danger-swift is installed via Makefile(also via brew, cause brew runs make install PREFIX=/opt/homebrew/Cellar/danger-swift/3.20.2) it copies libDanger into prefix directories(or system if prefix isn't used)
And when it is installed via mise, it copies only danger-swift, and it's not enough

To Reproduce

mise settings experimental=true
mise install danger-swift
git clone https://github.com/msnazarow/DangerMiseCheck
cd DangerMiseCheck
danger-swift local 

Expected behavior

Danger: ⅹ Failing the build, there is 1 fail.
## Failures
Test

Actual behavior

ERROR: Could not find a libDanger to link against at any of: [".build/debug", ".build/x86_64-unknown-linux/debug", ".build/release", "/usr/local/lib/danger", "/opt/homebrew/lib/danger"]

mise doctor output

version: 2024.12.3 macos-arm64 (0e849fc 2024-12-08)
activated: yes
shims_on_path: no

build_info:
  Target: aarch64-apple-darwin
  Features: DEFAULT, NATIVE_TLS, OPENSSL
  Built: Sun, 8 Dec 2024 16:17:41 +0000
  Rust Version: rustc 1.83.0 (90b35a623 2024-11-26)
  Profile: release

shell:
  /bin/zsh
  zsh 5.9 (x86_64-apple-darwin23.0)

dirs:
  cache: ~/Library/Caches/mise
  config: ~/.config/mise
  data: ~/.local/share/mise
  shims: ~/.local/share/mise/shims
  state: ~/.local/state/mise

config_files:
  ~/.config/mise/config.toml

backends:
  aqua
  asdf
  cargo
  core
  gem
  go
  npm
  pipx
  spm
  ubi
  vfox
  
plugins:

toolset:
  asdf:klundberg/asdf-swiftlint@latest  (missing)
  spm:danger/[email protected]

env_vars:
  MISE_SHELL=zsh

settings:
  experimental  true ~/.config/mise/config.toml

No problems found

Additional context
Add any other context about the problem here. Consider running mise with --debug or --trace for extra debug info.

@msnazarow msnazarow added the bug label Dec 9, 2024
@syhol
Copy link
Contributor

syhol commented Dec 9, 2024

Steps to reproduce:

git clone https://github.com/msnazarow/DangerMiseCheckcd DangerMiseCheckgit checkout mastergit checkout danger-checkmise use danger-swift npm:dangerdanger-swift local

I think it's unlikely that mise will copy anything into system prefix directories for you. But the fact its looking in .build/release is a good sign. I wonder if we can copy that into the install directory. I'm not sure what that path is relative to.

The spm backend is still experimental so this sort of problem is expected.

Also @msnazarow your screenshot upload failed, you might want to try again.

@msnazarow
Copy link
Contributor Author

As i did here you can path PREFIX to Makefile like
make install PREFIX="${HOME}/.local/share/mise/installs/danger-swift/"

I added ~/.local/share/mise/installs/danger-swift/(version)/lib this path for search in danger-swift

So first of all, there should be libs somewhere, and that directory should be hardcoded in danger sources

@msnazarow
Copy link
Contributor Author

Screenshot contained lib directory with libDanger and other support swiftmodule files

jdx added a commit that referenced this issue Dec 9, 2024
jdx added a commit that referenced this issue Dec 9, 2024
@jdx jdx closed this as completed in #3441 Dec 9, 2024
jdx added a commit that referenced this issue Dec 9, 2024
@syhol
Copy link
Contributor

syhol commented Dec 10, 2024

I see @msnazarow has added the lib path NSHomeDirectory() + "/.local/share/mise/installs/danger-swift/\(version)/lib/danger" but I don't see that lib path in the installs directory, even after #3441 has been merged. Is there a step missing somewhere?

@msnazarow
Copy link
Contributor Author

msnazarow commented Dec 11, 2024

@jdx mise run swift build --configuration release --product danger-swift, but it builds only danger-swift, not libDanger.dylib

As i mensioned before, you should reference Makefile and install script

@jdx jdx reopened this Dec 11, 2024
@jdx
Copy link
Owner

jdx commented Dec 11, 2024

that would only be a solution for this one tool, the backend should support any spm package

@msnazarow
Copy link
Contributor Author

I think you can just call swift build without --product specification

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.

3 participants