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

[ new ] Support for dumping a package's install location #3381

Merged
merged 7 commits into from
Sep 14, 2024

Conversation

mattpolzin
Copy link
Collaborator

Description

Historically I have hard coded assumptions about where Idris will install a package when idris2 --install is called. This works, but it's fragile, inconvenient, and far from obvious.

See, for example, this snippet from one of my C support library Makefiles:

PACKAGE_INSTALLDIR = `${IDRIS} --libdir`
INSTALLDIR = ${PACKAGE_INSTALLDIR}/ncurses-idris-${TARGET_VERSION}/lib

This PR introduces idris2 --dump-installdir which could make the above Makefile snippet much more reasonable:

DESTDIR = `${IDRIS} --dump-installdir --find-ipkg`
INSTALLDIR = ${DESTDIR}/lib

While I was adding --dump-installdir anyway, I also used it in the existing Nix buildIdris function to better support a "Pack-ism" where C support libraries are installed to the ./lib folder and Pack takes care of the rest. Now buildIdris also takes care of the rest.

Should this change go in the CHANGELOG?

  • If this is a fix, user-facing change, a compiler change, or a new paper
    implementation, I have updated CHANGELOG_NEXT.md (and potentially also
    CONTRIBUTORS.md).

@gallais
Copy link
Member

gallais commented Sep 11, 2024

Can we get a test of this command-line option so that we are forced to think about any changes affecting the printed string?

@mattpolzin
Copy link
Collaborator Author

Yeah, that’s a good call. I’ll add a test later today.

@mattpolzin mattpolzin changed the title [New] Support for dumping a package's install location [ new ] Support for dumping a package's install location Sep 11, 2024
@mattpolzin mattpolzin merged commit 09cb83d into idris-lang:main Sep 14, 2024
22 checks passed
@mattpolzin mattpolzin deleted the more-robust-c-lib-nix-support branch September 14, 2024 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants