-
Notifications
You must be signed in to change notification settings - Fork 20
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
Allow custom build directory #221
Conversation
@lagru Ready for testing. |
63c35e5
to
d8eac75
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @stefanv! I played around with it locally and came up with a few limitations. Would be good to iterate further on the API and behavior. :)
spin/cmds/meson.py
Outdated
This feature is useful in combination with a shell alias, e.g.: | ||
|
||
$ alias spin-clang="spin -C build-clang" | ||
|
||
Which can then be used to build (`spin-clang build`), to test (`spin-clang test ...`), etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name build-clang
might be a bit misleading. To me it implies that this feature can somehow be used to choose a different compiler (clang). As I understand it, you'd need to update the underlying "build" command / configuration which would then apply regardless of build directory? Or am I missing something?
spin/cmds/meson.py
Outdated
|
||
This feature is useful in combination with a shell alias, e.g.: | ||
|
||
$ alias spin-clang="spin -C build-clang" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spin -C ${SOME_DIR} command
seems to fail. I think this is because the option is added ad subcommand level. So this alias won't work currently. I think the option would need to be added to the top-level spin
command and then passed down via the context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, may have to rethink that. We don't have global context in spin.
@lagru Please take another look; the build directory can now be absolute, and can be set using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Absolute, relative and nested-relative paths seem to work perfectly now. I'm not familiar with the code base so take my approval with a grain of salt. ;)
Nice! I was just about to suggest this feature. I just gave it a quick er... spin and it seems to work exactly as I wanted. One suggestion though: When you run meson setup build-release -Dbuildtype=release
spin -C build-release run ... Then the |
@oscarbenjamin What you request sounds very reasonable, but it's already the way my setup behaves: $ spin build -C build-xyz && ls -al build-xyz/.gitignore
-rw-r--r--. 1 stefan stefan 92 Sep 2 21:05 build-xyz/.gitignore I see the same behavior when adding the |
I've just checked again and confirm that the $ spin build -C build-foo -- --pkg-config-path=.local/lib/pkgconfig -Dadd_flint_rpath=true
...
$ git status
On branch pr_nmod_ctx
Your branch is up-to-date with 'origin/pr_nmod_ctx'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
build-abc-install/
build-foo-install/
build-xyz-install/
nothing added to commit but untracked files present (use "git add" to track) Is it meson that adds it in the I didn't expect that |
Closes #171
-C
flag to meson commands