Comments (8)
Thanks for the work! I'll try building the latest tag this weekend alongside the Rust lib and give you the feedback when I'm done testing stuff.
from kcl-go.
Sorry for the delay! I've briefly tested the latest CLI version, and the variables seem to work correctly.
AlpineLinux is going through a major Python version bump, so I'm not able to build the Rust lib to test things thoroughly (at least for a week or so), but this issue can be closed. I'll open another issue on the main repo if a problem comes up.
from kcl-go.
A very good suggestion, do we need another issue to track the Alpine version of building the KCL Rust library?
I will try to implement it next week, but until then, PRs are very welcome. ❤️
from kcl-go.
I opened a PR to preliminarily implement it, is this the way you want it?
from kcl-go.
Sorry for my misleading suggestion! What I meant by setting at build time is is to use -ldflags of go build
command with -X
option to inject the values of internal variables, which only supports string type.
Maybe something like this, I don't know:
var (
LibHome string
DisableInstallArtifact string
DisableUseArtifactInPath string
)
# then check whether the above variables are empty string, or already set by runtime env KCL_*
Minor comments:
Lines 27 to 30 in c67b127
Lines 26 to 33 in c67b127
Also, I think DisableUseArtifactInPath
isn't really useful. Would downloading artifacts into the same directory as kcl
for both MacOS and Linux make it simpler, and more consistent? Then we only need to require kclvm_cli
is inside PATH.
from kcl-go.
I see. I will open another PR to handle variable injection for the build time. The PR is here #267
from kcl-go.
Sorry for another complaint! The new PR doesn't work. disableInstallArtifact
and disableArtifactInPath
are boolean, while -X
flag only supports variables of string type (-ldflags "-X kcl-lang.io/kcl-go/pkg/env.disableArtifactInPath=true"
won't affect the value). I can set libHome
normally though, as it's ... string 😄
from kcl-go.
Sorry, I forgot to set them as string fields. #270
from kcl-go.
Related Issues (20)
- Import tool use wrong mode and generate schema with error
- KCL Go Plugin API and documents HOT 1
- error get depends HOT 2
- [Question] [API] How can i get all params (option function call) from the kcl code HOT 26
- Disable auto block pr option of contributor-assistant/github-action HOT 1
- Inconsistent native and service KCL api `ParseFile` behaviour HOT 2
- version miss match HOT 2
- ‘_’ seems to be a bit unexpected. HOT 3
- [Enhancement] kcl import muti yaml resource HOT 3
- how to give a dict var HOT 7
- Get locally depended .k files of a given .k file (from imports)
- [Enhancement] Gen KCL config from toml config. HOT 14
- [Enhancement] Gen KCL schema from protobuf message HOT 5
- [Enhancement] Gen KCL config from textproto and KCL type/protobuf message
- [Enhancement] Import multiple documents in single YAML file into one KCL file with the `manifests.yaml_stream` function calling.
- [Enhancement] KCL Import supports importing the entire Go package into KCL schema HOT 5
- [Enhancement] Add log message output for the testing API and tool.
- [Enhancement] `kcl-lang.io/kcl-go` has too many third-party dependencies HOT 1
- Where are the cgo dependencies? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kcl-go.