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

feat: A proper way to use environment variables #382

Closed
crazywhalecc opened this issue Mar 13, 2024 · 0 comments · Fixed by #403
Closed

feat: A proper way to use environment variables #382

crazywhalecc opened this issue Mar 13, 2024 · 0 comments · Fixed by #403
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@crazywhalecc
Copy link
Owner

crazywhalecc commented Mar 13, 2024

According to the descriptions of #377 and #379, spc now needs to add a series of customizable environment variables to implement custom compilation parameters.

Demand is expected to be as follows:

  1. Customize the environment variables for compiling PHP commands, such as CFLAGS, LDFLAGS, etc.
  2. Customize the environment variables of various libraries, such as ZLIB_CFLAGS, etc.
  3. Customize various compilation commands (if necessary, of course, there is a high probability that it may not be considered)

Possible problems expected in response to demand are as follows:

  1. If you directly use global default variable names such as CFLAGS, consider the interference of the default environment on spc's default CFLAGS.
  2. The prefix of the library name needs to be carefully considered according to the rules, or a table of variable names needs to be maintained in the docs.
  3. It is necessary to intervene in shell()->exec(), or completely use configuration form instead of PHP code function build().

Another biggest problem is different libs use different build tools (cmake, configure or direct cc make), of course they accepts different vars.

I'm not opposed to a lot of modification, but I don't know where the boundaries of customization are. There are many different libraries that can directly insert the variables they need through export before building, and we should probably create a branch to determine which values need to be replaced through environment variables.

@crazywhalecc crazywhalecc added enhancement New feature or request help wanted Extra attention is needed labels Mar 13, 2024
@crazywhalecc crazywhalecc added this to the 2.2 Release milestone Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant