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

Update tup to handle new variant syntax #30

Open
ppannuto opened this issue May 5, 2021 · 0 comments
Open

Update tup to handle new variant syntax #30

ppannuto opened this issue May 5, 2021 · 0 comments

Comments

@ppannuto
Copy link
Member

ppannuto commented May 5, 2021

Nothing that needs doing presently, but at some point will have to deal with this so noting this mailing list message here:

Hi all,

A while back (2015!) the explicit-variant branch was published to test moving away from the model of variants using the FUSE filesystem overlay, to one where your Tupfiles need to be aware of variants in order to use them. Although it requires a bit more work to use variants in your project, it has several benefits:

1) Explicit variants work on Windows (https://github.com/gittup/tup/issues/70 and https://github.com/gittup/tup/issues/334)

2) Paths stored in generated files with overlay variants can break external tools (eg: https://github.com/gittup/tup/issues/229). With explicit variants, tup isn't lying to other tools about paths.

The main downside is that your Tupfiles may need to be updated to be aware of variants. With overlay variants, this was mostly transparent (outside of !tup_preserve), but with explicit variants, you may need to point things to the build directory, which is referenced by $(TUP_VARIANTDIR).

For example, generating a header file and including it in a C file like so:

: |> echo '#define FOO 3' > %o |> foo.h
: foreach *.c | foo.h |> gcc -c %f -o %o |> %B.o

would need to be updated to add -I$(TUP_VARIANTDIR) in order for gcc to find the generated header file:

: |> echo '#define FOO 3' > %o |> foo.h
: foreach *.c | foo.h |> gcc -I$(TUP_VARIANTDIR) -c %f -o %o |> %B.o

With explicit variants, the subprocess runs in the src directory, and %o is a relative path pointing to the build directory (something like ../build/src/foo.o)

I have an updated explicit-variant2 branch available: https://github.com/gittup/tup/tree/explicit-variant2
With a Windows test binary: http://gittup.org/tup/win32/tup-explicit-variant-v0.7.10-52-g6b2c469e.zip

I'm planning to merge this in 2 weeks time. If you use variants in your project, any testing you could do before then would be appreciated. If you have difficulty figuring out how to update your Tupfiles, feel free to contact either the mailing list or me privately.

Since this is a breaking change, I will make one more v0.7.X release prior to merging. After the merge, the next release will be v0.8

Thanks for your patience!
-Mike
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

No branches or pull requests

1 participant