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

--bindir is ignored without warning or suggestion that --installdir should be used #8520

Closed
mgajda opened this issue Oct 9, 2022 · 14 comments · Fixed by #8556
Closed

--bindir is ignored without warning or suggestion that --installdir should be used #8520

mgajda opened this issue Oct 9, 2022 · 14 comments · Fixed by #8556

Comments

@mgajda
Copy link

mgajda commented Oct 9, 2022

Describe the bug

Using v1-install option --bindir results in no warning, but is silently ignored.
The option is displayed in cabal new-install --help, but redundant with --installdir

To Reproduce

Steps to reproduce the behavior:

$ cabal v2-install --bindir ./output

The resulting binary will not be copied to ./output, nor warning will be issued.

Expected behavior

Since --bindir is accepted, it should be duplicate of --installdir or removed.

System information

  • cabal version 3.4.1.0
  • ghc version -- irrelevant

*** Related ***

Similar problem as with #7437.

@mouse07410
Copy link
Collaborator

I confirm this problem.

@ffaf1 ffaf1 added attention: pr-welcome re: v1-install Issue demonstrating the current indispensability of `v1-install` cabal-install: cmd/install and removed re: v1-install Issue demonstrating the current indispensability of `v1-install` labels Oct 9, 2022
@gbaz
Copy link
Collaborator

gbaz commented Oct 31, 2022

This should be resolved by #8556 which removes all installdirs options from new-install (but leaves them for build, etc)

@Mikolaj
Copy link
Member

Mikolaj commented Dec 15, 2022

@mgajda and @mouse07410, could you kindly verify with the cabal version on master branch?

@Mikolaj Could you please point me at the artifact (exact location or URL would be fine) that I'd download and experiment with?

@Mikolaj
Copy link
Member

Mikolaj commented Dec 19, 2022

@mouse07410: hah, you've edited my comment.

Any artifact from a merged PR should do. E.g., at the very bottom of

https://github.com/haskell/cabal/actions/runs/3716873166

Let me know if that's not enough.

@mouse07410
Copy link
Collaborator

@mouse07410: hah, you've edited my comment.

Hmm, did not realize...

Any artifact from a merged PR should do. E.g., at the very bottom of

https://github.com/haskell/cabal/actions/runs/3716873166

Perhaps I'm being dense, and fighting some weird respiratory virus doesn't make me any sharper :-( . But I saw no artifacts there.

Let me know if that's not enough.

I'm afraid it isn't. If somewhere within those runs is a snippet that places linked cabal binary to somewhere where I can reach it with, e.g., wget or curl - I did not see it.

So, I'd love something like (URL is definitely incorrect, and crafted merely to show what I'm trying to request):
https://github.com/haskell/cabal/actions/runs/3716873166/jobs/123456678/bin/cabal
It would be nice if the job is for macOS and uses GHC-9.0.2, 9.2.5, or 9.4.3.

Otherwise, I'm viewing a ton of validation output, but no artifacts...

@ulysses4ever
Copy link
Collaborator

@mouse07410 unfortunately, you can't get a direct download link for GitHub artifacts (see actions/upload-artifact#27), and you have to use a web browser to retrieve them. Try again that page, and just Cmd+F (search) for the word Artifact: second occurrence of it should lead you to the links.

Direct link would be possible if we organized nightly pre-releases, as it was suggested in #8541. If you feel energy, feel free to work on it: it's a simple update of the CI with a huge dev experience improvement.

@mouse07410
Copy link
Collaborator

mouse07410 commented Dec 20, 2022

unfortunately, you can't get a direct download link for GitHub artifacts (see actions/upload-artifact#27), and you have to use a web browser to retrieve them

That is fine. My problem is - there doesn't seem to be any artifact on that page.

Try again that page, and just Cmd+F (search) for the word Artifact: second occurrence of it should lead you to the links.

Either we're talking about different pages, or I've no clue whatsoever. Search for "Artifact" found zero entries.

That page only contains logs of "Validate XXX" jobs, "Dogfooding XXX" jobs, and "Validate post job". Trying to dig into any of those logs gives me the standard CI log "Set up job, Run actions/checkput@v3, ..." etc. I don't see any artifact (nor Artifact) anywhere there.

Besides the above, I picked the "Validate for macOS GHC-9.0.2" job
https://github.com/haskell/cabal/actions/runs/3716873166/jobs/6303690863 and tried to "guess" where the artifacts might be: https://github.com/haskell/cabal/actions/runs/3716873166/jobs/6303690863/artifacts

No joy.

This https://github.com/haskell/cabal/actions/artifacts also returns HTTP 404.

And before you ask, this https://github.com/haskell/cabal/actions/artifacts/3716873166/zip also fails with 404.

Trying https://api.github.com/repos/haskell/cabal/actions/artifacts/3716873166/zip gets me

{
  "message": "You must have the actions scope to download artifacts.",
  "documentation_url": "https://docs.github.com/rest/reference/actions#download-an-artifact"
}

My guess is - there are no artifacts on that page. As the proverb goes - "it's hard to search for a black cat in a dark room. Especially if it isn't there".

Would love to show screenshots, but stupid GitHub does not allow uploading them anymore either.

Direct link would be possible if we organized nightly pre-releases, as it was suggested in #8541.

I don't have a lot of time on my hands, especially now - but I'll take a look. In fact, I'm very surprised it hasn't been done yet.

Update

Turns out, there is an extremely convoluted way to get an "artifact". Contrary to expectations, the majority of the validation jobs did not leave one. However, I did find one for macOS, built with GHC-9.2.3. More later.

@Mikolaj
Copy link
Member

Mikolaj commented Dec 20, 2022

I'm really surprised. Your browser must be broken somehow, particularly the C-f functionality (you did use it, right? not the "Search" input field of github?). But scrolling the whole page with a scrollbar on the right (not scrolling any sub-pane only) of the original link I posted

https://github.com/haskell/cabal/actions/runs/3716873166

should really show a short "Artifacts" section at the end. If it doesn't, perhaps fire a Linux VM and try again.

@mouse07410
Copy link
Collaborator

mouse07410 commented Dec 20, 2022

Your browser must be broken somehow, particularly the C-f functionality (you did use it, right? not the "Search" input field of github?)

Considering that my browser works with everything else (so far), I rather doubt it's broken. Yes, I used Cmd-F (the only way to do a search on the page?).

should really show a short "Artifacts" section at the end

Damn it! I found it in your newly-provided page by scrolling to the very end the right column.

So, this page https://github.com/haskell/cabal/actions/runs/3716873166/ has it.
That page (original URL given) https://github.com/haskell/cabal/actions/runs/3716873166/jobs/6303690863 does not (the wrong one has "jobs/6303690863" suffix).
Update I've no idea where that ".../jobs/..." URL came from, and why my browser got to it.

Now, to business. Downloaded artifact is installed on my system as cabal-dev.

$ cabal-dev install --bindir /tmp/output
Warning: this is a debug build of cabal-install with assertions enabled.
Wrote tarball sdist to
/Users/ur20980/src/stepic-tests/dist-newstyle/sdist/stepic-tests-0.1.0.0.tar.gz
Resolving dependencies...
Build profile: -w ghc-9.4.3 -O2
In order, the following will be built (use -v for more details):
 - stepic-tests-0.1.0.0 (lib) (requires build)
Assertion failed
CallStack (from HasCallStack):
  assert, called at src/Distribution/Client/ProjectPlanning.hs:248:5 in cabal-install-3.9.0.0-inplace:Distribution.Client.ProjectPlanning
$ 

With the released cabal 3.8.1.0:

$ cabal install --bindir /tmp/output
Wrote tarball sdist to
/Users/ur20980/src/stepic-tests/dist-newstyle/sdist/stepic-tests-0.1.0.0.tar.gz
Resolving dependencies...
Build profile: -w ghc-9.4.3 -O1
In order, the following will be built (use -v for more details):
 - stepic-tests-0.1.0.0 (lib) (requires build)
 - stepic-tests-0.1.0.0 (exe:maybe-demo) (requires build)
 - stepic-tests-0.1.0.0 (exe:qroots) (requires build)
 - stepic-tests-0.1.0.0 (exe:stepic-tests-exe) (requires build)
Starting     stepic-tests-0.1.0.0 (lib)
Building     stepic-tests-0.1.0.0 (lib)
Haddock      stepic-tests-0.1.0.0 (lib)
Installing   stepic-tests-0.1.0.0 (lib)
Completed    stepic-tests-0.1.0.0 (lib)
Starting     stepic-tests-0.1.0.0 (exe:maybe-demo)
Starting     stepic-tests-0.1.0.0 (exe:qroots)
Starting     stepic-tests-0.1.0.0 (exe:stepic-tests-exe)
Building     stepic-tests-0.1.0.0 (exe:maybe-demo)
Building     stepic-tests-0.1.0.0 (exe:qroots)
Building     stepic-tests-0.1.0.0 (exe:stepic-tests-exe)
Installing   stepic-tests-0.1.0.0 (exe:maybe-demo)
Installing   stepic-tests-0.1.0.0 (exe:qroots)
Completed    stepic-tests-0.1.0.0 (exe:maybe-demo)
Completed    stepic-tests-0.1.0.0 (exe:qroots)
Installing   stepic-tests-0.1.0.0 (exe:stepic-tests-exe)
Completed    stepic-tests-0.1.0.0 (exe:stepic-tests-exe)
Symlinking 'stepic-tests-exe' to '/Users/ur20980/.cabal/bin/stepic-tests-exe'
Symlinking 'qroots' to '/Users/ur20980/.cabal/bin/qroots'
Symlinking 'maybe-demo' to '/Users/ur20980/.cabal/bin/maybe-demo'
$ ll /tmp/output
total 0
drwxr-xr-x   2 ur20980  wheel    64 Dec 20 10:01 ./
drwxrwxrwt  33 root     wheel  1056 Dec 20 10:01 ../
$ type qroots
qroots is /Users/ur20980/.cabal/bin/qroots
$ 

Ignored --bindir, installed into $HOME/.cabal/bin, didn't say a word about it.

@Mikolaj
Copy link
Member

Mikolaj commented Dec 21, 2022

@mouse07410: I've started a gitlab run for you with the latest master branch and without assertions (that's how gitlab is configured):

https://gitlab.haskell.org/haskell/cabal/-/pipelines

The ProjectPlanning assertion failure is a known old embarrassing bug with a ticket or a few. I hope it only manifests with assertions on.

I hope your respiratory virus gets evicted soon. :)

@Mikolaj
Copy link
Member

Mikolaj commented Dec 21, 2022

I see #8556 is still not merged, so if the above doesn't work, I will try to build #8556 on gitlab so that it doesn't have assertions.

@mouse07410
Copy link
Collaborator

mouse07410 commented Dec 21, 2022

@Mikolaj thank you - downloaded a working artifact from GitLab.

It still fails in exactly the same way: silently installs into $HOME/.cabal/bin/.

$ cabal-dev install --bindir=/tmp/output/
Wrote tarball sdist to
/Users/ur20980/src/stepic-tests/dist-newstyle/sdist/stepic-tests-0.1.0.0.tar.gz
Resolving dependencies...
Symlinking 'stepic-tests-exe' to '/Users/ur20980/.cabal/bin/stepic-tests-exe'
Error: cabal-dev: Path '/Users/ur20980/.cabal/bin/stepic-tests-exe' already
exists. Use --overwrite-policy=always to overwrite.

$ 

Update: verbose log
cabal-9.log.txt

@gbaz
Copy link
Collaborator

gbaz commented Dec 24, 2022

I tested on that branch and got the following?

cabal install --bindir=/tmp/output
Warning: this is a debug build of cabal-install with assertions enabled.
Error: cabal: unrecognized 'install' option `--bindir=/tmp/output'

@Mikolaj
Copy link
Member

Mikolaj commented Dec 24, 2022

Amazing. Thank you, @gbaz. In that case I think we can put it to rest until #8556 is merged.

Afterwards, volunteer to update https://cabal.readthedocs.io/en/latest would be welcome.

@mergify mergify bot closed this as completed in #8556 Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants