celenity/Phoenix
8
198
Fork
You've already forked Phoenix
18

nix: set PHOENIX_* of build tools to bins in nix-store #337

Merged
celenity merged 1 commit from :fix-nix into dev 2026年07月11日 10:35:40 +02:00
Contributor
Copy link

Setting environment variables of tools used during build to lead to the
binaries in nix-store.
This way, we can remove some checks for PHOENIX_NIX in the build
scripts.
Skipping uv for now, as I don't think we will use it on nix. Just as we
didn't use pyenv.

Setting environment variables of tools used during build to lead to the binaries in nix-store. This way, we can remove some checks for PHOENIX_NIX in the build scripts. Skipping uv for now, as I don't think we will use it on nix. Just as we didn't use pyenv.
Author
Contributor
Copy link

If you don't mind it would be great to backport this to the pages branch as well, so the new release for nix users isn't broken until the next one lands. (Same for dove)

If you don't mind it would be great to backport this to the `pages` branch as well, so the new release for nix users isn't broken until the next one lands. (Same for dove)
First-time contributor
Copy link

actually closes #335 i guess...

this seems like the proper fix for nix, why not also set all the other PHOENIX_* tools this way?
does /bin/date (PHOENIX_DATE) work?

_actually_ closes https://codeberg.org/celenity/Phoenix/issues/335 i guess... this seems like the proper fix for nix, why not also set all the [other PHOENIX_* tools](https://codeberg.org/celenity/Phoenix/src/commit/9ebbbec97fdf043550fe9ad139e3637a5004e63e/scripts/env_common.sh#L140-197) this way? does `/bin/date` (`PHOENIX_DATE`) [work](https://codeberg.org/celenity/Phoenix/src/commit/9ebbbec97fdf043550fe9ad139e3637a5004e63e/scripts/fly.sh#L102-L103)?
Author
Contributor
Copy link

@degausser wrote in #337 (comment):

this seems like the proper fix for nix, why not also set all the other PHOENIX_* tools this way? does /bin/date (PHOENIX_DATE) work?

You are right, we should probably do that. E.g. to not break the nix build when another default changes. I will take a look and add them.

@degausser wrote in https://codeberg.org/celenity/Phoenix/pulls/337#issuecomment-18966380: > this seems like the proper fix for nix, why not also set all the [other PHOENIX_* tools](https://codeberg.org/celenity/Phoenix/src/commit/9ebbbec97fdf043550fe9ad139e3637a5004e63e/scripts/env_common.sh#L140-197) this way? does `/bin/date` (`PHOENIX_DATE`) [work](https://codeberg.org/celenity/Phoenix/src/commit/9ebbbec97fdf043550fe9ad139e3637a5004e63e/scripts/fly.sh#L102-L103)? You are right, we should probably do that. E.g. to not break the nix build when another default changes. I will take a look and add them.

@ddogfoodd wrote in #337 (comment):

@degausser wrote in #337 (comment):

this seems like the proper fix for nix, why not also set all the other PHOENIX_* tools this way? does /bin/date (PHOENIX_DATE) work?

You are right, we should probably do that. E.g. to not break the nix build when another default changes. I will take a look and add them.

Yeah, I agree this would be ideal - so do you think we should wait to merge this until we update those other defaults as well, or should I go ahead and merge this now? (And yeah don't worry, I'll backport this fix to pages).

PS - Thanks for the PR here!

@ddogfoodd wrote in https://codeberg.org/celenity/Phoenix/pulls/337#issuecomment-18994016: > @degausser wrote in #337 (comment): > > > this seems like the proper fix for nix, why not also set all the [other PHOENIX_* tools](https://codeberg.org/celenity/Phoenix/src/commit/9ebbbec97fdf043550fe9ad139e3637a5004e63e/scripts/env_common.sh#L140-197) this way? does `/bin/date` (`PHOENIX_DATE`) [work](https://codeberg.org/celenity/Phoenix/src/commit/9ebbbec97fdf043550fe9ad139e3637a5004e63e/scripts/fly.sh#L102-L103)? > > You are right, we should probably do that. E.g. to not break the nix build when another default changes. I will take a look and add them. Yeah, I agree this would be ideal - so do you think we should wait to merge this until we update those other defaults as well, or should I go ahead and merge this now? *(And yeah don't worry, I'll backport this fix to `pages`)*. PS - Thanks for the PR here!
ddogfoodd changed title from (削除) nix: set PHOENIX_TAR to gnutar bin in nix-store (削除ここまで) to nix: set PHOENIX_* of build tools to bins in nix-store 2026年07月11日 09:16:16 +02:00
Author
Contributor
Copy link

@celenity wrote in #337 (comment):

Yeah, I agree this would be ideal - so do you think we should wait to merge this until we update those other defaults as well, or should I go ahead and merge this now? (And yeah don't worry, I'll backport this fix to pages).

Just pushed and tested. Feel free to merge. Will do Dove later.

@celenity wrote in https://codeberg.org/celenity/Phoenix/pulls/337#issuecomment-18995654: > Yeah, I agree this would be ideal - so do you think we should wait to merge this until we update those other defaults as well, or should I go ahead and merge this now? _(And yeah don't worry, I'll backport this fix to `pages`)_. Just pushed and tested. Feel free to merge. Will do Dove later.
celenity requested changes 2026年07月11日 09:26:01 +02:00
Dismissed
nix/package.nix Outdated
@ -5,1 +5,4 @@
coreutils, # to provide `date`
gnused,
gnutar,
zip,
Owner
Copy link

Also wondering if we still need zip here? I assume this was added because we used to create ZIP archives for all build outputs (regardless of platform), but nowadays we only create ZIP archives for Windows builds - OS X and Linux should always be creating/using tar.xz archives instead.

Also wondering if we still need `zip` here? I assume this was added because we used to create ZIP archives for all build outputs *(regardless of platform)*, but nowadays we only create ZIP archives for Windows builds - OS X and Linux should always be creating/using `tar.xz` archives instead.
ddogfoodd marked this conversation as resolved
nix/package.nix Outdated
@ -5,1 +7,4 @@
gnutar,
zip,
python3,
s3cmd,
Owner
Copy link

Do we really need to include s3cmd here? It's only used for pushing releases to S3 storage (ex. for CI) - it shouldn't be necessary/used at all for building Phoenix directly.

Do we really need to include `s3cmd` here? It's only used for pushing releases to S3 storage *(ex. for CI)* - it shouldn't be necessary/used at all for building Phoenix directly.
ddogfoodd marked this conversation as resolved
First-time contributor
Copy link

9ebbbec97f should be reverted when this lands.
also this seems useless, since the pref isn't included in the config anyways.


pro futuro,

I'll also note that it's possible use your own Python/system Python if preferred, instead of downloading it from get_sources.sh, by setting PHOENIX_PYTHON to point to your desired location of Python, and by creating your own virtual environment + setting PHOENIX_PYENV_DIR to the path of that environment (I would definitely like to document this though, as well as the other variables).

should be applied to the nix build process, which would make s3cmd, awk (PHOENIX_AWK is only used in get_sources_phoenix.sh) unnecessary. since it uses the output files directly, zip, tar (& date) shouldn't be needed too (fly.sh needs a flag/envvar to not create the archives), so only sed.

https://codeberg.org/celenity/Phoenix/commit/9ebbbec97fdf043550fe9ad139e3637a5004e63e should be reverted when this lands. also [this](https://codeberg.org/celenity/Phoenix/src/commit/9ebbbec97fdf043550fe9ad139e3637a5004e63e/nix/package.nix#L22) seems useless, since the pref isn't included in the config anyways. ___ _pro futuro_, >I'll also note that it's possible use your own Python/system Python if preferred, instead of downloading it from get_sources.sh, by setting PHOENIX_PYTHON to point to your desired location of Python, and by creating your own virtual environment + setting PHOENIX_PYENV_DIR to the path of that environment (I would definitely like to document this though, as well as the other variables). should be applied to the nix build process, which would make s3cmd, awk (PHOENIX_AWK is only used in get_sources_phoenix.sh) unnecessary. since it uses the output files directly, zip, tar (& date) shouldn't be needed too (fly.sh needs a flag/envvar to _not create the archives_), so only sed.
Author
Contributor
Copy link

You are right, I just added every PHOENIX_* I saw in fly.sh, removing. What about awk and date? Since the build didn't fail without replacing their bin paths...
Sed did work before because it was set to just sed on Nix.

You are right, I just added every PHOENIX_* I saw in fly.sh, removing. What about awk and date? Since the build didn't fail without replacing their bin paths... Sed did work before because it was set to just `sed` on Nix.
Author
Contributor
Copy link

@degausser wrote in #337 (comment):

should be applied to the nix build process, which would make s3cmd, awk (PHOENIX_AWK is only used in get_sources_phoenix.sh) unnecessary. since it uses the output files directly, zip, tar (& date) shouldn't be needed too (fly.sh needs a flag/envvar to not create the archives), so only sed.

So don't call the create_archive function when PHOENIX_NIX is set or are there further conditions in which not to create an archive?

@degausser wrote in https://codeberg.org/celenity/Phoenix/pulls/337#issuecomment-18997142: > should be applied to the nix build process, which would make s3cmd, awk (PHOENIX_AWK is only used in get_sources_phoenix.sh) unnecessary. since it uses the output files directly, zip, tar (& date) shouldn't be needed too (fly.sh needs a flag/envvar to _not create the archives_), so only sed. So don't call the `create_archive` function when PHOENIX_NIX is set or are there further conditions in which not to create an archive?

@ddogfoodd wrote in #337 (comment):

What about awk and date? Since the build didn't fail without replacing their bin paths...

IMO we should probably keep awk and date, because they are used directly by the build scripts (which could impact Nix) - ex. date is used for producing the output archives and awk is used for parsing inputs for some of the scripts (I don't think it's technically used directly by fly.sh at the moment though, but it could/will likely be in the future).

@ddogfoodd wrote in https://codeberg.org/celenity/Phoenix/pulls/337#issuecomment-18997205: > What about awk and date? Since the build didn't fail without replacing their bin paths... IMO we should probably keep `awk` and `date`, because they are used directly by the build scripts *(which could impact Nix)* - ex. `date` is used for producing the output archives and `awk` is used for parsing inputs for some of the scripts *(I don't think it's technically used directly by `fly.sh` at the moment though, but it could/will likely be in the future)*.

@ddogfoodd wrote in #337 (comment):

So don't call the create_archive function when PHOENIX_NIX is set or are there further conditions in which not to create an archive?

No, create_archive is actually always called ATM - that being said, I do need to/intend to add an env variable to support disabling it. Once we add it, we can probably set it to the default for Nix builds, and then at that point, we can safely remove date - but we probably need to keep it for now since we don't yet have a mechanism to disable it.

@ddogfoodd wrote in https://codeberg.org/celenity/Phoenix/pulls/337#issuecomment-18997274: > So don't call the `create_archive` function when PHOENIX_NIX is set or are there further conditions in which not to create an archive? No, `create_archive` is actually always called ATM - that being said, I do need to/intend to add an env variable to support disabling it. Once we add it, we can probably set it to the default for Nix builds, and then at that point, we can safely remove `date` - but we probably need to keep it for now since we don't yet have a mechanism to disable it.

@degausser wrote in #337 (comment):

9ebbbec97f should be reverted when this lands.

Yeah, it looks like the changes here should revert that.

also this seems useless, since the pref isn't included in the config anyways.

Agreed - I'm honestly not sure why it was ever added in the first place - guessing it was just something that got added a long time ago. Good catch!

@degausser wrote in https://codeberg.org/celenity/Phoenix/pulls/337#issuecomment-18997142: > [`9ebbbec97f`](https://codeberg.org/celenity/Phoenix/commit/9ebbbec97fdf043550fe9ad139e3637a5004e63e) should be reverted when this lands. Yeah, it looks like the changes here should revert that. > also [this](https://codeberg.org/celenity/Phoenix/src/commit/9ebbbec97fdf043550fe9ad139e3637a5004e63e/nix/package.nix#L22) seems useless, since the pref isn't included in the config anyways. Agreed - I'm honestly not sure why it was ever added in the first place - guessing it was just something that got added a long time ago. Good catch!
celenity left a comment
Copy link

LGTM, thank you both for your efforts @ddogfoodd @degausser!! ❤️

LGTM, thank you both for your efforts @ddogfoodd @degausser!! ❤️
Author
Contributor
Copy link

Thank you all too!

Thank you all too!

FYI: I just went ahead and added support for the env variable to disable archive creation (defaults to disabled for Nix) - ff537c0f75 - I also went ahead and removed the dependency on date for Nix, since we'll no longer need it for future releases.

FYI: I just went ahead and added support for the env variable to disable archive creation *(defaults to disabled for Nix)* - https://codeberg.org/celenity/Phoenix/commit/ff537c0f754a8a9d875528b2702e9c5ed535c6bf - I also went ahead and removed the dependency on `date` for Nix, since we'll no longer need it for future releases.

@celenity wrote in #337 (comment):

FYI: I just went ahead and added support for the env variable to disable archive creation (defaults to disabled for Nix) - ff537c0f75 - I also went ahead and removed the dependency on date for Nix, since we'll no longer need it for future releases.

Occurred to me we should no longer need GNU tar as well, so I went ahead and removed that too.

@celenity wrote in https://codeberg.org/celenity/Phoenix/pulls/337#issuecomment-18998279: > FYI: I just went ahead and added support for the env variable to disable archive creation _(defaults to disabled for Nix)_ - [`ff537c0f75`](https://codeberg.org/celenity/Phoenix/commit/ff537c0f754a8a9d875528b2702e9c5ed535c6bf) - I also went ahead and removed the dependency on `date` for Nix, since we'll no longer need it for future releases. Occurred to me we should no longer need GNU tar as well, so I went ahead and removed that too.
First-time contributor
Copy link

@celenity TZ manipulation should depend on PHOENIX_PRODUCE_ARCHIVES, since it's relevant only for date; just touch-ing the output files is meaningless for "reproducibility"

also we can ducttape the current scripts all we want, but it's obvious fly.sh should be callable on its own, without get_sources{,_phoenix}.sh via build.sh, which would alleviate a lot of related packaging problems (see the debian issue)

@celenity `TZ` manipulation should depend on `PHOENIX_PRODUCE_ARCHIVES`, since it's relevant only for `date`; just touch-ing the output files is meaningless for "reproducibility" also we can ducttape the current scripts all we want, but it's obvious `fly.sh` should be callable on its own, without `get_sources{,_phoenix}.sh` via `build.sh`, which would alleviate a lot of related packaging problems (see the debian issue)
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
celenity/Phoenix!337
Reference in a new issue
celenity/Phoenix
No description provided.
Delete branch ":fix-nix"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?